17 from ROOT
import PyConfig
18 PyConfig.StartGuiThread =
True
22 from ROOT
import Belle2
25 basf2.logging.log_level = basf2.LogLevel.WARNING
28 h_nTracks = ROOT.TH1D(
'nTracks',
'Number of Tracks per Event;#', 20, 0, 20)
29 h_pdg = ROOT.TH1D(
'pid',
'Particle code of particles', 100, -50, 50)
30 h_momentum = ROOT.TH1D(
'momentum',
'Momentum of particles', 200, 0, 8)
31 h_pt = ROOT.TH1D(
'pt',
'Transverse Momentum of particles', 200, 0, 6)
32 h_phi = ROOT.TH1D(
'phi',
'Azimuth angle of particles', 200, -180, 180)
33 h_theta = ROOT.TH1D(
'theta',
'Polar angle of particles', 200, 0, 180)
34 h_costheta = ROOT.TH1D(
'costheta',
'Cosinus of the polar angle of particles',
38 'XY Vertex of particles',
50 """Simple module to collect some information about MCParticles"""
53 """Fill the histograms with the values of the MCParticle collection"""
56 nTracks = mcParticles.getEntries()
57 h_nTracks.Fill(nTracks)
58 for i
in range(nTracks):
60 if mc.hasStatus(Belle2.MCParticle.c_PrimaryParticle):
62 h_momentum.Fill(p.Mag())
64 h_phi.Fill(p.Phi() / math.pi * 180)
65 h_theta.Fill(p.Theta() / math.pi * 180)
66 h_costheta.Fill(math.cos(p.Theta()))
67 h_pdg.Fill(mc.getPDG())
68 h_vertex.Fill(mc.getProductionVertex().X(),
69 mc.getProductionVertex().Y())
73 main = basf2.create_path()
76 main.add_module(
"EventInfoSetter", expList=0, runList=1, evtNumList=100)
79 bhwide = basf2.register_module(
'BHWideInput')
82 bhwide.param(
'ScatteringAngleRangePositron', [5.7, 174.3])
85 bhwide.param(
'ScatteringAngleRangeElectron', [5.7, 174.3])
89 bhwide.set_log_level(basf2.LogLevel.INFO)
94 main.add_module(
"Progress")
95 main.add_module(bhwide)
96 main.add_module(showMCPart)
102 print(basf2.statistics)
105 c = ROOT.TCanvas(
'Canvas',
'Canvas', 1536, 768)
106 c.Divide(4, 2, 1e-5, 1e-5)
118 for (i, h)
in enumerate(histograms):
123 h_vertex.Draw(
'colz')
A (simplified) python wrapper for StoreArray.