Extract pulse height distributions from TOPCalPhotonYields and save canvases into a root file
Definition at line 34 of file pmtPulseHeights.py.
◆ initialize()
initialize: implementation
Definition at line 69 of file pmtPulseHeights.py.
70 ''' initialize: implementation '''
78 fileName =
"pmtPulseHeights-" + time.strftime(
"%Y-%m-%d", time.localtime(db.getTimeStamp())) +
".root"
79 f = TFile.Open(fileName,
"recreate")
81 print(
"- global tag:", globalTag)
82 print(
"- time of measurement:",
83 time.strftime(
"%d %b %Y %H:%M:%S", time.localtime(db.getTimeStamp())),
"(mean), ",
84 round(db.getTimeStampStd() / 3600 / 24, 2),
"days (rms)")
87 for slot
in range(1, 17):
88 oldDir.mkdir(
"slot" + f
'{slot:02d}').cd()
89 h = db.getPulseHeights(slot)
92 hmean = TH1F(
'meanPH',
'slot ' + str(slot) +
'; PMT number; mean pulse-height', 32, 0.5, 32.5)
93 for pmt
in range(1, 33):
94 meanPH = self.makePlot(h, slot, pmt)
95 hmean.SetBinContent(pmt, meanPH)
99 canvas = TCanvas(
"meanPH",
"Mean pulse-heights", 1000, 1000)
101 for i, h
in enumerate(histos):
106 print(
"--> canvases saved to:", fileName)
109 b2.set_log_level(b2.LogLevel.ERROR)
Class to access a DBObjPtr from Python.
◆ makePlot()
def makePlot |
( |
|
self, |
|
|
|
h, |
|
|
|
slot, |
|
|
|
pmt |
|
) |
| |
Makes a plot of pulse-height distributions of pixels of a single PMT and saves the canvas
:param h: a 2D histogram of pulse-height vs. pixel
:param slot: slot number
:param pmt: PMT number
Definition at line 37 of file pmtPulseHeights.py.
The documentation for this class was generated from the following file: