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

Member Function Documentation

◆ event()

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

Definition at line 51 of file BHWidePlots.py.

51 def event(self):
52 """Fill the histograms with the values of the MCParticle collection"""
53
54 mcParticles = Belle2.PyStoreArray('MCParticles')
55 nTracks = mcParticles.getEntries()
56 h_nTracks.Fill(nTracks)
57 for i in range(nTracks):
58 mc = mcParticles[i]
59 if mc.hasStatus(Belle2.MCParticle.c_PrimaryParticle):
60 p = mc.getMomentum()
61 h_momentum.Fill(p.Mag())
62 h_pt.Fill(p.Perp())
63 h_phi.Fill(p.Phi() / math.pi * 180)
64 h_theta.Fill(p.Theta() / math.pi * 180)
65 h_costheta.Fill(math.cos(p.Theta()))
66 h_pdg.Fill(mc.getPDG())
67 h_vertex.Fill(mc.getProductionVertex().X(),
68 mc.getProductionVertex().Y())
69
70
71# 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: