From acbeb1170dffc7b09ce4174cc5ef10a4ff0b3b1c Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Wed, 3 Aug 2011 17:27:20 -0400 Subject: ROOT data structure for holding particle, photon, and hit information. --- io/root.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 io/root.py (limited to 'io/root.py') 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 -- cgit