Belle II Software  release-08-01-10
SaveHisto Class Reference
Inheritance diagram for SaveHisto:
Collaboration diagram for SaveHisto:

Public Member Functions

def initialize (self)
 

Detailed Description

 Saving histograms from the payload to a root file

Definition at line 34 of file checkDB-photonYields.py.

Member Function Documentation

◆ initialize()

def initialize (   self)
 initialize: saving histograms implemented here 

Definition at line 37 of file checkDB-photonYields.py.

37  def initialize(self):
38  ''' initialize: saving histograms implemented here '''
39 
40  db = Belle2.PyDBObj("TOPCalPhotonYields")
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 
74 b2.set_log_level(b2.LogLevel.ERROR)
75 
Class to access a DBObjPtr from Python.
Definition: PyDBObj.h:50

The documentation for this class was generated from the following file: