diff options
author | Stan Seibert <stan@mtrr.org> | 2011-08-03 17:27:20 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-08-03 17:27:20 -0400 |
commit | acbeb1170dffc7b09ce4174cc5ef10a4ff0b3b1c (patch) | |
tree | 79345fe54ab26059a9ff66b4a9f6d3ce20cbaf45 /io/root.py | |
parent | e13a62d7e3a532ba125b704f858c4a3361ba31a7 (diff) | |
download | chroma-acbeb1170dffc7b09ce4174cc5ef10a4ff0b3b1c.tar.gz chroma-acbeb1170dffc7b09ce4174cc5ef10a4ff0b3b1c.tar.bz2 chroma-acbeb1170dffc7b09ce4174cc5ef10a4ff0b3b1c.zip |
ROOT data structure for holding particle, photon, and hit information.
Diffstat (limited to 'io/root.py')
-rw-r--r-- | io/root.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/io/root.py b/io/root.py new file mode 100644 index 0000000..382905a --- /dev/null +++ b/io/root.py @@ -0,0 +1,16 @@ +import ROOT +import os.path + +ROOT.gROOT.ProcessLine('.L '+os.path.join(os.path.dirname(__file__), 'root.C+g')) + +from ROOT import Event + +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 |