12from ROOT
import Belle2
14b2.logging.log_level = b2.LogLevel.WARNING
20 Counts MCParticles that generate TrueHits.
24 """Initialize the module"""
48 Count the number of MCParticles related to a VXD TrueHit
52 self.nMCParticles += mc_particles.getEntries()
53 for particle
in mc_particles:
54 if not particle.hasStatus(Belle2.MCParticle.c_PrimaryParticle):
55 self.nSecondaries += 1
56 if (len(particle.getRelationsTo(
'PXDTrueHits')) > 0):
57 self.nSecondariesPXD += 1
59 .append(particle.getSecondaryPhysicsProcess())
60 if (len(particle.getRelationsTo(
'SVDTrueHits')) > 0):
61 self.nSecondariesSVD += 1
63 .append(particle.getSecondaryPhysicsProcess())
67 b2.B2INFO(f
'Found {self.nSecondaries} secondary MC Particles out of total {self.nMCParticles}.')
68 b2.B2INFO(f
'Of these, found {self.nSecondariesPXD} secondaries in PXD and {self.nSecondariesSVD} in SVD.')
69 b2.B2INFO(f
'Secondary processes for PXD: {str(self.processesPXD)}; for SVD: {str(self.processesSVD)}')
73particlegun = b2.register_module(
'ParticleGun')
75eventinfosetter = b2.register_module(
'EventInfoSetter')
77progress = b2.register_module(
'Progress')
79gearbox = b2.register_module(
'Gearbox')
81geometry = b2.register_module(
'Geometry')
83simulation = b2.register_module(
'FullSim')
87printParticles.set_log_level(b2.LogLevel.INFO)
90eventinfosetter.param({
'evtNumList': [100],
'runList': [1]})
96 'pdgCodes': [211, -211, 11, -11],
97 'momentumGeneration':
'normalPt',
98 'momentumParams': [2, 1],
99 'phiGeneration':
'normal',
100 'phiParams': [0, 360],
101 'thetaGeneration':
'uniformCos',
102 'thetaParams': [17, 150],
103 'vertexGeneration':
'normal',
104 'xVertexParams': [0, 1],
105 'yVertexParams': [0, 1],
106 'zVertexParams': [0, 1],
107 'independentVertices':
False,
111geometry.param(
'components', [
'MagneticField',
'PXD',
'SVD'])
114main = b2.create_path()
115main.add_module(eventinfosetter)
116main.add_module(progress)
117main.add_module(particlegun)
118main.add_module(gearbox)
119main.add_module(geometry)
120main.add_module(simulation)
121main.add_module(printParticles)
A (simplified) python wrapper for StoreArray.
nSecondariesSVD
Number of secondaries that generated an SVD TrueHit.
processesPXD
List of processes that generated secondaries in PXD.
nSecondariesPXD
Number of secondaries that generated a PXDTrueHit.
processesSVD
List of processes that generated secondaries in SVD.
nMCParticles
Total number of MCParticles.
nSecondaries
Total number of secondary MCParticles.