38 def SBT_decision(self, mcParticle=None, detector="liquid") -> tuple[bool, float, int]:
43 fdetector = detector ==
"liquid"
44 for aDigi
in self.
sTree.Digi_SBTHits:
46 detID = aDigi.GetDetectorID()
47 if fdetector
and detID > 999999:
49 if not fdetector
and not detID > 999999:
52 contributors = list(self.
sTree.digiSBT2MC[index])
55 if mcParticle
not in contributors:
59 if abs(mcParticle)
in contributors:
66 veto = self.
random.Rndm() > w
68 return veto, w, hitSegments
126 nav = ROOT.gGeoManager.GetCurrentNavigator()
129 delPhi = 2.0 * ROOT.TMath.Pi() / nSteps
131 nav.SetCurrentPoint(aPoint.x(), aPoint.y(), aPoint.z())
133 aNode = nav.FindNode()
135 cNode = aNode.GetName()
136 if not cNode.startswith(
"decay_medium"):
139 for n
in range(nSteps):
141 xDir = ROOT.TMath.Sin(phi)
142 yDir = ROOT.TMath.Cos(phi)
143 nav.SetCurrentPoint(aPoint.x(), aPoint.y(), aPoint.z())
144 cNode = nav.FindNode().GetName()
145 nav.SetCurrentDirection(xDir, yDir, 0.0)
146 nav.FindNextBoundaryAndStep()
147 x, y = nav.GetCurrentPoint()[0], nav.GetCurrentPoint()[1]
148 if cNode != nav.GetCurrentNode().GetName():
149 dist = ROOT.TMath.Sqrt((aPoint.x() - x) ** 2 + (aPoint.y() - y) ** 2)
155 shape = nav.GetCurrentNode().GetVolume().GetShape()
156 origin = array(
"d", [0, 0, shape.GetDZ()])
157 master = array(
"d", [0, 0, 0])
158 nav.LocalToMaster(origin, master)
159 dist = master[2] - aPoint.z()
164 shape = nav.GetCurrentNode().GetVolume().GetShape()
165 origin = array(
"d", [0, 0, shape.GetDZ()])
166 master = array(
"d", [0, 0, 0])
167 nav.LocalToMaster(origin, master)
168 dist = aPoint.z() - master[2]