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 48 of file BHWidePlots.py.

Member Function Documentation

◆ event()

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

Definition at line 52 of file BHWidePlots.py.

52  def event(self):
53  """Fill the histograms with the values of the MCParticle collection"""
54 
55  mcParticles = Belle2.PyStoreArray('MCParticles')
56  nTracks = mcParticles.getEntries()
57  h_nTracks.Fill(nTracks)
58  for i in range(nTracks):
59  mc = mcParticles[i]
60  if mc.hasStatus(Belle2.MCParticle.c_PrimaryParticle):
61  p = mc.getMomentum()
62  h_momentum.Fill(p.Mag())
63  h_pt.Fill(p.Perp())
64  h_phi.Fill(p.Phi() / math.pi * 180)
65  h_theta.Fill(p.Theta() / math.pi * 180)
66  h_costheta.Fill(math.cos(p.Theta()))
67  h_pdg.Fill(mc.getPDG())
68  h_vertex.Fill(mc.getProductionVertex().X(),
69  mc.getProductionVertex().Y())
70 
71 
72 # Create the main path and add the modules
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

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