17from ROOT
import Belle2
23 """Generate some histograms to pass to the display."""
26 edep_hist = TH1F(
"CDC_edep",
"Energy deposition from CDCSimHits", 100, 0.0, 10e-6)
28 pos_hist = TH3F(
"CDC_pos",
"Positions of CDCSimHits",
34 """reimplementation of Module::initialize()."""
39 """reimplementation of Module::event()."""
45 for hit
in cdcsimhits:
48 self.
pos_hist.Fill(p.X(), p.Y(), p.Z())
50 displayData.obj().addHistogram(
"CDC_edep", self.
edep_hist)
51 displayData.obj().addHistogram(
"CDC_pos", self.
pos_hist)
55eventinfosetter = b2.register_module(
'EventInfoSetter')
56eventinfosetter.param(
'evtNumList', [500])
60gearbox = b2.register_module(
'Gearbox')
61geometry = b2.register_module(
'Geometry')
62geometry.param(
'components', [
'CDC',
'MagneticField'])
64particlegun = b2.register_module(
'ParticleGun')
67g4sim = b2.register_module(
'FullSim')
69g4sim.logging.log_level = b2.LogLevel.ERROR
72main = b2.create_path()
75main.add_module(eventinfosetter)
77main.add_module(gearbox)
78main.add_module(geometry)
79main.add_module(particlegun)
85display = b2.register_module(
'Display')
86main.add_module(display)
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.
TH3F pos_hist
histogram for SimHit positions
TH1F edep_hist
histogram for SimHit energy deposition