From 01d5527db39520ca548518ed1194f8b863a4f077 Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Wed, 10 Aug 2011 11:25:39 -0400 Subject: Rename chroma.io to chroma.fileio to avoid collision with Python package named io --- fileio/root.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 fileio/root.py (limited to 'fileio/root.py') diff --git a/fileio/root.py b/fileio/root.py new file mode 100644 index 0000000..e43f5d4 --- /dev/null +++ b/fileio/root.py @@ -0,0 +1,19 @@ +import ROOT +import os.path + +ROOT.gROOT.ProcessLine('.L '+os.path.join(os.path.dirname(__file__), 'root.C+g')) + +from ROOT import Event + +fill_photons = ROOT.fill_photons +fill_hits = ROOT.fill_hits + +def make_tree(name, desc=''): + '''Create a ROOT tree for holding event information. + + Returns tuple of Event object for filling and TTree. + ''' + tree = ROOT.TTree(name, desc) + ev = ROOT.Event() + tree.Branch('ev', ev) + return ev, tree -- cgit