14 from ROOT
import Belle2
16 b2.logging.log_level = b2.LogLevel.WARNING
21 """Prints global coordinates of PXD hits to demonstrate the Pythonized
23 Only SensorInfoBase is Pythonized (not PXD:SensorInfo and SVD::SensorInfo),
24 so that there is currently no access to specific PXD/SVD sensor features
25 (like PXD bulk doping or SVD APV25 time constants - such support can be
26 easily added, if desired, by placing the classes in the corresponding
28 Complete geometry and sensor matrix information is, however, available
33 """Initialize the module"""
44 """Prints out PXD hits in global coordinates."""
49 if pxd_clusters.getEntries() > 0:
50 id = pxd_clusters[0].getSensorID()
51 info = geoCache.get(id)
53 b2.B2INFO(
"No PXD hits in this event.")
55 for cluster
in pxd_clusters:
56 if id != cluster.getSensorID():
57 id = cluster.getSensorID()
58 info = geoCache.get(id)
59 b2.B2INFO(
"Layer: {layer}, Ladder: {ladder}, Sensor: {sensor}"
60 .format(layer=id.getLayerNumber(),
61 ladder=id.getLadderNumber(),
62 sensor=id.getSensorNumber()))
64 r_local = ROOT.TVector3(cluster.getU(), cluster.getV(), 0)
65 r_global = info.pointToGlobal(r_local)
66 b2.B2INFO(
'PXD hit: {x:10.5f} {y:10.5f} {z:10.5f}'
67 .format(x=r_global.X(), y=r_global.Y(), z=r_global.Z()))
74 particlegun = b2.register_module(
'ParticleGun')
76 eventinfosetter = b2.register_module(
'EventInfoSetter')
78 progress = b2.register_module(
'Progress')
80 gearbox = b2.register_module(
'Gearbox')
82 geometry = b2.register_module(
'Geometry')
84 simulation = b2.register_module(
'FullSim')
86 pxddigi = b2.register_module(
'PXDDigitizer')
88 pxdclust = b2.register_module(
'PXDClusterizer')
90 printHits = PrintPXDHits()
91 printHits.set_log_level(b2.LogLevel.INFO)
94 eventinfosetter.param({
'evtNumList': [5],
'runList': [1]})
112 'pdgCodes': [211, -211, 11, -11],
113 'momentumGeneration':
'normalPt',
114 'momentumParams': [5, 1],
115 'phiGeneration':
'normal',
116 'phiParams': [0, 360],
117 'thetaGeneration':
'uniformCos',
118 'thetaParams': [17, 150],
119 'vertexGeneration':
'normal',
120 'xVertexParams': [0, 1],
121 'yVertexParams': [0, 1],
122 'zVertexParams': [0, 1],
123 'independentVertices':
False,
127 geometry.param(
'components', [
'MagneticField',
'PXD'])
130 main = b2.create_path()
131 main.add_module(eventinfosetter)
132 main.add_module(progress)
133 main.add_module(particlegun)
134 main.add_module(gearbox)
135 main.add_module(geometry)
136 main.add_module(simulation)
137 main.add_module(pxddigi)
138 main.add_module(pxdclust)
139 main.add_module(printHits)
A (simplified) python wrapper for StoreArray.
static GeoCache & getInstance()
Return a reference to the singleton instance.