Belle II Software  release-05-01-25
TOPPmtTTSHisto.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric, Alessandro Gaz *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <TObject.h>
14 #include <framework/logging/Logger.h>
15 #include <TH1F.h>
16 
17 namespace Belle2 {
26  class TOPPmtTTSHisto : public TObject {
27  public:
31  enum {c_NumPmtPixels = 16};
32 
37  {}
38 
44  TOPPmtTTSHisto(const std::string& serialNumber,
45  float HV):
46  m_serialNumber(serialNumber), m_HV(HV)
47  {}
48 
53  void setSerialNumber(const std::string& serNum) {m_serialNumber = serNum;}
54 
59  void setHV(float HV) {m_HV = HV;}
60 
66  void setHistogram(unsigned pmtPixel, const TH1F* histo)
67  {
68  if (!histo) {
69  B2ERROR("TOPPmtTTSHisto::setHistogram: null pointer received");
70  return;
71  }
72  pmtPixel--;
73  if (pmtPixel >= c_NumPmtPixels) {
74  B2ERROR("TOPPmtTTSHisto::setHistogram: invalid PMT pixel "
75  << LogVar("PMT pixel", pmtPixel + 1));
76  return;
77  }
78  m_histo[pmtPixel] = *histo;
79  }
80 
85  int getNumOfPixels() const {return c_NumPmtPixels;}
86 
91  const std::string& getSerialNumber() const {return m_serialNumber;}
92 
97  float getHV() const {return m_HV;}
98 
104  const TH1F* getHistogram(unsigned pmtPixel) const
105  {
106  pmtPixel--;
107  if (pmtPixel >= c_NumPmtPixels) return 0;
108  return &m_histo[pmtPixel];
109  }
110 
111 
112  private:
113 
114  std::string m_serialNumber;
115  float m_HV = 0;
116  TH1F m_histo[c_NumPmtPixels];
120  };
121 
123 } // end namespace Belle2
124 
125 
Belle2::TOPPmtTTSHisto::getHistogram
const TH1F * getHistogram(unsigned pmtPixel) const
Returns TTS histogram for a specified pmtPixel.
Definition: TOPPmtTTSHisto.h:112
Belle2::TOPPmtTTSHisto::getSerialNumber
const std::string & getSerialNumber() const
Returns PMT serial number.
Definition: TOPPmtTTSHisto.h:99
Belle2::TOPPmtTTSHisto::ClassDef
ClassDef(TOPPmtTTSHisto, 3)
ClassDef.
Belle2::TOPPmtTTSHisto::setHistogram
void setHistogram(unsigned pmtPixel, const TH1F *histo)
Set histogram for a given pixel (make a copy)
Definition: TOPPmtTTSHisto.h:74
Belle2::TOPPmtTTSHisto
Raw measurements of TTS (histograms) for each PMT pixel.
Definition: TOPPmtTTSHisto.h:34
Belle2::TOPPmtTTSHisto::getNumOfPixels
int getNumOfPixels() const
Returns number of PMT pixels.
Definition: TOPPmtTTSHisto.h:93
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPPmtTTSHisto::setHV
void setHV(float HV)
Set high voltage used for TTS measurement.
Definition: TOPPmtTTSHisto.h:67
Belle2::TOPPmtTTSHisto::m_HV
float m_HV
HV setting for which the set of histograms were taken.
Definition: TOPPmtTTSHisto.h:123
LogVar
Class to store variables with their name which were sent to the logging service.
Definition: LogVariableStream.h:24
Belle2::TOPPmtTTSHisto::getHV
float getHV() const
Returns high voltage used for TTS measurement.
Definition: TOPPmtTTSHisto.h:105
Belle2::TOPPmtTTSHisto::m_histo
TH1F m_histo[c_NumPmtPixels]
histograms of measured TTS (one per pmtPixel)
Definition: TOPPmtTTSHisto.h:124
Belle2::TOPPmtTTSHisto::TOPPmtTTSHisto
TOPPmtTTSHisto()
Default constructor.
Definition: TOPPmtTTSHisto.h:44
Belle2::TOPPmtTTSHisto::setSerialNumber
void setSerialNumber(const std::string &serNum)
Set PMT serial number.
Definition: TOPPmtTTSHisto.h:61
Belle2::TOPPmtTTSHisto::m_serialNumber
std::string m_serialNumber
PMT serial number, e.g.
Definition: TOPPmtTTSHisto.h:122