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

Public Member Functions

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

Public Attributes

 db
 payload
 
 file
 output file name
 
 h
 histogram
 

Detailed Description

 Save module T0 from database into a root file as histogram 

Definition at line 32 of file getModuleT0Histo.py.

Member Function Documentation

◆ event()

def event (   self)
 event processing 

Definition at line 47 of file getModuleT0Histo.py.

47 def event(self):
48 ''' event processing '''
49
50 for slot in range(1, 17):
51 self.h.SetBinContent(slot, self.db.getT0(slot))
52 self.h.SetBinError(slot, self.db.getT0Error(slot))
53 if self.db.isCalibrated(slot):
54 print('slot', slot, 'status = calibrated')
55 elif self.db.isUnusable(slot):
56 print('slot', slot, 'status = unusable')
57 else:
58 print('slot', slot, 'status = default')
59

◆ initialize()

def initialize (   self)
 initialize 

Definition at line 35 of file getModuleT0Histo.py.

35 def initialize(self):
36 ''' initialize '''
37
38
39 self.db = Belle2.PyDBObj('TOPCalModuleT0')
40
41 file_name = 'moduleT0_DB-' + 'e' + f'{expNo:04d}' + '-r' + f'{runNo:05d}' + '.root'
42
43 self.file = TFile.Open(file_name, 'recreate')
44
45 self.h = TH1F('moduleT0', tag + '; slot number; module T0 [ns]', 16, 0.5, 16.5)
46
Class to access a DBObjPtr from Python.
Definition: PyDBObj.h:50

◆ terminate()

def terminate (   self)
 terminate 

Definition at line 60 of file getModuleT0Histo.py.

60 def terminate(self):
61 ''' terminate '''
62
63 self.file.Write()
64 self.file.Close()
65
66
67# Database

Member Data Documentation

◆ db

db

payload

Definition at line 39 of file getModuleT0Histo.py.

◆ file

file

output file name

Definition at line 43 of file getModuleT0Histo.py.

◆ h

h

histogram

Definition at line 45 of file getModuleT0Histo.py.


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