summaryrefslogtreecommitdiff
path: root/fileio/root.py
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-08-11 16:43:09 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-08-11 16:43:09 -0400
commit00aa07a12f8f00e29a3a04f2850ccd4fc91cc951 (patch)
tree50c76a5661693f2335278db2d6cc924d3cc60e20 /fileio/root.py
parent9d68f8ea2b6a64e83195f16aa066caac5eeb8fae (diff)
parent1b9aef380e629c136e045412621483ebb4a4164f (diff)
downloadchroma-00aa07a12f8f00e29a3a04f2850ccd4fc91cc951.tar.gz
chroma-00aa07a12f8f00e29a3a04f2850ccd4fc91cc951.tar.bz2
chroma-00aa07a12f8f00e29a3a04f2850ccd4fc91cc951.zip
merge heads
Diffstat (limited to 'fileio/root.py')
-rw-r--r--fileio/root.py19
1 files changed, 19 insertions, 0 deletions
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