Belle II Software development
TOPPmtTTSHisto.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <TObject.h>
12#include <framework/logging/Logger.h>
13#include <TH1F.h>
14
15namespace Belle2 {
24 class TOPPmtTTSHisto : public TObject {
25 public:
29 enum {c_NumPmtPixels = 16};
30
35 {}
36
42 TOPPmtTTSHisto(const std::string& serialNumber,
43 float HV):
44 m_serialNumber(serialNumber), m_HV(HV)
45 {}
46
51 void setSerialNumber(const std::string& serNum) {m_serialNumber = serNum;}
52
57 void setHV(float HV) {m_HV = HV;}
58
64 void setHistogram(unsigned pmtPixel, const TH1F* histo)
65 {
66 if (!histo) {
67 B2ERROR("TOPPmtTTSHisto::setHistogram: null pointer received");
68 return;
69 }
70 pmtPixel--;
71 if (pmtPixel >= c_NumPmtPixels) {
72 B2ERROR("TOPPmtTTSHisto::setHistogram: invalid PMT pixel "
73 << LogVar("PMT pixel", pmtPixel + 1));
74 return;
75 }
76 m_histo[pmtPixel] = *histo;
77 }
78
83 int getNumOfPixels() const {return c_NumPmtPixels;}
84
89 const std::string& getSerialNumber() const {return m_serialNumber;}
90
95 float getHV() const {return m_HV;}
96
102 const TH1F* getHistogram(unsigned pmtPixel) const
103 {
104 pmtPixel--;
105 if (pmtPixel >= c_NumPmtPixels) return 0;
106 return &m_histo[pmtPixel];
107 }
108
109
110 private:
111
112 std::string m_serialNumber;
113 float m_HV = 0;
114 TH1F m_histo[c_NumPmtPixels];
118 };
119
121} // end namespace Belle2
122
123
Raw measurements of TTS (histograms) for each PMT pixel.
TOPPmtTTSHisto(const std::string &serialNumber, float HV)
Full constructor.
int getNumOfPixels() const
Returns number of PMT pixels.
void setSerialNumber(const std::string &serNum)
Set PMT serial number.
const TH1F * getHistogram(unsigned pmtPixel) const
Returns TTS histogram for a specified pmtPixel.
std::string m_serialNumber
PMT serial number, e.g.
void setHistogram(unsigned pmtPixel, const TH1F *histo)
Set histogram for a given pixel (make a copy)
ClassDef(TOPPmtTTSHisto, 3)
ClassDef.
float getHV() const
Returns high voltage used for TTS measurement.
float m_HV
HV setting for which the set of histograms were taken.
void setHV(float HV)
Set high voltage used for TTS measurement.
TOPPmtTTSHisto()
Default constructor.
TH1F m_histo[c_NumPmtPixels]
histograms of measured TTS (one per pmtPixel)
const std::string & getSerialNumber() const
Returns PMT serial number.
Class to store variables with their name which were sent to the logging service.
Abstract base class for different kinds of events.