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

Public Member Functions

def event (self)
 
def terminate (self)
 

Static Public Attributes

list hist
 2D histograms
 
int pixelID = 482
 pixel ID
 
TH2F propTime
 histogram
 

Detailed Description

 A module to histogram pixel hits from individual fibers

Definition at line 29 of file laserPixelIlumination.py.

Member Function Documentation

◆ event()

def event (   self)
 Event processor: fill histograms 

Definition at line 44 of file laserPixelIlumination.py.

44 def event(self):
45 ''' Event processor: fill histograms '''
46
47 digits = Belle2.PyStoreArray('TOPDigits')
48 for digit in digits:
49 simhits = digit.getRelationsWith('TOPSimHits') # several simhits can contribute
50 for simhit in simhits:
51 photon = simhit.getRelated('TOPSimPhotons') # one or none possible
52 if photon:
53 k = int((photon.getEmissionPoint().X() + 22.5) / 5.5)
54 if k >= 0 and k < 9:
55 self.hist[k].Fill(digit.getPixelCol(), digit.getPixelRow())
56 else:
57 b2.B2ERROR('wrong decoding of fiber number: ' + str(k + 1))
58 if digit.getPixelID() == self.pixelID:
59 t = photon.getDetectionTime() - photon.getEmissionTime()
60 self.propTime.Fill(k + 1, t)
61
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

◆ terminate()

def terminate (   self)
 Write histograms to file 

Definition at line 62 of file laserPixelIlumination.py.

62 def terminate(self):
63 ''' Write histograms to file '''
64
65 tfile = TFile('laserPixelIlumination.root', 'recreate')
66 for k in range(9):
67 self.hist[k].Write()
68 self.propTime.Write()
69 tfile.Close()
70
71
72# Create path

Member Data Documentation

◆ hist

list hist
static
Initial value:
= [TH2F('fiber' + str(k + 1), 'Pixel hit distribution from fiber No.' + str(k + 1),
64, 0.5, 64.5, 8, 0.5, 8.5) for k in range(9)]

2D histograms

Definition at line 34 of file laserPixelIlumination.py.

◆ pixelID

int pixelID = 482
static

pixel ID

Definition at line 37 of file laserPixelIlumination.py.

◆ propTime

TH2F propTime
static
Initial value:
= TH2F('propTime', 'Photon propagation times for pixel ' + str(pixelID) +
' vs. fiber number', 9, 0.5, 9.5, 200, 0.0, 1.0)

histogram

Definition at line 39 of file laserPixelIlumination.py.


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