13 from ROOT
import Belle2
29 '''class to print SVD pitches'''
32 '''print pitch function'''
37 sensorInfo = geoCache.getSensorInfo(vxdID)
38 print(
'pitches of sensor ' + str(layer) +
'.' + str(ladder) +
'.' + str(sensor) +
' at:')
39 print(
' at other coordinate = 0')
40 print(
"U pitch = " + str(sensorInfo.getUPitch(0) * 10000) +
' mu')
41 print(
"V pitch = " + str(sensorInfo.getVPitch(0) * 10000) +
' mu')
42 print(
' at other coordinate = +length/2')
43 print(
"U pitch = " + str(sensorInfo.getUPitch(sensorInfo.getLength() / 2) * 10000) +
' mu')
44 print(
"V pitch = " + str(sensorInfo.getVPitch(sensorInfo.getLength() / 2) * 10000) +
' mu')
45 print(
' at other coordinate = -length/2')
46 print(
"U pitch = " + str(sensorInfo.getUPitch(-sensorInfo.getLength() / 2) * 10000) +
' mu')
47 print(
"V pitch = " + str(sensorInfo.getVPitch(-sensorInfo.getLength() / 2) * 10000) +
' mu')
63 ''' class to print SVD sizes'''
66 '''function to print the sizes'''
71 sensorInfo = geoCache.getSensorInfo(vxdID)
72 print(
'sizes of sensor ' + str(layer) +
'.' + str(ladder) +
'.' + str(sensor) +
' at:')
73 print(
"W size = " + str(sensorInfo.getWSize() * 10000) +
' mu')
74 print(
"V size = " + str(sensorInfo.getVSize() * 10) +
' mm')
75 print(
"U size at V=-length/2 = " + str(sensorInfo.getUSize(-sensorInfo.getLength() / 2) * 10) +
' mm')
76 print(
"U size at V=0 = " + str(sensorInfo.getUSize(0) * 10) +
' mm')
77 print(
"U size at V=+length/2 = " + str(sensorInfo.getUSize(sensorInfo.getLength() / 2) * 10) +
' mm')
93 '''class to print strip length'''
96 '''function to print strip length'''
101 sensorInfo = geoCache.getSensorInfo(vxdID)
102 nUcells = sensorInfo.getUCells() - 1
103 nVcells = sensorInfo.getVCells() - 1
104 print(
'strip lengths ' + str(layer) +
'.' + str(ladder) +
'.' + str(sensor) +
' at:')
105 print(
' V strips at uID=0 = ' + str(sensorInfo.getStripLengthV(0) * 10) +
' mm')
106 print(
' V strips at uID=' + str(nUcells) +
' = ' + str(sensorInfo.getStripLengthV(nUcells) * 10) +
' mm')
107 print(
' U strips at vID=0 = ' + str(sensorInfo.getStripLengthU(0) * 10) +
' mm')
108 print(
' U strips at vID=' + str(nVcells) +
' = ' + str(sensorInfo.getStripLengthU(nVcells) * 10) +
' mm')
124 '''class to print strip positions'''
127 '''function to print strip positions'''
132 sensorInfo = geoCache.getSensorInfo(vxdID)
133 nUcells = sensorInfo.getUCells() - 1
134 nVcells = sensorInfo.getVCells() - 1
135 print(
'strip positions ' + str(layer) +
'.' + str(ladder) +
'.' + str(sensor) +
' at:')
136 print(
' vID=0 = ' + str(sensorInfo.getVCellPosition(0) * 10) +
' mm')
137 print(
' vID=' + str(nVcells) +
' = ' + str(sensorInfo.getVCellPosition(nVcells) * 10) +
' mm')
139 print(
' uID=0 at v=0 = ' + str(sensorInfo.getUCellPosition(0, 0) * 10) +
' mm')
140 print(
' uID=0 at v=' + str(nVcells) +
' = ' + str(sensorInfo.getUCellPosition(0, nVcells) * 10) +
' mm')
141 print(
' uID=' + str(nUcells) +
' at v=0 = ' + str(sensorInfo.getUCellPosition(nUcells, 0) * 10) +
' mm')
142 print(
' uID=' + str(nUcells) +
' at v=' + str(nVcells) +
' = ' +
143 str(sensorInfo.getUCellPosition(nUcells, nVcells) * 10) +
' mm')
146 print(
'U cellID at vID=nVcell (0) = ' +
147 str(sensorInfo.getUCellID(sensorInfo.getUCellPosition(0, nVcells), sensorInfo.getVCellPosition(nVcells))))
148 print(
'U cellID at vID=0 (0) = ' +
149 str(sensorInfo.getUCellID(sensorInfo.getUCellPosition(0, 0), sensorInfo.getVCellPosition(0))))
165 '''class to print svd sensors'''
171 print(
"printing all sensors of the SVD in the geometry:")
172 for layer
in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
173 layerNumber = layer.getLayerNumber()
174 for ladder
in geoCache.getLadders(layer):
175 ladderNumber = ladder.getLadderNumber()
176 for sensor
in geoCache.getSensors(ladder):
177 sensorNumber = sensor.getSensorNumber()
178 print(str(layerNumber) +
"." + str(ladderNumber) +
"." + str(sensorNumber))
182 '''class to print svd ladders'''
189 print(
"printing all L3 backward sensors position of the SVD in the geometry:")
190 print(
"format: sensorID X(cm) Y(cm) phi(rad) phi(deg)")
191 for layer
in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
192 layerNumber = layer.getLayerNumber()
194 if not layerNumber == 3:
197 for ladder
in geoCache.getLadders(layer):
198 ladderNumber = ladder.getLadderNumber()
199 for sensor
in geoCache.getSensors(ladder):
200 sensorNumber = sensor.getSensorNumber()
201 if not(sensorNumber == layerNumber - 1):
204 sensorID = str(layerNumber) +
"." + str(ladderNumber)
206 local = r.TVector3(0, 0, 0)
207 glob = geoCache.getSensorInfo(sensor).pointToGlobal(local)
209 angleRad = m.atan2(glob.Y(), glob.X())
212 angleRad = 2 * m.pi + angleRad
213 print(
"second = " + str(angleRad))
215 angleDeg = m.degrees(angleRad)
217 xStr =
"{0:.2f}".format(round(glob.X(), 2))
218 yStr =
"{0:.2f}".format(round(glob.Y(), 2))
219 radStr =
"{0:.2f}".format(round(angleRad, 4))
220 degStr =
"{0:.2f}".format(round(angleDeg, 2))
221 print(sensorID +
' ' + xStr +
' ' + yStr +
' ' + radStr +
' ' + degStr)
229 main = b2.create_path()
231 eventinfosetter = b2.register_module(
'EventInfoSetter')
232 eventinfosetter.param(
'expList', [1003])
233 eventinfosetter.param(
'runList', [0])
234 eventinfosetter.param(
'evtNumList', [1])
235 main.add_module(eventinfosetter)
237 main.add_module(
"Gearbox")
238 main.add_module(
'Geometry')
static GeoCache & getInstance()
Return a reference to the singleton instance.
Class to uniquely identify a any structure of the PXD and SVD.
def printPitch(self, layer, ladder, sensor)
def printSize(self, layer, ladder, sensor)
def printStripLength(self, layer, ladder, sensor)
def printStripPosition(self, layer, ladder, sensor)