Belle II Software development
TOPDisplay Class Reference
Inheritance diagram for TOPDisplay:

Public Member Functions

def initialize (self)
 
def event (self)
 

Static Public Attributes

list hist
 1D histograms
 
TCanvas c1 = TCanvas('c1', 'TOP event display', 1000, 800)
 canvas
 

Detailed Description

Simple event display for TOP.
It displays single event timing distributions of modules using TOPDigits.
Distributions of modules with the track impact are shown in red color.

Definition at line 32 of file simpleEventDisplay.py.

Member Function Documentation

◆ event()

def event (   self)
Event processor: reset and fill the histograms, display them,
wait for user respond.

Definition at line 52 of file simpleEventDisplay.py.

52 def event(self):
53 '''
54 Event processor: reset and fill the histograms, display them,
55 wait for user respond.
56 '''
57
58 for i in range(16):
59 self.hist[i].Reset()
60 self.hist[i].SetFillColor(0)
61 self.hist[i].SetLineColor(1)
62
63 likelihoods = Belle2.PyStoreArray('TOPLikelihoods')
64 for likelihood in likelihoods:
65 if likelihood.getFlag() == 1:
66 exthit = likelihood.getRelated('ExtHits')
67 try:
68 moduleID = exthit.getCopyID()
69 self.hist[moduleID - 1].SetFillColor(2)
70 self.hist[moduleID - 1].SetLineColor(2)
71 except BaseException:
72 b2.B2ERROR('No relation to ExtHit')
73
74 digits = Belle2.PyStoreArray('TOPDigits')
75 for digit in digits:
76 moduleID = digit.getModuleID()
77 tdc = digit.getRawTime()
78 self.hist[moduleID - 1].Fill(tdc)
79
80 for i in range(16):
81 self.c1.cd(i + 1)
82 self.hist[i].Draw()
83
84 self.c1.Update()
85
86 # wait for user respond
87 user_input = input("Press Enter to continue or Q to quit ").lower().strip()
88 if user_input == "q":
89 evtMetaData = Belle2.PyStoreObj('EventMetaData')
90 evtMetaData.obj().setEndOfData()
91
92
93# Check if the display is set (needed for canvas)
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

◆ initialize()

def initialize (   self)
 Initialize the Module: open the canvas. 

Definition at line 46 of file simpleEventDisplay.py.

46 def initialize(self):
47 ''' Initialize the Module: open the canvas. '''
48
49 self.c1.Divide(4, 4)
50 self.c1.Show()
51

Member Data Documentation

◆ c1

TCanvas c1 = TCanvas('c1', 'TOP event display', 1000, 800)
static

canvas

Definition at line 44 of file simpleEventDisplay.py.

◆ hist

list hist
static
Initial value:
= [TH1F('h' + str(i), 'module#' + str(i), 128, 0.0, 256.0) for i in
range(16)]

1D histograms

Definition at line 41 of file simpleEventDisplay.py.


The documentation for this class was generated from the following file: