Belle II Software development
CheckMCParticles Class Reference
Inheritance diagram for CheckMCParticles:

Public Member Functions

def __init__ (self)
 
def initialize (self)
 
def beginRun (self)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 nSecondariesPXD
 Number of secondaries that generated a PXDTrueHit.
 
 nSecondariesSVD
 Number of secondaries that generated an SVD TrueHit.
 
 nMCParticles
 Total number of MCParticles.
 
 nSecondaries
 Total number of secondary MCParticles.
 
 processesPXD
 List of processes that generated secondaries in PXD.
 
 processesSVD
 List of processes that generated secondaries in SVD.
 

Detailed Description

Counts MCParticles that generate TrueHits.

Definition at line 17 of file SavedMCParticles.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Initialize the module

Definition at line 23 of file SavedMCParticles.py.

23 def __init__(self):
24 """Initialize the module"""
25
26 super().__init__()
27
28 self.nSecondariesPXD = 0
29
30 self.nSecondariesSVD = 0
31
32 self.nMCParticles = 0
33
34 self.nSecondaries = 0
35
36 self.processesPXD = []
37
38 self.processesSVD = []
39

Member Function Documentation

◆ beginRun()

def beginRun (   self)
 Does nothing 

Definition at line 43 of file SavedMCParticles.py.

43 def beginRun(self):
44 """ Does nothing """
45

◆ event()

def event (   self)
Count the number of MCParticles related to a VXD TrueHit

Definition at line 46 of file SavedMCParticles.py.

46 def event(self):
47 """
48 Count the number of MCParticles related to a VXD TrueHit
49 """
50
51 mc_particles = Belle2.PyStoreArray('MCParticles')
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
58 self.processesPXD\
59 .append(particle.getSecondaryPhysicsProcess())
60 if (len(particle.getRelationsTo('SVDTrueHits')) > 0):
61 self.nSecondariesSVD += 1
62 self.processesSVD\
63 .append(particle.getSecondaryPhysicsProcess())
64
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

◆ initialize()

def initialize (   self)
 Does nothing 

Definition at line 40 of file SavedMCParticles.py.

40 def initialize(self):
41 """ Does nothing """
42

◆ terminate()

def terminate (   self)
 Write results 

Definition at line 65 of file SavedMCParticles.py.

65 def terminate(self):
66 """ Write results """
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)}')
70
71
72# Particle gun module

Member Data Documentation

◆ nMCParticles

nMCParticles

Total number of MCParticles.

Definition at line 32 of file SavedMCParticles.py.

◆ nSecondaries

nSecondaries

Total number of secondary MCParticles.

Definition at line 34 of file SavedMCParticles.py.

◆ nSecondariesPXD

nSecondariesPXD

Number of secondaries that generated a PXDTrueHit.

Definition at line 28 of file SavedMCParticles.py.

◆ nSecondariesSVD

nSecondariesSVD

Number of secondaries that generated an SVD TrueHit.

Definition at line 30 of file SavedMCParticles.py.

◆ processesPXD

processesPXD

List of processes that generated secondaries in PXD.

Definition at line 36 of file SavedMCParticles.py.

◆ processesSVD

processesSVD

List of processes that generated secondaries in SVD.

Definition at line 38 of file SavedMCParticles.py.


The documentation for this class was generated from the following file: