111 def fiducialCheck(self, aPoint):
112 nav = ROOT.gGeoManager.GetCurrentNavigator()
113 phi = 0.0
114 nSteps = 36
115 delPhi = 2.0 * ROOT.TMath.Pi() / nSteps
116 distmin = 1e10
117 nav.SetCurrentPoint(aPoint.x(), aPoint.y(), aPoint.z())
118 cNode = "outside"
119 aNode = nav.FindNode()
120 if aNode:
121 cNode = aNode.GetName()
122 if cNode not in (
123 "DecayVacuum_block4_0",
124 "DecayVacuum_block5_0",
125 "DecayVacuum_block3_0",
126 "DecayVacuum_block2_0",
127 "DecayVacuum_block1_0",
128 ):
129 distmin = 0.0
130 else:
131 for n in range(nSteps):
132
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)
142 if dist < distmin:
143 distmin = dist
144 phi += delPhi
145
146 nav.cd("/Tr1_1")
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()
152 if dist < distmin:
153 distmin = dist
154
155 nav.cd("/Veto_5")
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]
161 return distmin
162
163
164
165
166
167
168
169
170
171