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

Public Member Functions

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

Public Attributes

 output_file = ROOT.TFile('PhokharaEvtgenAnalysis.root', 'recreate')
 Output file.
 
 tree = ROOT.TTree('tree', '')
 Output tree.
 
 ecms = numpy.zeros(1, dtype=numpy.float32)
 Beam energy.
 
 gamma_e = numpy.zeros(1, dtype=numpy.float32)
 Virtual photon energy.
 
 gamma_px = numpy.zeros(1, dtype=numpy.float32)
 Virtual photon momentum (x component).
 
 gamma_py = numpy.zeros(1, dtype=numpy.float32)
 Virtual photon momentum (y component).
 
 gamma_pz = numpy.zeros(1, dtype=numpy.float32)
 Virtual photon momentum (z component).
 
 jpsi_e = numpy.zeros(1, dtype=numpy.float32)
 J/psi energy.
 
 jpsi_px = numpy.zeros(1, dtype=numpy.float32)
 J/psi momentum (x component).
 
 jpsi_py = numpy.zeros(1, dtype=numpy.float32)
 J/psi momentum (y component).
 
 jpsi_pz = numpy.zeros(1, dtype=numpy.float32)
 J/psi momentum (z component).
 
 lepton_e = numpy.zeros(1, dtype=numpy.float32)
 Lepton energy.
 
 lepton_px = numpy.zeros(1, dtype=numpy.float32)
 Lepton momentum (x component).
 
 lepton_py = numpy.zeros(1, dtype=numpy.float32)
 Lepton momentum (y component).
 
 lepton_pz = numpy.zeros(1, dtype=numpy.float32)
 Lepton momentum (z component).
 

Detailed Description

 Analysis module for PhokharaEvtgen. 

Definition at line 26 of file PhokharaEvtgenAnalyze.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)
Initialization.

Definition at line 29 of file PhokharaEvtgenAnalyze.py.

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

Member Function Documentation

◆ event()

event ( self)
 Event function. 

Definition at line 76 of file PhokharaEvtgenAnalyze.py.

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

◆ terminate()

terminate ( self)
 Termination function. 

Definition at line 104 of file PhokharaEvtgenAnalyze.py.

104 def terminate(self):
105 """ Termination function. """
106 self.output_file.cd()
107 self.tree.Write()
108 self.output_file.Close()
109
110
111# Input.

Member Data Documentation

◆ ecms

ecms = numpy.zeros(1, dtype=numpy.float32)

Beam energy.

Definition at line 37 of file PhokharaEvtgenAnalyze.py.

◆ gamma_e

gamma_e = numpy.zeros(1, dtype=numpy.float32)

Virtual photon energy.

Definition at line 39 of file PhokharaEvtgenAnalyze.py.

◆ gamma_px

gamma_px = numpy.zeros(1, dtype=numpy.float32)

Virtual photon momentum (x component).

Definition at line 41 of file PhokharaEvtgenAnalyze.py.

◆ gamma_py

gamma_py = numpy.zeros(1, dtype=numpy.float32)

Virtual photon momentum (y component).

Definition at line 43 of file PhokharaEvtgenAnalyze.py.

◆ gamma_pz

gamma_pz = numpy.zeros(1, dtype=numpy.float32)

Virtual photon momentum (z component).

Definition at line 45 of file PhokharaEvtgenAnalyze.py.

◆ jpsi_e

jpsi_e = numpy.zeros(1, dtype=numpy.float32)

J/psi energy.

Definition at line 47 of file PhokharaEvtgenAnalyze.py.

◆ jpsi_px

jpsi_px = numpy.zeros(1, dtype=numpy.float32)

J/psi momentum (x component).

Definition at line 49 of file PhokharaEvtgenAnalyze.py.

◆ jpsi_py

jpsi_py = numpy.zeros(1, dtype=numpy.float32)

J/psi momentum (y component).

Definition at line 51 of file PhokharaEvtgenAnalyze.py.

◆ jpsi_pz

jpsi_pz = numpy.zeros(1, dtype=numpy.float32)

J/psi momentum (z component).

Definition at line 53 of file PhokharaEvtgenAnalyze.py.

◆ lepton_e

lepton_e = numpy.zeros(1, dtype=numpy.float32)

Lepton energy.

Definition at line 55 of file PhokharaEvtgenAnalyze.py.

◆ lepton_px

lepton_px = numpy.zeros(1, dtype=numpy.float32)

Lepton momentum (x component).

Definition at line 57 of file PhokharaEvtgenAnalyze.py.

◆ lepton_py

lepton_py = numpy.zeros(1, dtype=numpy.float32)

Lepton momentum (y component).

Definition at line 59 of file PhokharaEvtgenAnalyze.py.

◆ lepton_pz

lepton_pz = numpy.zeros(1, dtype=numpy.float32)

Lepton momentum (z component).

Definition at line 61 of file PhokharaEvtgenAnalyze.py.

◆ output_file

output_file = ROOT.TFile('PhokharaEvtgenAnalysis.root', 'recreate')

Output file.

Definition at line 33 of file PhokharaEvtgenAnalyze.py.

◆ tree

tree = ROOT.TTree('tree', '')

Output tree.

Definition at line 35 of file PhokharaEvtgenAnalyze.py.


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