18 from ROOT
import PyConfig
19 PyConfig.StartGuiThread =
True
22 basf2.logging.log_level = basf2.LogLevel.WARNING
26 from ROOT
import Belle2
29 h_nTracks = ROOT.TH1D(
'nTracks',
'Number of Tracks per Event;#', 20, 0, 20)
30 h_pdg = ROOT.TH1D(
'pid',
'Particle code of particles', 100, -50, 50)
31 h_momentum = ROOT.TH1D(
'momentum',
'Momentum of particles', 200, 0, 8)
32 h_pt = ROOT.TH1D(
'pt',
'Transverse Momentum of particles', 200, 0, 6)
33 h_phi = ROOT.TH1D(
'phi',
'Azimuth angle of particles', 200, -180, 180)
34 h_theta = ROOT.TH1D(
'theta',
'Polar angle of particles', 200, 0, 180)
35 h_costheta = ROOT.TH1D(
'costheta',
'Cosinus of the polar angle of particles',
39 'XY Vertex of particles',
51 """Simple module to collect some information about MCParticles"""
54 """Fill the histograms with the values of the MCParticle collection"""
57 nTracks = mcParticles.getEntries()
58 h_nTracks.Fill(nTracks)
59 for i
in range(nTracks):
61 if mc.hasStatus(Belle2.MCParticle.c_PrimaryParticle):
63 h_momentum.Fill(p.Mag())
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())
74 main = basf2.create_path()
77 main.add_module(
"EventInfoSetter", expList=0, runList=1, evtNumList=100)
80 bhwide = basf2.register_module(
'BHWideInput')
83 bhwide.param(
'ScatteringAngleRangePositron', [5.7, 174.3])
86 bhwide.param(
'ScatteringAngleRangeElectron', [5.7, 174.3])
90 bhwide.set_log_level(basf2.LogLevel.INFO)
95 main.add_module(
"Progress")
96 main.add_module(bhwide)
97 main.add_module(showMCPart)
103 print(basf2.statistics)
106 c = ROOT.TCanvas(
'Canvas',
'Canvas', 1536, 768)
107 c.Divide(4, 2, 1e-5, 1e-5)
119 for (i, h)
in enumerate(histograms):
124 h_vertex.Draw(
'colz')