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
 file object
 
 height_vs_width
 histogram of pulse height vs.
 
 height_vs_sample
 histogram of pulse height vs.
 
 width_vs_sample
 histogram of pulse width vs.
 
 time
 histogram of time distribution
 
 asic_channels
 histogram of asic channel occupancy
 

Detailed Description

 Makes histograms from TOPDigits 

Definition at line 52 of file checkCalpulse.py.

Member Function Documentation

◆ event()

def event (   self)
 event processing: fill histograms 

Definition at line 74 of file checkCalpulse.py.

74 def event(self):
75 ''' event processing: fill histograms '''
76
77 for digit in Belle2.PyStoreArray('TOPDigits'):
78 if digit.getHitQuality() == 0:
79 continue
80 if cal_channel is not None and digit.getASICChannel() != cal_channel:
81 continue
82 if time_cut_lo is not None and digit.getTime() < time_cut_lo:
83 continue
84 if time_cut_hi is not None and digit.getTime() > time_cut_hi:
85 continue
86 self.height_vs_width.Fill(digit.getPulseWidth(), digit.getPulseHeight())
87 self.height_vs_sample.Fill(digit.getModulo256Sample(), digit.getPulseHeight())
88 if digit.getPulseHeight() > 100:
89 self.width_vs_sample.Fill(digit.getModulo256Sample(), digit.getPulseWidth())
90 self.time.Fill(digit.getTime())
91 self.asic_channels.Fill(digit.getASICChannel())
92
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

◆ initialize()

def initialize (   self)
 initialize: open root file, book histograms 

Definition at line 55 of file checkCalpulse.py.

55 def initialize(self):
56 ''' initialize: open root file, book histograms '''
57
58
59 self.tfile = TFile.Open('checkCalpulse.root', 'recreate')
60
61 self.height_vs_width = TH2F("height_vs_width", "Pulse height vs. width; pulse width [ns]; pulse height [ADC counts]",
62 100, 0, 10, 200, 0, 2000)
63
64 self.height_vs_sample = TH2F("height_vs_sample", "Pulse height vs. sample; sample number; pulse height [ADC counts]",
65 256, 0, 256, 200, 0, 2000)
66
67 self.width_vs_sample = TH2F("width_vs_sample", "Pulse width vs. sample; sample number; pulse width [ns]",
68 256, 0, 256, 100, 0, 10)
69
70 self.time = TH1F('time', 'Time distibution; time [ns]', 400, -100, 300)
71
72 self.asic_channels = TH1F('asic_channels', 'ASIC channel occupancy; ASIC channel number', 8, 0, 8)
73

◆ terminate()

def terminate (   self)
 terminate: write histograms and close the file 

Definition at line 93 of file checkCalpulse.py.

93 def terminate(self):
94 ''' terminate: write histograms and close the file '''
95
96 h = self.height_vs_width.ProjectionX('width')
97 h.SetTitle('Pulse width')
98 h = self.height_vs_width.ProjectionY('height')
99 h.SetTitle('Pulse height')
100 self.tfile.Write()
101 self.tfile.Close()
102
103

Member Data Documentation

◆ asic_channels

asic_channels

histogram of asic channel occupancy

Definition at line 72 of file checkCalpulse.py.

◆ height_vs_sample

height_vs_sample

histogram of pulse height vs.

sample number

Definition at line 64 of file checkCalpulse.py.

◆ height_vs_width

height_vs_width

histogram of pulse height vs.

pulse width

Definition at line 61 of file checkCalpulse.py.

◆ tfile

tfile

file object

Definition at line 59 of file checkCalpulse.py.

◆ time

time

histogram of time distribution

Definition at line 70 of file checkCalpulse.py.

◆ width_vs_sample

width_vs_sample

histogram of pulse width vs.

sample number

Definition at line 67 of file checkCalpulse.py.


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