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

Public Member Functions

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

Public Attributes

 db = Belle2.PyDBObj('TOPCalCommonT0')
 payload
 
 lastRun = None
 last run number
 
float bunchTimeSep = 47.163878 / 24
 bunch time separation
 

Detailed Description

 print content of TOPCalCommonT0 

Definition at line 32 of file checkDB-commonT0.py.

Member Function Documentation

◆ event()

event ( self)
 event processing 

Definition at line 50 of file checkDB-commonT0.py.

50 def event(self):
51 ''' event processing '''
52
53 evtMetaData = Belle2.PyStoreObj('EventMetaData')
54 runNo = 'r' + f'{evtMetaData.getRun():05d}'
55
56 if not self.db:
57 b2.B2ERROR(runNo + ': payload not found')
58 return
59 if not self.db.hasChanged():
60 self.lastRun = runNo
61 return
62 if self.lastRun:
63 print('... to ' + self.lastRun)
64 self.lastRun = None
65
66 if self.db.isCalibrated():
67 status = 'calibrated'
68 elif self.db.isUnusable():
69 status = 'unusable'
70 elif self.db.isRoughlyCalibrated():
71 status = 'roughly calibrated'
72 else:
73 status = 'default'
74 n = round(self.db.getT0() / self.bunchTimeSep, 0)
75 if n == 0:
76 print(runNo + ': T0 =',
77 round(self.db.getT0(), 4), '+/-', round(self.db.getT0Error(), 4),
78 status)
79 else:
80 print(runNo + ': T0 =',
81 round(self.db.getT0(), 4), '+/-', round(self.db.getT0Error(), 4),
82 status, '-- out of range')
83
a (simplified) python wrapper for StoreObjPtr.
Definition PyStoreObj.h:67

◆ initialize()

initialize ( self)
 initialize 

Definition at line 35 of file checkDB-commonT0.py.

35 def initialize(self):
36 ''' initialize '''
37
38
39 self.db = Belle2.PyDBObj('TOPCalCommonT0')
40
41 self.lastRun = None
42
43 self.bunchTimeSep = 47.163878 / 24
44
45 print()
46 print('Common T0 calibration status of GT =', tag)
47 print('Experiment =', expNo, 'Runs =', runFirst, 'to', runLast)
48 print()
49
Class to access a DBObjPtr from Python.
Definition PyDBObj.h:50

◆ terminate()

terminate ( self)
 terminate 

Definition at line 84 of file checkDB-commonT0.py.

84 def terminate(self):
85 ''' terminate '''
86
87 if self.lastRun:
88 print('... to ' + self.lastRun)
89 self.lastRun = None
90
91
92# Database

Member Data Documentation

◆ bunchTimeSep

float bunchTimeSep = 47.163878 / 24

bunch time separation

Definition at line 43 of file checkDB-commonT0.py.

◆ db

db = Belle2.PyDBObj('TOPCalCommonT0')

payload

Definition at line 39 of file checkDB-commonT0.py.

◆ lastRun

lastRun = None

last run number

Definition at line 41 of file checkDB-commonT0.py.


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