37 def initialize(self):
38 ''' initialize: implementation'''
39
40 gROOT.SetBatch(True)
41
43 if not db:
44 return
45
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)")
50
51 canvas = TCanvas("c1", "alpha ratio", 2000, 1500)
52 canvas.Divide(2, 8)
53 gStyle.SetOptStat(0)
54 gStyle.SetTitleFontSize(0.18)
55 for slot in range(1, 17):
56 canvas.cd(slot)
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)
63 if not h:
64 continue
65 h.SetTitle("slot " + str(slot))
66 h.SetMinimum(0)
67 h.SetMaximum(1.2)
68 h.Draw("col a")
69 fileName = 'alphaRatio-' + time.strftime("%Y-%m-%d", time.localtime(db.getTimeStamp())) + '.png'
70 canvas.SaveAs(fileName)
71 print("--> plot saved as:", fileName)
72
73
Class to access a DBObjPtr from Python.