6 from __future__
import print_function
7 import glob, os, re, sys, getopt
9 gSystem.Load(
"libedepsim_io.so")
10 from ROOT
import TG4Event
14 print(depth,
"Class: ", primaryParticle.ClassName())
15 print(depth,
"Track Id:", primaryParticle.GetTrackId())
16 print(depth,
"Name:", primaryParticle.GetName())
17 print(depth,
"PDG Code:",primaryParticle.GetPDGCode())
18 print(depth,
"Momentum:",primaryParticle.GetMomentum().
X(),
19 primaryParticle.GetMomentum().
Y(),
20 primaryParticle.GetMomentum().
Z(),
21 primaryParticle.GetMomentum().
E(),
22 primaryParticle.GetMomentum().
P(),
23 primaryParticle.GetMomentum().M())
27 print(depth,
"Class: ", primaryVertex.ClassName())
28 print(depth,
"Position:", primaryVertex.GetPosition().
X(),
29 primaryVertex.GetPosition().
Y(),
30 primaryVertex.GetPosition().
Z(),
31 primaryVertex.GetPosition().
T())
32 print(depth,
"Generator:",primaryVertex.GetGeneratorName())
33 print(depth,
"Reaction:",primaryVertex.GetReaction())
34 print(depth,
"Filename:",primaryVertex.GetFilename())
35 print(depth,
"InteractionNumber:",primaryVertex.GetInteractionNumber())
37 for infoVertex
in primaryVertex.Informational:
39 for primaryParticle
in primaryVertex.Particles:
44 print(depth,
"Class: ", trajectoryPoint.ClassName())
45 print(depth,
"Position:", trajectoryPoint.GetPosition().
X(),
46 trajectoryPoint.GetPosition().
Y(),
47 trajectoryPoint.GetPosition().
Z(),
48 trajectoryPoint.GetPosition().
T())
49 print(depth,
"Momentum:", trajectoryPoint.GetMomentum().
X(),
50 trajectoryPoint.GetMomentum().
Y(),
51 trajectoryPoint.GetMomentum().
Z(),
52 trajectoryPoint.GetMomentum().Mag())
53 print(depth,
"Process",trajectoryPoint.GetProcess())
54 print(depth,
"Subprocess",trajectoryPoint.GetSubprocess())
58 print(depth,
"Class: ", trajectory.ClassName())
60 print(depth,
"Track Id/Parent Id:",
61 trajectory.GetTrackId(),
62 trajectory.GetParentId())
63 print(depth,
"Name:",trajectory.GetName())
64 print(depth,
"PDG Code",trajectory.GetPDGCode())
65 print(depth,
"Initial Momentum:",trajectory.GetInitialMomentum().
X(),
66 trajectory.GetInitialMomentum().
Y(),
67 trajectory.GetInitialMomentum().
Z(),
68 trajectory.GetInitialMomentum().
E(),
69 trajectory.GetInitialMomentum().
P(),
70 trajectory.GetInitialMomentum().M())
71 for trajectoryPoint
in trajectory.Points:
76 print(depth,
"Class: ", hitSegment.ClassName())
77 print(depth,
"Primary Id:", hitSegment.GetPrimaryId());
78 print(depth,
"Energy Deposit:",hitSegment.GetEnergyDeposit())
79 print(depth,
"Secondary Deposit:", hitSegment.GetSecondaryDeposit())
80 print(depth,
"Track Length:",hitSegment.GetTrackLength())
81 print(depth,
"Start:", hitSegment.GetStart().
X(),
82 hitSegment.GetStart().
Y(),
83 hitSegment.GetStart().
Z(),
84 hitSegment.GetStart().
T())
85 print(depth,
"Stop:", hitSegment.GetStop().
X(),
86 hitSegment.GetStop().
Y(),
87 hitSegment.GetStop().
Z(),
88 hitSegment.GetStop().
T())
89 print(depth,
"Contributor:", [contributor
for contributor
in hitSegment.Contrib])
95 print(depth,
"Detector: ", containerName, hitSegments.size())
105 inputFile=TFile(
"100TestTree.root")
108 inputTree=inputFile.Get(
"EDepSimEvents")
109 print(
"Class:",inputTree.ClassName())
113 inputTree.SetBranchAddress(
"Event",event)
116 entries=inputTree.GetEntriesFast()
117 for jentry
in xrange(entries):
118 nb = inputTree.GetEntry(jentry)
120 print(
"Class: ", event.ClassName())
121 print(
"Event number:", event.EventId)
123 for primaryVertex
in event.Primaries:
128 print(
"Number of segment containers:", event.SegmentDetectors.size())
129 for containerName, hitSegments
in event.SegmentDetectors:
132 if __name__ ==
"__main__":
std::pair< float, std::string > P
def printTrajectoryPoint(depth, trajectoryPoint)
def printHitSegment(depth, hitSegment)
def printSegmentContainer(depth, containerName, hitSegments)
def printPrimaryParticle(depth, primaryParticle)
def printPrimaryVertex(depth, primaryVertex)
def printTrajectory(depth, trajectory)