13from ROOT
import Belle2
14from ROOT
import TFile, TH1F
24 print(
"usage: basf2", argvs[0],
"expNo runNo globalTag/localDB")
33 ''' Save module T0 from database into a root file as histogram '''
41 file_name =
'moduleT0_DB-' +
'e' + f
'{expNo:04d}' +
'-r' + f
'{runNo:05d}' +
'.root'
43 self.
file = TFile.Open(file_name,
'recreate')
45 self.
h = TH1F(
'moduleT0', tag +
'; slot number; module T0 [ns]', 16, 0.5, 16.5)
48 ''' event processing '''
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')
58 print(
'slot', slot,
'status = default')
69 b2.conditions.append_testing_payloads(tag)
71 b2.conditions.append_globaltag(tag)
74main = b2.create_path()
82eventinfosetter = b2.register_module(
'EventInfoSetter')
83eventinfosetter.param({
'evtNumList': evtList,
'runList': runList,
'expList': expList})
84main.add_module(eventinfosetter)
Class to access a DBObjPtr from Python.