18 from ROOT
import Belle2
24 """Generate some histograms to pass to the display."""
27 edep_hist = TH1F(
"CDC_edep",
"Energy deposition from CDCSimHits", 100, 0.0, 10e-6)
29 pos_hist = TH3F(
"CDC_pos",
"Positions of CDCSimHits",
35 """reimplementation of Module::initialize()."""
40 """reimplementation of Module::event()."""
46 for hit
in cdcsimhits:
47 self.
edep_histedep_hist.Fill(hit.getEnergyDep())
49 self.
pos_histpos_hist.Fill(p.X(), p.Y(), p.Z())
51 displayData.obj().addHistogram(
"CDC_edep", self.
edep_histedep_hist)
52 displayData.obj().addHistogram(
"CDC_pos", self.
pos_histpos_hist)
56 eventinfosetter = b2.register_module(
'EventInfoSetter')
57 eventinfosetter.param(
'evtNumList', [500])
61 gearbox = b2.register_module(
'Gearbox')
62 geometry = b2.register_module(
'Geometry')
63 geometry.param(
'components', [
'CDC',
'MagneticField'])
65 particlegun = b2.register_module(
'ParticleGun')
68 g4sim = b2.register_module(
'FullSim')
70 g4sim.logging.log_level = b2.LogLevel.ERROR
73 main = b2.create_path()
76 main.add_module(eventinfosetter)
78 main.add_module(gearbox)
79 main.add_module(geometry)
80 main.add_module(particlegun)
81 main.add_module(g4sim)
86 display = b2.register_module(
'Display')
87 main.add_module(display)
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.
edep_hist
histogram for SimHit energy deposition
pos_hist
histogram for SimHit positions