13from ROOT
import Belle2, TCanvas, gStyle, gROOT
24 print(
"usage: basf2", sys.argv[0],
"expNo runNo [globalTag/localDB]")
27expNo = int(sys.argv[1])
28runNo = int(sys.argv[2])
29globalTag =
"data_reprocessing_prompt"
31 globalTag = sys.argv[3]
35 ''' Makes a plot of alpha-ratio histograms '''
38 ''' initialize: implementation'''
46 print(
"- global tag:", globalTag)
47 print(
"- time of measurement:",
48 time.strftime(
"%d %b %Y %H:%M:%S", time.localtime(db.getTimeStamp())),
"(mean), ",
49 round(db.getTimeStampStd() / 3600 / 24, 2),
"days (rms)")
51 canvas = TCanvas(
"c1",
"alpha ratio", 2000, 1500)
54 gStyle.SetTitleFontSize(0.18)
55 for slot
in range(1, 17):
57 pad = canvas.GetPad(slot)
58 pad.SetLeftMargin(0.02)
59 pad.SetRightMargin(0.02)
60 pad.SetTopMargin(0.17)
61 pad.SetBottomMargin(0.03)
62 h = db.getAlphaRatio(slot)
65 h.SetTitle(
"slot " + str(slot))
69 fileName =
'alphaRatio-' + time.strftime(
"%Y-%m-%d", time.localtime(db.getTimeStamp())) +
'.png'
70 canvas.SaveAs(fileName)
71 print(
"--> plot saved as:", fileName)
74b2.set_log_level(b2.LogLevel.ERROR)
76if '.txt' in globalTag:
77 b2.conditions.append_testing_payloads(globalTag)
79 b2.conditions.append_globaltag(globalTag)
81main = b2.create_path()
82main.add_module(
'EventInfoSetter', evtNumList=[1], runList=[runNo], expList=[expNo])
Class to access a DBObjPtr from Python.