Belle II Software  release-05-02-19
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 49 of file KoralWPlots.py.

Member Function Documentation

◆ event()

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

Definition at line 53 of file KoralWPlots.py.

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

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