Belle II Software  release-05-02-19
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 25 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 45 of file simpleEventDisplay.py.

45  def event(self):
46  '''
47  Event processor: reset and fill the histograms, display them,
48  wait for user respond.
49  '''
50 
51  for i in range(16):
52  self.hist[i].Reset()
53  self.hist[i].SetFillColor(0)
54  self.hist[i].SetLineColor(1)
55 
56  likelihoods = Belle2.PyStoreArray('TOPLikelihoods')
57  for likelihood in likelihoods:
58  if likelihood.getFlag() == 1:
59  exthit = likelihood.getRelated('ExtHits')
60  try:
61  moduleID = exthit.getCopyID()
62  self.hist[moduleID - 1].SetFillColor(2)
63  self.hist[moduleID - 1].SetLineColor(2)
64  except:
65  B2ERROR('No relation to ExtHit')
66 
67  digits = Belle2.PyStoreArray('TOPDigits')
68  for digit in digits:
69  moduleID = digit.getModuleID()
70  tdc = digit.getRawTime()
71  self.hist[moduleID - 1].Fill(tdc)
72 
73  for i in range(16):
74  self.c1.cd(i + 1)
75  self.hist[i].Draw()
76 
77  self.c1.Update()
78 
79  # wait for user respond
80  try:
81  q = 0
82  Q = 0
83  abc = eval(input('Type <CR> to continue or Q to quit '))
84  evtMetaData = Belle2.PyStoreObj('EventMetaData')
85  evtMetaData.obj().setEndOfData()
86  except:
87  abc = '' # dummy line to terminate try-except
88 
89 
90 # Check if the display is set (needed for canvas)

◆ initialize()

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

Definition at line 39 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 34 of file simpleEventDisplay.py.


The documentation for this class was generated from the following file:
Belle2::PyStoreObj
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:69
ClusterEfficiency.ClusterEfficiency.event
def event(self)
Definition: ClusterEfficiency.py:146
Belle2::eval
double eval(const std::vector< double > &spl, const std::vector< double > &vals, double x)
Evaluate spline (zero order or first order) in point x.
Definition: tools.h:118
Belle2::PyStoreArray
a (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:58