12from ROOT
import PyConfig
13PyConfig.StartGuiThread =
False
20from ROOT
import Belle2
21from ROOT
import TCanvas, TH1F
22from simulation
import add_simulation
23from reconstruction
import add_reconstruction
35 Simple event display for TOP.
36 It displays single event timing distributions of modules using TOPDigits.
37 Distributions of modules
with the track impact are shown
in red color.
41 hist = [TH1F('h' + str(i),
'module#' + str(i), 128, 0.0, 256.0)
for i
in
44 c1 = TCanvas(
'c1',
'TOP event display', 1000, 800)
47 ''' Initialize the Module: open the canvas. '''
54 Event processor: reset and fill the histograms, display them,
55 wait
for user respond.
60 self.
hist[i].SetFillColor(0)
61 self.
hist[i].SetLineColor(1)
64 for likelihood
in likelihoods:
65 if likelihood.getFlag() == 1:
66 exthit = likelihood.getRelated(
'ExtHits')
68 moduleID = exthit.getCopyID()
69 self.
hist[moduleID - 1].SetFillColor(2)
70 self.
hist[moduleID - 1].SetLineColor(2)
72 b2.B2ERROR(
'No relation to ExtHit')
76 moduleID = digit.getModuleID()
77 tdc = digit.getRawTime()
78 self.
hist[moduleID - 1].Fill(tdc)
87 user_input = input(
"Press Enter to continue or Q to quit ").lower().strip()
90 evtMetaData.obj().setEndOfData()
94if 'DISPLAY' not in os.environ:
95 print(
'DISPLAY variable is not set')
96 print(
'- to set it in bash: export DISPLAY=:0')
97 print(
'- to set it in csh: setenv DISPLAY :0')
101b2.set_log_level(b2.LogLevel.ERROR)
104main = b2.create_path()
107eventinfosetter = b2.register_module(
'EventInfoSetter')
108eventinfosetter.param(
'evtNumList', [1000])
109main.add_module(eventinfosetter)
112evtgeninput = b2.register_module(
'EvtGenInput')
113main.add_module(evtgeninput)
117if 'BELLE2_BACKGROUND_DIR' in os.environ:
118 bg = glob.glob(os.environ[
'BELLE2_BACKGROUND_DIR'] +
'/*.root')
119add_simulation(main, bkgfiles=bg)
122add_reconstruction(main)
128progress = b2.register_module(
'Progress')
129main.add_module(progress)
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.