183 def beginRun(self):
184 '''begin run'''
185
187
188 print("printing all L3 backward sensors position of the SVD in the geometry:")
189 print("format: sensorID X(cm) Y(cm) phi(rad) phi(deg)")
190 for layer in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
191 layerNumber = layer.getLayerNumber()
192
193 if not layerNumber == 3:
194 continue
195
196 for ladder in geoCache.getLadders(layer):
197 ladderNumber = ladder.getLadderNumber()
198 for sensor in geoCache.getSensors(ladder):
199 sensorNumber = sensor.getSensorNumber()
200 if not(sensorNumber == layerNumber - 1):
201 continue
202
203 sensorID = str(layerNumber) + "." + str(ladderNumber)
204
205 local = r.Math.XYZVector(0, 0, 0)
206 glob = geoCache.getSensorInfo(sensor).pointToGlobal(local)
207
208 angleRad = m.atan2(glob.Y(), glob.X())
209 print(angleRad)
210 if(angleRad < 0):
211 angleRad = 2 * m.pi + angleRad
212 print("second = " + str(angleRad))
213
214 angleDeg = m.degrees(angleRad)
215
216 xStr = f"{round(glob.X(), 2):.2f}"
217 yStr = f"{round(glob.Y(), 2):.2f}"
218 radStr = f"{round(angleRad, 4):.2f}"
219 degStr = f"{round(angleDeg, 2):.2f}"
220 print(sensorID + ' ' + xStr + ' ' + yStr + ' ' + radStr + ' ' + degStr)
221
222
223
224
225
226
227
static GeoCache & getInstance()
Return a reference to the singleton instance.