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

Public Member Functions

def __init__ (self)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 output_file
 Output file.
 
 tree
 Output tree.
 
 ecms
 Beam energy.
 
 gamma_e
 Virtual photon energy.
 
 gamma_px
 Virtual photon momentum (x component).
 
 gamma_py
 Virtual photon momentum (y component).
 
 gamma_pz
 Virtual photon momentum (z component).
 
 jpsi_e
 J/psi energy.
 
 jpsi_px
 J/psi momentum (x component).
 
 jpsi_py
 J/psi momentum (y component).
 
 jpsi_pz
 J/psi momentum (z component).
 
 lepton_e
 Lepton energy.
 
 lepton_px
 Lepton momentum (x component).
 
 lepton_py
 Lepton momentum (y component).
 
 lepton_pz
 Lepton momentum (z component).
 

Detailed Description

 Analysis module for PhokharaEvtgen. 

Definition at line 18 of file PhokharaEvtgenAnalyze.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Initialization.

Definition at line 21 of file PhokharaEvtgenAnalyze.py.

21 def __init__(self):
22 """Initialization."""
23 super().__init__()
24
25 self.output_file = ROOT.TFile('PhokharaEvtgenAnalysis.root', 'recreate')
26
27 self.tree = ROOT.TTree('tree', '')
28
29 self.ecms = numpy.zeros(1, dtype=numpy.float32)
30
31 self.gamma_e = numpy.zeros(1, dtype=numpy.float32)
32
33 self.gamma_px = numpy.zeros(1, dtype=numpy.float32)
34
35 self.gamma_py = numpy.zeros(1, dtype=numpy.float32)
36
37 self.gamma_pz = numpy.zeros(1, dtype=numpy.float32)
38
39 self.jpsi_e = numpy.zeros(1, dtype=numpy.float32)
40
41 self.jpsi_px = numpy.zeros(1, dtype=numpy.float32)
42
43 self.jpsi_py = numpy.zeros(1, dtype=numpy.float32)
44
45 self.jpsi_pz = numpy.zeros(1, dtype=numpy.float32)
46
47 self.lepton_e = numpy.zeros(1, dtype=numpy.float32)
48
49 self.lepton_px = numpy.zeros(1, dtype=numpy.float32)
50
51 self.lepton_py = numpy.zeros(1, dtype=numpy.float32)
52
53 self.lepton_pz = numpy.zeros(1, dtype=numpy.float32)
54 self.tree.Branch('ecms', self.ecms, 'ecms/F')
55 self.tree.Branch('gamma_e', self.gamma_e, 'gamma_e/F')
56 self.tree.Branch('gamma_px', self.gamma_px, 'gamma_px/F')
57 self.tree.Branch('gamma_py', self.gamma_py, 'gamma_py/F')
58 self.tree.Branch('gamma_pz', self.gamma_pz, 'gamma_pz/F')
59 self.tree.Branch('jpsi_e', self.jpsi_e, 'jpsi_e/F')
60 self.tree.Branch('jpsi_px', self.jpsi_px, 'jpsi_px/F')
61 self.tree.Branch('jpsi_py', self.jpsi_py, 'jpsi_py/F')
62 self.tree.Branch('jpsi_pz', self.jpsi_pz, 'jpsi_pz/F')
63 self.tree.Branch('lepton_e', self.lepton_e, 'lepton_e/F')
64 self.tree.Branch('lepton_px', self.lepton_px, 'lepton_px/F')
65 self.tree.Branch('lepton_py', self.lepton_py, 'lepton_py/F')
66 self.tree.Branch('lepton_pz', self.lepton_pz, 'lepton_pz/F')
67

Member Function Documentation

◆ event()

def event (   self)
 Event function. 

Definition at line 68 of file PhokharaEvtgenAnalyze.py.

68 def event(self):
69 """ Event function. """
70 mc_initial_particles = Belle2.PyStoreObj('MCInitialParticles')
71 self.ecms[0] = mc_initial_particles.getMass()
72 mc_particles = Belle2.PyStoreArray('MCParticles')
73 for mc_particle in mc_particles:
74 # Select virtual photons.
75 if (mc_particle.getPDG() != 10022):
76 continue
77 p = mc_particle.getMomentum()
78 self.gamma_e[0] = mc_particle.getEnergy()
79 self.gamma_px[0] = p.X()
80 self.gamma_py[0] = p.Y()
81 self.gamma_pz[0] = p.Z()
82 jpsi = mc_particle.getDaughters()[0]
83 p = jpsi.getMomentum()
84 self.jpsi_e[0] = jpsi.getEnergy()
85 self.jpsi_px[0] = p.X()
86 self.jpsi_py[0] = p.Y()
87 self.jpsi_pz[0] = p.Z()
88 lepton = jpsi.getDaughters()[0]
89 p = lepton.getMomentum()
90 self.lepton_e[0] = lepton.getEnergy()
91 self.lepton_px[0] = p.X()
92 self.lepton_py[0] = p.Y()
93 self.lepton_pz[0] = p.Z()
94 self.tree.Fill()
95
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

◆ terminate()

def terminate (   self)
 Termination function. 

Definition at line 96 of file PhokharaEvtgenAnalyze.py.

96 def terminate(self):
97 """ Termination function. """
98 self.output_file.cd()
99 self.tree.Write()
100 self.output_file.Close()
101
102

Member Data Documentation

◆ ecms

ecms

Beam energy.

Definition at line 29 of file PhokharaEvtgenAnalyze.py.

◆ gamma_e

gamma_e

Virtual photon energy.

Definition at line 31 of file PhokharaEvtgenAnalyze.py.

◆ gamma_px

gamma_px

Virtual photon momentum (x component).

Definition at line 33 of file PhokharaEvtgenAnalyze.py.

◆ gamma_py

gamma_py

Virtual photon momentum (y component).

Definition at line 35 of file PhokharaEvtgenAnalyze.py.

◆ gamma_pz

gamma_pz

Virtual photon momentum (z component).

Definition at line 37 of file PhokharaEvtgenAnalyze.py.

◆ jpsi_e

jpsi_e

J/psi energy.

Definition at line 39 of file PhokharaEvtgenAnalyze.py.

◆ jpsi_px

jpsi_px

J/psi momentum (x component).

Definition at line 41 of file PhokharaEvtgenAnalyze.py.

◆ jpsi_py

jpsi_py

J/psi momentum (y component).

Definition at line 43 of file PhokharaEvtgenAnalyze.py.

◆ jpsi_pz

jpsi_pz

J/psi momentum (z component).

Definition at line 45 of file PhokharaEvtgenAnalyze.py.

◆ lepton_e

lepton_e

Lepton energy.

Definition at line 47 of file PhokharaEvtgenAnalyze.py.

◆ lepton_px

lepton_px

Lepton momentum (x component).

Definition at line 49 of file PhokharaEvtgenAnalyze.py.

◆ lepton_py

lepton_py

Lepton momentum (y component).

Definition at line 51 of file PhokharaEvtgenAnalyze.py.

◆ lepton_pz

lepton_pz

Lepton momentum (z component).

Definition at line 53 of file PhokharaEvtgenAnalyze.py.

◆ output_file

output_file

Output file.

Definition at line 25 of file PhokharaEvtgenAnalyze.py.

◆ tree

tree

Output tree.

Definition at line 27 of file PhokharaEvtgenAnalyze.py.


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