16from ROOT
import PyConfig
17PyConfig.StartGuiThread =
True
21from ROOT
import Belle2
24basf2.logging.log_level = basf2.LogLevel.WARNING
27h_nTracks = ROOT.TH1D(
'nTracks',
'Number of Tracks per Event;#', 20, 0, 20)
28h_pdg = ROOT.TH1D(
'pid',
'Particle code of particles', 100, -50, 50)
29h_momentum = ROOT.TH1D(
'momentum',
'Momentum of particles', 200, 0, 8)
30h_pt = ROOT.TH1D(
'pt',
'Transverse Momentum of particles', 200, 0, 2)
31h_phi = ROOT.TH1D(
'phi',
'Azimuth angle of particles', 200, -180, 180)
32h_theta = ROOT.TH1D(
'theta',
'Polar angle of particles', 200, 0, 180)
33h_costheta = ROOT.TH1D(
'costheta',
'Cosinus of the polar angle of particles',
37 'XY Vertex of particles',
49 """Simple module to collect some information about MCParticles"""
52 """Fill the histograms with the values of the MCParticle collection"""
55 nTracks = mcParticles.getEntries()
56 h_nTracks.Fill(nTracks)
57 for i
in range(nTracks):
59 if mc.hasStatus(Belle2.MCParticle.c_PrimaryParticle):
61 h_momentum.Fill(p.Mag())
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())
71main = basf2.create_path()
74main.add_module(
"EventInfoSetter", expList=0, runList=1, evtNumList=100)
77koralw = basf2.register_module(
'KoralWInput')
81koralw.set_log_level(basf2.LogLevel.INFO)
84progress = basf2.register_module(
'Progress')
88main.add_module(progress)
89main.add_module(koralw)
90main.add_module(showMCPart)
96print(basf2.statistics)
99c = ROOT.TCanvas(
'Canvas',
'Canvas', 1536, 768)
100c.Divide(4, 2, 1e-5, 1e-5)
112for (i, h)
in enumerate(histograms):
A (simplified) python wrapper for StoreArray.