8 if len(sys.argv) < 2: sys.exit()
10 tFile = ROOT.TFile(fileName,
"OLD")
14 if os.path.exists(
"EDepSimEvents/EDepSimEvents.so"):
15 ROOT.gSystem.Load(
"EDepSimEvents/EDepSimEvents.so")
17 tFile.MakeProject(
"EDepSimEvents",
"*",
"RECREATE++")
20 tFile.Get(
"EDepSimGeometry")
23 events = tFile.Get(
"EDepSimEvents")
27 print "Have event", entry.Event.EventId
28 print "Have primaries", entry.Event.Primaries.size()
29 print "Have primaries", entry.Event.Primaries[0].GeneratorName
32 event = ROOT.TG4Event()
33 events.SetBranchAddress(
"Event",ROOT.AddressOf(event))
38 print "event number", event.EventId
39 print "number of trajectories", event.Trajectories.size()
40 for traj
in event.Trajectories:
41 print " Track Id: ", traj.TrackId
42 print " Parent Id:", traj.ParentId
43 print " Particle: ", traj.Name
44 print " PDG Code: ", traj.PDGCode
45 print " Points: ", traj.Points.size()
47 print "number of segment detectors", event.SegmentDetectors.size()
48 for det
in event.SegmentDetectors:
49 print "Detector name:", det.first,
"Hits:", det.second.size()
52 print " Primary Id: ", hit.PrimaryId
53 print " First Contributor ", hit.Contrib[0]
54 print " Energy Deposit: ", hit.EnergyDeposit
55 print " Secondary Deposit: ", hit.SecondaryDeposit
56 print " Track Length: ", hit.TrackLength
58 hit.Start.X(), hit.Start.Y(), hit.Start.Z()