Belle II Software  release-05-01-25
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 32 of file ParticleGunPlots.py.

Member Function Documentation

◆ event()

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

Definition at line 35 of file ParticleGunPlots.py.

35  def event(self):
36  """Fill the histograms with the values of the MCParticle collection"""
37  mcParticles = Belle2.PyStoreArray('MCParticles')
38  h_nTracks.Fill(mcParticles.getEntries())
39  for mc in mcParticles:
40  p = mc.getMomentum()
41  h_momentum.Fill(p.Mag())
42  h_pt.Fill(p.Perp())
43  h_phi.Fill(p.Phi() / math.pi * 180)
44  h_theta.Fill(p.Theta() / math.pi * 180)
45  h_costheta.Fill(math.cos(p.Theta()))
46  h_pdg.Fill(mc.getPDG())
47  h_xyvertex.Fill(mc.getProductionVertex().X() * 1e4,
48  mc.getProductionVertex().Y() * 1e4)
49  h_zxvertex.Fill(mc.getProductionVertex().Z() * 1e4,
50  mc.getProductionVertex().X() * 1e4)
51  h_zyvertex.Fill(mc.getProductionVertex().Z() * 1e4,
52  mc.getProductionVertex().Y() * 1e4)
53 
54 # Create Modules

The documentation for this class was generated from the following file:
ClusterEfficiency.ClusterEfficiency.event
def event(self)
Definition: ClusterEfficiency.py:146
Belle2::PyStoreArray
a (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:58