13from ROOT
import Belle2
15b2.logging.log_level = b2.LogLevel.WARNING
20 """Prints global coordinates of PXD hits to demonstrate the Pythonized
22 Only SensorInfoBase is Pythonized (
not PXD:SensorInfo
and SVD::SensorInfo),
23 so that there
is currently no access to specific PXD/SVD sensor features
24 (like PXD bulk doping
or SVD APV25 time constants - such support can be
25 easily added,
if desired, by placing the classes
in the corresponding
27 Complete geometry
and sensor matrix information
is, however, available
32 """Initialize the module"""
43 """Prints out PXD hits in global coordinates."""
48 if pxd_clusters.getEntries() > 0:
49 id = pxd_clusters[0].getSensorID()
50 info = geoCache.get(id)
52 b2.B2INFO(
"No PXD hits in this event.")
54 for cluster
in pxd_clusters:
55 if id != cluster.getSensorID():
56 id = cluster.getSensorID()
57 info = geoCache.get(id)
58 b2.B2INFO(f
"Layer: {id.getLayerNumber()}, Ladder: {id.getLadderNumber()}, Sensor: {id.getSensorNumber()}")
60 r_local = ROOT.TVector3(cluster.getU(), cluster.getV(), 0)
61 r_global = info.pointToGlobal(r_local)
62 b2.B2INFO(f
'PXD hit: {r_global.X():10.5f} {r_global.Y():10.5f} {r_global.Z():10.5f}')
69particlegun = b2.register_module(
'ParticleGun')
71eventinfosetter = b2.register_module(
'EventInfoSetter')
73progress = b2.register_module(
'Progress')
75gearbox = b2.register_module(
'Gearbox')
77geometry = b2.register_module(
'Geometry')
79simulation = b2.register_module(
'FullSim')
81pxddigi = b2.register_module(
'PXDDigitizer')
83pxdclust = b2.register_module(
'PXDClusterizer')
85printHits = PrintPXDHits()
86printHits.set_log_level(b2.LogLevel.INFO)
89eventinfosetter.param({
'evtNumList': [5],
'runList': [1]})
107 'pdgCodes': [211, -211, 11, -11],
108 'momentumGeneration':
'normalPt',
109 'momentumParams': [5, 1],
110 'phiGeneration':
'normal',
111 'phiParams': [0, 360],
112 'thetaGeneration':
'uniformCos',
113 'thetaParams': [17, 150],
114 'vertexGeneration':
'normal',
115 'xVertexParams': [0, 1],
116 'yVertexParams': [0, 1],
117 'zVertexParams': [0, 1],
118 'independentVertices':
False,
122geometry.param(
'components', [
'MagneticField',
'PXD'])
125main = b2.create_path()
126main.add_module(eventinfosetter)
127main.add_module(progress)
128main.add_module(particlegun)
129main.add_module(gearbox)
130main.add_module(geometry)
131main.add_module(simulation)
132main.add_module(pxddigi)
133main.add_module(pxdclust)
134main.add_module(printHits)
A (simplified) python wrapper for StoreArray.
static GeoCache & getInstance()
Return a reference to the singleton instance.