5 from ROOT
import Belle2
7 logging.log_level = LogLevel.WARNING
13 Counts MCParticles that generate TrueHits.
17 """Initialize the module"""
19 super(CheckMCParticles, self).
__init__()
41 Count the number of MCParticles related to a VXD TrueHit
45 self.nMCParticles += mc_particles.getEntries()
46 for particle
in mc_particles:
47 if not particle.hasStatus(Belle2.MCParticle.c_PrimaryParticle):
48 self.nSecondaries += 1
49 if (len(particle.getRelationsTo(
'PXDTrueHits')) > 0):
50 self.nSecondariesPXD += 1
52 .append(particle.getSecondaryPhysicsProcess())
53 if (len(particle.getRelationsTo(
'SVDTrueHits')) > 0):
54 self.nSecondariesSVD += 1
56 .append(particle.getSecondaryPhysicsProcess())
60 B2INFO(
'Found {nu} secondary MC Particles out of total {n}.'
62 B2INFO(
'Of these, found {n1} secondaries in PXD and {n2} in SVD.'
64 B2INFO(
'Secondary processes for PXD: {list1}; for SVD: {list2}'
70 particlegun = register_module(
'ParticleGun')
72 eventinfosetter = register_module(
'EventInfoSetter')
74 progress = register_module(
'Progress')
76 gearbox = register_module(
'Gearbox')
78 geometry = register_module(
'Geometry')
80 simulation = register_module(
'FullSim')
84 printParticles.set_log_level(LogLevel.INFO)
87 eventinfosetter.param({
'evtNumList': [100],
'runList': [1]})
93 'pdgCodes': [211, -211, 11, -11],
94 'momentumGeneration':
'normalPt',
95 'momentumParams': [2, 1],
96 'phiGeneration':
'normal',
97 'phiParams': [0, 360],
98 'thetaGeneration':
'uniformCos',
99 'thetaParams': [17, 150],
100 'vertexGeneration':
'normal',
101 'xVertexParams': [0, 1],
102 'yVertexParams': [0, 1],
103 'zVertexParams': [0, 1],
104 'independentVertices':
False,
108 geometry.param(
'components', [
'MagneticField',
'PXD',
'SVD'])
112 main.add_module(eventinfosetter)
113 main.add_module(progress)
114 main.add_module(particlegun)
115 main.add_module(gearbox)
116 main.add_module(geometry)
117 main.add_module(simulation)
118 main.add_module(printParticles)