36 fdetector = detector==
'liquid'
37 for aDigi
in self.
sTree.Digi_SBTHits:
39 detID = aDigi.GetDetectorID()
40 if fdetector
and detID > 999999:
continue
41 if not fdetector
and not detID > 999999:
continue
44 for mcP
in self.
sTree.digiSBT2MC[index]:
45 if mcParticle>0
and mcParticle != mcP : found=
True
46 if mcParticle<0
and abs(mcParticle) == mcP : found=
True
48 position = aDigi.GetXYZ()
49 ELoss = aDigi.GetEloss()
50 if aDigi.isValid(): hitSegments += 1
52 veto = self.
random.Rndm() > w
54 return veto, w, hitSegments
104 nav = ROOT.gGeoManager.GetCurrentNavigator()
107 delPhi = 2.*ROOT.TMath.Pi()/nSteps
109 nav.SetCurrentPoint(aPoint.x(),aPoint.y(),aPoint.z())
111 aNode = nav.FindNode()
112 if aNode: cNode = aNode.GetName()
113 if cNode !=
'T2decayVol_0' and cNode !=
'T1decayVol_0':
116 for n
in range(nSteps):
118 xDir = ROOT.TMath.Sin(phi)
119 yDir = ROOT.TMath.Cos(phi)
120 nav.SetCurrentPoint(aPoint.x(),aPoint.y(),aPoint.z())
121 cNode = nav.FindNode().GetName()
122 nav.SetCurrentDirection(xDir,yDir,0.)
123 rc = nav.FindNextBoundaryAndStep()
124 x,y = nav.GetCurrentPoint()[0],nav.GetCurrentPoint()[1]
125 if cNode != nav.GetCurrentNode().GetName():
126 dist = ROOT.TMath.Sqrt( (aPoint.x()-x)**2 + (aPoint.y()-y)**2)
127 if dist < distmin : distmin = dist
131 shape = nav.GetCurrentNode().GetVolume().GetShape()
132 origin = array(
'd',[0,0,shape.GetDZ()])
133 master = array(
'd',[0,0,0])
134 nav.LocalToMaster(origin,master)
135 dist = master[2] - aPoint.z()
136 if dist < distmin : distmin = dist
139 shape = nav.GetCurrentNode().GetVolume().GetShape()
140 origin = array(
'd',[0,0,shape.GetDZ()])
141 master = array(
'd',[0,0,0])
142 nav.LocalToMaster(origin,master)
143 dist = aPoint.z() - master[2]