14 from ROOT
import Belle2
15 from ROOT
import TFile, TH1F
25 print(
"usage: basf2", argvs[0],
"expNo runNo globalTag/localDB")
34 ''' Save module T0 from database into a root file as histogram '''
42 file_name =
'moduleT0_DB-' +
'e' +
'{:0=4d}'.format(expNo) +
'-r' +
'{:0=5d}'.format(runNo) +
'.root'
44 self.
filefile = TFile.Open(file_name,
'recreate')
46 self.
hh = TH1F(
'moduleT0', tag +
'; slot number; module T0 [ns]', 16, 0.5, 16.5)
49 ''' event processing '''
51 for slot
in range(1, 17):
52 self.
hh.SetBinContent(slot, self.
dbdb.getT0(slot))
53 self.
hh.SetBinError(slot, self.
dbdb.getT0Error(slot))
54 if self.
dbdb.isCalibrated(slot):
55 print(
'slot', slot,
'status = calibrated')
56 elif self.
dbdb.isUnusable(slot):
57 print(
'slot', slot,
'status = unusable')
59 print(
'slot', slot,
'status = default')
70 b2.conditions.append_testing_payloads(tag)
72 b2.conditions.append_globaltag(tag)
75 main = b2.create_path()
83 eventinfosetter = b2.register_module(
'EventInfoSetter')
84 eventinfosetter.param({
'evtNumList': evtList,
'runList': runList,
'expList': expList})
85 main.add_module(eventinfosetter)
Class to access a DBObjPtr from Python.