42 def event(self):
43 """Fill the histograms with the values of the MCParticle collection"""
45 h_nTracks.Fill(mcParticles.getEntries())
46 for mc in mcParticles:
47 p = mc.getMomentum()
48 h_momentum.Fill(p.Mag())
49 h_pt.Fill(p.Perp())
50 h_phi.Fill(p.Phi() / math.pi * 180)
51 h_theta.Fill(p.Theta() / math.pi * 180)
52 h_costheta.Fill(math.cos(p.Theta()))
53 h_pdg.Fill(mc.getPDG())
54 h_xyvertex.Fill(mc.getProductionVertex().X() * 1e4,
55 mc.getProductionVertex().Y() * 1e4)
56 h_zxvertex.Fill(mc.getProductionVertex().Z() * 1e4,
57 mc.getProductionVertex().X() * 1e4)
58 h_zyvertex.Fill(mc.getProductionVertex().Z() * 1e4,
59 mc.getProductionVertex().Y() * 1e4)
60
61
62
A (simplified) python wrapper for StoreArray.