12from ROOT
import Belle2
28 '''class to print SVD pitches'''
31 '''print pitch function'''
36 sensorInfo = geoCache.getSensorInfo(vxdID)
37 print(
'pitches of sensor ' + str(layer) +
'.' + str(ladder) +
'.' + str(sensor) +
' at:')
38 print(
' at other coordinate = 0')
39 print(
"U pitch = " + str(sensorInfo.getUPitch(0) * 10000) +
' mu')
40 print(
"V pitch = " + str(sensorInfo.getVPitch(0) * 10000) +
' mu')
41 print(
' at other coordinate = +length/2')
42 print(
"U pitch = " + str(sensorInfo.getUPitch(sensorInfo.getLength() / 2) * 10000) +
' mu')
43 print(
"V pitch = " + str(sensorInfo.getVPitch(sensorInfo.getLength() / 2) * 10000) +
' mu')
44 print(
' at other coordinate = -length/2')
45 print(
"U pitch = " + str(sensorInfo.getUPitch(-sensorInfo.getLength() / 2) * 10000) +
' mu')
46 print(
"V pitch = " + str(sensorInfo.getVPitch(-sensorInfo.getLength() / 2) * 10000) +
' mu')
62 ''' class to print SVD sizes'''
65 '''function to print the sizes'''
70 sensorInfo = geoCache.getSensorInfo(vxdID)
71 print(
'sizes of sensor ' + str(layer) +
'.' + str(ladder) +
'.' + str(sensor) +
' at:')
72 print(
"W size = " + str(sensorInfo.getWSize() * 10000) +
' mu')
73 print(
"V size = " + str(sensorInfo.getVSize() * 10) +
' mm')
74 print(
"U size at V=-length/2 = " + str(sensorInfo.getUSize(-sensorInfo.getLength() / 2) * 10) +
' mm')
75 print(
"U size at V=0 = " + str(sensorInfo.getUSize(0) * 10) +
' mm')
76 print(
"U size at V=+length/2 = " + str(sensorInfo.getUSize(sensorInfo.getLength() / 2) * 10) +
' mm')
92 '''class to print strip length'''
95 '''function to print strip length'''
100 sensorInfo = geoCache.getSensorInfo(vxdID)
101 nUcells = sensorInfo.getUCells() - 1
102 nVcells = sensorInfo.getVCells() - 1
103 print(
'strip lengths ' + str(layer) +
'.' + str(ladder) +
'.' + str(sensor) +
' at:')
104 print(
' V strips at uID=0 = ' + str(sensorInfo.getStripLengthV(0) * 10) +
' mm')
105 print(
' V strips at uID=' + str(nUcells) +
' = ' + str(sensorInfo.getStripLengthV(nUcells) * 10) +
' mm')
106 print(
' U strips at vID=0 = ' + str(sensorInfo.getStripLengthU(0) * 10) +
' mm')
107 print(
' U strips at vID=' + str(nVcells) +
' = ' + str(sensorInfo.getStripLengthU(nVcells) * 10) +
' mm')
123 '''class to print strip positions'''
126 '''function to print strip positions'''
131 sensorInfo = geoCache.getSensorInfo(vxdID)
132 nUcells = sensorInfo.getUCells() - 1
133 nVcells = sensorInfo.getVCells() - 1
134 print(
'strip positions ' + str(layer) +
'.' + str(ladder) +
'.' + str(sensor) +
' at:')
135 print(
' vID=0 = ' + str(sensorInfo.getVCellPosition(0) * 10) +
' mm')
136 print(
' vID=' + str(nVcells) +
' = ' + str(sensorInfo.getVCellPosition(nVcells) * 10) +
' mm')
138 print(
' uID=0 at v=0 = ' + str(sensorInfo.getUCellPosition(0, 0) * 10) +
' mm')
139 print(
' uID=0 at v=' + str(nVcells) +
' = ' + str(sensorInfo.getUCellPosition(0, nVcells) * 10) +
' mm')
140 print(
' uID=' + str(nUcells) +
' at v=0 = ' + str(sensorInfo.getUCellPosition(nUcells, 0) * 10) +
' mm')
141 print(
' uID=' + str(nUcells) +
' at v=' + str(nVcells) +
' = ' +
142 str(sensorInfo.getUCellPosition(nUcells, nVcells) * 10) +
' mm')
145 print(
'U cellID at vID=nVcell (0) = ' +
146 str(sensorInfo.getUCellID(sensorInfo.getUCellPosition(0, nVcells), sensorInfo.getVCellPosition(nVcells))))
147 print(
'U cellID at vID=0 (0) = ' +
148 str(sensorInfo.getUCellID(sensorInfo.getUCellPosition(0, 0), sensorInfo.getVCellPosition(0))))
164 '''class to print svd sensors'''
170 print(
"printing all sensors of the SVD in the geometry:")
171 for layer
in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
172 layerNumber = layer.getLayerNumber()
173 for ladder
in geoCache.getLadders(layer):
174 ladderNumber = ladder.getLadderNumber()
175 for sensor
in geoCache.getSensors(ladder):
176 sensorNumber = sensor.getSensorNumber()
177 print(str(layerNumber) +
"." + str(ladderNumber) +
"." + str(sensorNumber))
181 '''class to print svd ladders'''
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()
193 if not layerNumber == 3:
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):
203 sensorID = str(layerNumber) +
"." + str(ladderNumber)
205 local = r.Math.XYZVector(0, 0, 0)
206 glob = geoCache.getSensorInfo(sensor).pointToGlobal(local)
208 angleRad = m.atan2(glob.Y(), glob.X())
211 angleRad = 2 * m.pi + angleRad
212 print(
"second = " + str(angleRad))
214 angleDeg = m.degrees(angleRad)
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)
228main = b2.create_path()
230eventinfosetter = b2.register_module(
'EventInfoSetter')
231eventinfosetter.param(
'expList', [1003])
232eventinfosetter.param(
'runList', [0])
233eventinfosetter.param(
'evtNumList', [1])
234main.add_module(eventinfosetter)
236main.add_module(
"Gearbox")
237main.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)