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

Public Member Functions

def event (self)
 

Detailed Description

Simple module to collect some information about MCParticles

Definition at line 39 of file ParticleGunPlots.py.

Member Function Documentation

◆ event()

def event (   self)
Fill the histograms with the values of the MCParticle collection

Definition at line 42 of file ParticleGunPlots.py.

42 def event(self):
43 """Fill the histograms with the values of the MCParticle collection"""
44 mcParticles = Belle2.PyStoreArray('MCParticles')
45 h_nTracks.Fill(mcParticles.getEntries())
46 for mc in mcParticles:
47 p = mc.getMomentum()
48 h_momentum.Fill(p.Mag())
49 h_pt.Fill(p.Perp())
50 h_phi.Fill(p.Phi() / math.pi * 180)
51 h_theta.Fill(p.Theta() / math.pi * 180)
52 h_costheta.Fill(math.cos(p.Theta()))
53 h_pdg.Fill(mc.getPDG())
54 h_xyvertex.Fill(mc.getProductionVertex().X() * 1e4,
55 mc.getProductionVertex().Y() * 1e4)
56 h_zxvertex.Fill(mc.getProductionVertex().Z() * 1e4,
57 mc.getProductionVertex().X() * 1e4)
58 h_zyvertex.Fill(mc.getProductionVertex().Z() * 1e4,
59 mc.getProductionVertex().Y() * 1e4)
60
61
62# Create Modules
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

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