8 from ROOT
import Belle2
10 logging.log_level = LogLevel.WARNING
15 """Prints global coordinates of PXD hits to demonstrate the Pythonized
17 Only SensorInfoBase is Pythonized (not PXD:SensorInfo and SVD::SensorInfo),
18 so that there is currently no access to specific PXD/SVD sensor features
19 (like PXD bulk doping or SVD APV25 time constants - such support can be
20 easily added, if desired, by placing the classes in the corresponding
22 Complete geometry and sensor matrix information is, however, available
27 """Initialize the module"""
38 """Prints out PXD hits in global coordinates."""
43 if pxd_clusters.getEntries() > 0:
44 id = pxd_clusters[0].getSensorID()
45 info = geoCache.get(id)
47 B2INFO(
"No PXD hits in this event.")
49 for cluster
in pxd_clusters:
50 if id != cluster.getSensorID():
51 id = cluster.getSensorID()
52 info = geoCache.get(id)
53 B2INFO(
"Layer: {layer}, Ladder: {ladder}, Sensor: {sensor}"
54 .format(layer=id.getLayerNumber(),
55 ladder=id.getLadderNumber(),
56 sensor=id.getSensorNumber()))
58 r_local = ROOT.TVector3(cluster.getU(), cluster.getV(), 0)
59 r_global = info.pointToGlobal(r_local)
60 B2INFO(
'PXD hit: {x:10.5f} {y:10.5f} {z:10.5f}'
61 .format(x=r_global.X(), y=r_global.Y(), z=r_global.Z()))
68 particlegun = register_module(
'ParticleGun')
70 eventinfosetter = register_module(
'EventInfoSetter')
72 progress = register_module(
'Progress')
74 gearbox = register_module(
'Gearbox')
76 geometry = register_module(
'Geometry')
78 simulation = register_module(
'FullSim')
80 pxddigi = register_module(
'PXDDigitizer')
82 pxdclust = register_module(
'PXDClusterizer')
84 printHits = PrintPXDHits()
85 printHits.set_log_level(LogLevel.INFO)
88 eventinfosetter.param({
'evtNumList': [5],
'runList': [1]})
106 'pdgCodes': [211, -211, 11, -11],
107 'momentumGeneration':
'normalPt',
108 'momentumParams': [5, 1],
109 'phiGeneration':
'normal',
110 'phiParams': [0, 360],
111 'thetaGeneration':
'uniformCos',
112 'thetaParams': [17, 150],
113 'vertexGeneration':
'normal',
114 'xVertexParams': [0, 1],
115 'yVertexParams': [0, 1],
116 'zVertexParams': [0, 1],
117 'independentVertices':
False,
121 geometry.param(
'components', [
'MagneticField',
'PXD'])
125 main.add_module(eventinfosetter)
126 main.add_module(progress)
127 main.add_module(particlegun)
128 main.add_module(gearbox)
129 main.add_module(geometry)
130 main.add_module(simulation)
131 main.add_module(pxddigi)
132 main.add_module(pxdclust)
133 main.add_module(printHits)