Belle II Software  release-08-01-10
TOPDisplay Class Reference
Inheritance diagram for TOPDisplay:
Collaboration diagram for TOPDisplay:

Public Member Functions

def initialize (self)
 
def event (self)
 

Static Public Attributes

list hist
 1D histograms More...
 
 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 33 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 53 of file simpleEventDisplay.py.

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

Member Data Documentation

◆ 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 42 of file simpleEventDisplay.py.


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