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

Public Member Functions

def __init__ (self, pdgcode)
 
def event (self)
 

Public Attributes

 pdgcode
 pdg code to be studied
 
 eventExtraInfo
 event extra info object
 

Detailed Description

Module to determine the multiplicities of a particle of a certain pdg code

Definition at line 30 of file SplitMultiplicities.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  pdgcode 
)
Initialise the class.
:param pdgcode: pdg code to be studied

Definition at line 35 of file SplitMultiplicities.py.

35 def __init__(self, pdgcode):
36 """
37 Initialise the class.
38 :param pdgcode: pdg code to be studied
39 """
40 super().__init__()
41
42 self.pdgcode = pdgcode
43
44 self.eventExtraInfo = Belle2.PyStoreObj("EventExtraInfo")
45
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

Member Function Documentation

◆ event()

def event (   self)
 Event function 

Definition at line 46 of file SplitMultiplicities.py.

46 def event(self):
47 """ Event function """
48
49 # set counters to 0
50 gen_counter = 0
51 Bp_counter = 0
52 Bm_counter = 0
53 B0_counter = 0
54 antiB0_counter = 0
55
56 # get generator particles and loop over them until reaching a B+/B-/B0/antiB0 mother
57 mcParticles = Belle2.PyStoreArray('MCParticles')
58 for mcparticle in mcParticles:
59 if (mcparticle.isPrimaryParticle()) and (mcparticle.getPDG() == self.pdgcode):
60 gen_counter += 1
61 mcMother = mcparticle.getMother()
62 while mcMother:
63 pdg = mcMother.getPDG()
64 if pdg == 521: # B+
65 Bp_counter += 1
66 break
67 elif pdg == -521: # B-
68 Bm_counter += 1
69 break
70 elif pdg == 511: # B0
71 B0_counter += 1
72 break
73 elif pdg == -511: # antiB0
74 antiB0_counter += 1
75 break
76 else:
77 mcMother = mcMother.getMother()
78
79 # create the extra info names and save the corresponding multiplicities
80 extraInfoName = f'nGen_{self.pdgcode}'
81 extraInfoName_Bp = f'nGen_{self.pdgcode}_Bp'
82 extraInfoName_Bm = f'nGen_{self.pdgcode}_Bm'
83 extraInfoName_B0 = f'nGen_{self.pdgcode}_B0'
84 extraInfoName_antiB0 = f'nGen_{self.pdgcode}_antiB0'
85
86 self.eventExtraInfo.create()
87 self.eventExtraInfo.setExtraInfo(extraInfoName, gen_counter)
88 self.eventExtraInfo.setExtraInfo(extraInfoName_Bp, Bp_counter)
89 self.eventExtraInfo.setExtraInfo(extraInfoName_Bm, Bm_counter)
90 self.eventExtraInfo.setExtraInfo(extraInfoName_B0, B0_counter)
91 self.eventExtraInfo.setExtraInfo(extraInfoName_antiB0, antiB0_counter)
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

Member Data Documentation

◆ eventExtraInfo

eventExtraInfo

event extra info object

Definition at line 44 of file SplitMultiplicities.py.

◆ pdgcode

pdgcode

pdg code to be studied

Definition at line 42 of file SplitMultiplicities.py.


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