13 from ROOT
import Belle2
15 b2.logging.log_level = b2.LogLevel.WARNING
21 Counts MCParticles that generate TrueHits.
25 """Initialize the module"""
27 super(CheckMCParticles, self).
__init__()
49 Count the number of MCParticles related to a VXD TrueHit
53 self.nMCParticles += mc_particles.getEntries()
54 for particle
in mc_particles:
55 if not particle.hasStatus(Belle2.MCParticle.c_PrimaryParticle):
56 self.nSecondaries += 1
57 if (len(particle.getRelationsTo(
'PXDTrueHits')) > 0):
58 self.nSecondariesPXD += 1
60 .append(particle.getSecondaryPhysicsProcess())
61 if (len(particle.getRelationsTo(
'SVDTrueHits')) > 0):
62 self.nSecondariesSVD += 1
64 .append(particle.getSecondaryPhysicsProcess())
68 b2.B2INFO(
'Found {nu} secondary MC Particles out of total {n}.'
70 b2.B2INFO(
'Of these, found {n1} secondaries in PXD and {n2} in SVD.'
72 b2.B2INFO(
'Secondary processes for PXD: {list1}; for SVD: {list2}'
78 particlegun = b2.register_module(
'ParticleGun')
80 eventinfosetter = b2.register_module(
'EventInfoSetter')
82 progress = b2.register_module(
'Progress')
84 gearbox = b2.register_module(
'Gearbox')
86 geometry = b2.register_module(
'Geometry')
88 simulation = b2.register_module(
'FullSim')
92 printParticles.set_log_level(b2.LogLevel.INFO)
95 eventinfosetter.param({
'evtNumList': [100],
'runList': [1]})
101 'pdgCodes': [211, -211, 11, -11],
102 'momentumGeneration':
'normalPt',
103 'momentumParams': [2, 1],
104 'phiGeneration':
'normal',
105 'phiParams': [0, 360],
106 'thetaGeneration':
'uniformCos',
107 'thetaParams': [17, 150],
108 'vertexGeneration':
'normal',
109 'xVertexParams': [0, 1],
110 'yVertexParams': [0, 1],
111 'zVertexParams': [0, 1],
112 'independentVertices':
False,
116 geometry.param(
'components', [
'MagneticField',
'PXD',
'SVD'])
119 main = b2.create_path()
120 main.add_module(eventinfosetter)
121 main.add_module(progress)
122 main.add_module(particlegun)
123 main.add_module(gearbox)
124 main.add_module(geometry)
125 main.add_module(simulation)
126 main.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.