37 def initialize(self):
38 ''' initialize: saving histograms implemented here '''
39
41 if not db:
42 return
43
44 fileName = "photonYields-" + time.strftime("%Y-%m-%d", time.localtime(db.getTimeStamp())) + ".root"
45 f = TFile.Open(fileName, "recreate")
46
47 print("- global tag:", globalTag)
48 print("- time of measurement:",
49 time.strftime("%d %b %Y %H:%M:%S", time.localtime(db.getTimeStamp())), "(mean), ",
50 round(db.getTimeStampStd() / 3600 / 24, 2), "days (rms)")
51 for slot in range(1, 17):
52 h = db.getPhotonYields(slot)
53 if h:
54 h.Write()
55 h = db.getBackgroundYields(slot)
56 if h:
57 h.Write()
58 h = db.getAlphaRatio(slot)
59 if h:
60 h.Write()
61 h = db.getActivePixels(slot)
62 if h:
63 h.Write()
64 h = db.getPulseHeights(slot)
65 if h:
66 h.Write()
67 h = db.getMuonZ(slot)
68 if h:
69 h.Write()
70 f.Close()
71 print("--> histograms saved to:", fileName)
72
73
Class to access a DBObjPtr from Python.