5 from ROOT
import PyConfig
6 PyConfig.StartGuiThread =
False
13 from ROOT
import Belle2
14 from ROOT
import TH1F, TH2F, TCanvas
15 from simulation
import add_simulation
16 from reconstruction
import add_reconstruction
28 Simple event display for TOP.
29 It displays single event timing distributions of modules using TOPDigits.
30 Distributions of modules with the track impact are shown in red color.
34 hist = [TH1F(
'h' + str(i),
'module#' + str(i), 128, 0.0, 256.0)
for i
in
37 c1 = TCanvas(
'c1',
'TOP event display', 1000, 800)
40 ''' Initialize the Module: open the canvas. '''
47 Event processor: reset and fill the histograms, display them,
48 wait for user respond.
53 self.
hist[i].SetFillColor(0)
54 self.
hist[i].SetLineColor(1)
57 for likelihood
in likelihoods:
58 if likelihood.getFlag() == 1:
59 exthit = likelihood.getRelated(
'ExtHits')
61 moduleID = exthit.getCopyID()
62 self.
hist[moduleID - 1].SetFillColor(2)
63 self.
hist[moduleID - 1].SetLineColor(2)
65 B2ERROR(
'No relation to ExtHit')
69 moduleID = digit.getModuleID()
70 tdc = digit.getRawTime()
71 self.
hist[moduleID - 1].Fill(tdc)
83 abc =
eval(input(
'Type <CR> to continue or Q to quit '))
85 evtMetaData.obj().setEndOfData()
91 if 'DISPLAY' not in os.environ:
92 print(
'DISPLAY variable is not set')
93 print(
'- to set it in bash: export DISPLAY=:0')
94 print(
'- to set it in csh: setenv DISPLAY :0')
98 set_log_level(LogLevel.ERROR)
104 eventinfosetter = register_module(
'EventInfoSetter')
105 eventinfosetter.param(
'evtNumList', [1000])
106 main.add_module(eventinfosetter)
109 evtgeninput = register_module(
'EvtGenInput')
110 main.add_module(evtgeninput)
114 if 'BELLE2_BACKGROUND_DIR' in os.environ:
115 bg = glob.glob(os.environ[
'BELLE2_BACKGROUND_DIR'] +
'/*.root')
116 add_simulation(main, bkgfiles=bg)
119 add_reconstruction(main)
125 progress = register_module(
'Progress')
126 main.add_module(progress)