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

Public Member Functions

def initialize (self)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 tfile
 output file
 
 hist
 Width VS amplitude plot in each slot.
 
 histSampling
 Width as function of the sample number in each channel.
 

Detailed Description

 A module to histogram width and amplitude of TOPDigits 

Definition at line 23 of file checkHitHeightAndWidth.py.

Member Function Documentation

◆ event()

def event (   self)
 Event processor: fill histograms 

Definition at line 48 of file checkHitHeightAndWidth.py.

48 def event(self):
49 ''' Event processor: fill histograms '''
50
51 digits = Belle2.PyStoreArray('TOPDigits')
52 for digit in digits:
53 if digit.getHitQuality() == 0:
54 continue
55 slotID = digit.getModuleID()
56 hwchan = digit.getChannel()
57 self.hist[slotID - 1].Fill(digit.getPulseHeight(), digit.getPulseWidth())
58 self.histSampling[slotID - 1][hwchan].Fill(digit.getModulo256Sample(), digit.getPulseWidth())
59
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

◆ initialize()

def initialize (   self)
 Open output file and book histograms 

Definition at line 27 of file checkHitHeightAndWidth.py.

27 def initialize(self):
28 ''' Open output file and book histograms '''
29
30
31 self.tfile = TFile.Open('hitHeightAndWidth.root', 'recreate')
32 dirs = [gDirectory.mkdir('slot_' + f'{slot:02d}') for slot in range(1, 17)]
33
34
35 self.hist = []
36
37 self.histSampling = []
38
39 for slot in range(1, 17):
40 dirs[slot - 1].cd()
41 h = TH2F('WidthVSAmplitude', 'Slot ' + str(slot) +
42 ';amplitude [ADC counts]; width [ns]', 2000, 0, 2000, 200, 0, 10)
43 self.hist.append(h)
44 hh = [TH2F('WidthVSample_ch' + f'{ch:03d}', 'Slot ' + str(slot) + ', channel ' + str(ch) +
45 ';sample; width [ns]', 256, 0, 256, 200, 0, 10) for ch in range(512)]
46 self.histSampling.append(hh)
47

◆ terminate()

def terminate (   self)
 Write histograms to file 

Definition at line 60 of file checkHitHeightAndWidth.py.

60 def terminate(self):
61 ''' Write histograms to file '''
62
63 self.tfile.Write()
64 self.tfile.Close()
65
66
67# Suppress messages and warnings during processing

Member Data Documentation

◆ hist

hist

Width VS amplitude plot in each slot.

Definition at line 35 of file checkHitHeightAndWidth.py.

◆ histSampling

histSampling

Width as function of the sample number in each channel.

Definition at line 37 of file checkHitHeightAndWidth.py.

◆ tfile

tfile

output file

Definition at line 31 of file checkHitHeightAndWidth.py.


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