11 "initialize and give response of the veto systems"
17 ROOT.gRandom.SetSeed(13)
22 fGeo = ROOT.gGeoManager
24 for v
in fGeo.GetListOfVolumes():
26 i = fGeo.FindVolumeFast(nm).GetNumber()
36 def SBT_decision(self, mcParticle=None, detector="liquid") -> tuple[bool, float, int]:
41 fdetector = detector ==
"liquid"
42 for aDigi
in self.
sTree.Digi_SBTHits:
44 detID = aDigi.GetDetectorID()
45 if fdetector
and detID > 999999:
47 if not fdetector
and not detID > 999999:
51 for mcP
in self.
sTree.digiSBT2MC[index]:
52 if mcParticle > 0
and mcParticle != mcP:
54 if mcParticle < 0
and abs(mcParticle) == mcP:
63 veto = self.
random.Rndm() > w
65 return veto, w, hitSegments
67 def UBT_decision(self, mcParticle=None) -> tuple[bool, float, int]:
70 for ahit
in self.
sTree.UpstreamTaggerPoint:
72 if mcParticle > 0
and mcParticle != ahit.GetTrackID():
74 if mcParticle < 0
and abs(mcParticle) == ahit.GetTrackID():
80 veto = self.
random.Rndm() > w
86 for aTrack
in self.
sTree.FitTracks:
89 if mcParticle > 0
and mcParticle != self.
sTree.fitTrack2MC[k]:
91 if mcParticle < 0
and abs(mcParticle) == self.
sTree.fitTrack2MC[k]:
93 fstatus = aTrack.getFitStatus()
94 if not fstatus.isFitConverged():
96 if fstatus.getNdf() < 25:
103 return veto, w, nMultCon
106 hnl = self.
sTree.Particles[n]
107 aPoint = ROOT.TVector3(hnl.Vx(), hnl.Vy(), hnl.Vz())
112 nav = ROOT.gGeoManager.GetCurrentNavigator()
115 delPhi = 2.0 * ROOT.TMath.Pi() / nSteps
117 nav.SetCurrentPoint(aPoint.x(), aPoint.y(), aPoint.z())
119 aNode = nav.FindNode()
121 cNode = aNode.GetName()
123 "DecayVacuum_block4_0",
124 "DecayVacuum_block5_0",
125 "DecayVacuum_block3_0",
126 "DecayVacuum_block2_0",
127 "DecayVacuum_block1_0",
131 for n
in range(nSteps):
133 xDir = ROOT.TMath.Sin(phi)
134 yDir = ROOT.TMath.Cos(phi)
135 nav.SetCurrentPoint(aPoint.x(), aPoint.y(), aPoint.z())
136 cNode = nav.FindNode().GetName()
137 nav.SetCurrentDirection(xDir, yDir, 0.0)
138 nav.FindNextBoundaryAndStep()
139 x, y = nav.GetCurrentPoint()[0], nav.GetCurrentPoint()[1]
140 if cNode != nav.GetCurrentNode().GetName():
141 dist = ROOT.TMath.Sqrt((aPoint.x() - x) ** 2 + (aPoint.y() - y) ** 2)
147 shape = nav.GetCurrentNode().GetVolume().GetShape()
148 origin = array(
"d", [0, 0, shape.GetDZ()])
149 master = array(
"d", [0, 0, 0])
150 nav.LocalToMaster(origin, master)
151 dist = master[2] - aPoint.z()
156 shape = nav.GetCurrentNode().GetVolume().GetShape()
157 origin = array(
"d", [0, 0, shape.GetDZ()])
158 master = array(
"d", [0, 0, 0])
159 nav.LocalToMaster(origin, master)
160 dist = aPoint.z() - master[2]
def fiducialCheckSignal(self, n)
tuple[bool, float, int] SBT_decision(self, mcParticle=None, detector="liquid")
tuple[bool, float, int] UBT_decision(self, mcParticle=None)
tuple[bool, int|float, int] Track_decision(self, mcParticle=None)
def fiducialCheck(self, aPoint)
None SBT_liquid_decision(self, mcParticle=None)
None SBT_plastic_decision(self, mcParticle=None)