51 def event(self):
52 """Fill the histograms with the values of the MCParticle collection"""
53
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
A (simplified) python wrapper for StoreArray.