Belle II Software  release-08-01-10
ShowMCParticles Class Reference
Inheritance diagram for ShowMCParticles:
Collaboration diagram for ShowMCParticles:

Public Member Functions

def event (self)
 

Detailed Description

Simple module to collect some information about MCParticles

Definition at line 40 of file ParticleGunPlots.py.

Member Function Documentation

◆ event()

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

Definition at line 43 of file ParticleGunPlots.py.

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

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