Belle II Software  release-08-01-10
TOPPmtQE.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 <vector>
13 
14 namespace Belle2 {
23  class TOPPmtQE : public TObject {
24  public:
28  enum {c_NumPmtPixels = 16};
29 
34  {}
35 
44  TOPPmtQE(const std::string& serialNumber,
45  float lambdaFirst, float lambdaStep, float CE0, float CE):
46  m_serialNumber(serialNumber), m_lambdaFirst(lambdaFirst), m_lambdaStep(lambdaStep),
47  m_CE_noB(CE0), m_CE_withB(CE)
48  {}
49 
55  void setQE(unsigned pmtPixel, const std::vector<float>& qe)
56  {
57  pmtPixel--;
58  if (pmtPixel < c_NumPmtPixels) m_QE[pmtPixel] = qe;
59  }
60 
65  const std::string& getSerialNumber() const {return m_serialNumber;}
66 
72  const std::vector<float>& getQE(unsigned pmtPixel) const;
73 
81  double getQE(unsigned pmtPixel, double lambda) const;
82 
87  const std::vector<float>& getEnvelopeQE() const;
88 
95  double getEnvelopeQE(double lambda) const;
96 
105  double getEfficiency(unsigned pmtPixel, double lambda, bool BfieldOn) const;
106 
111  double getLambdaFirst() const {return m_lambdaFirst;}
112 
117  double getLambdaLast() const;
118 
124  double getLambdaLast(unsigned pmtPixel) const;
125 
130  double getLambdaStep() const {return m_lambdaStep;}
131 
137  double getCE(bool BfieldOn) const;
138 
139 
140  private:
141 
145  void setEnvelopeQE() const;
146 
153  double interpolate(double lambda, const std::vector<float>& QE) const;
154 
155  std::string m_serialNumber;
156  std::vector<float> m_QE[c_NumPmtPixels];
157  float m_lambdaFirst = 0;
158  float m_lambdaStep = 0;
159  float m_CE_noB = 0;
160  float m_CE_withB = 0;
163  mutable std::vector<float> m_envelopeQE;
164 
167  };
168 
170 } // end namespace Belle2
171 
172 
Nagoya measurements of quantum efficiency.
Definition: TOPPmtQE.h:23
double getLambdaStep() const
Returns wavelenght step.
Definition: TOPPmtQE.h:130
float m_CE_withB
relative collection efficiency, with B field
Definition: TOPPmtQE.h:160
float m_CE_noB
relative collection efficiency, without B field
Definition: TOPPmtQE.h:159
std::string m_serialNumber
serial number, e.g.
Definition: TOPPmtQE.h:155
TOPPmtQE(const std::string &serialNumber, float lambdaFirst, float lambdaStep, float CE0, float CE)
Useful constructor.
Definition: TOPPmtQE.h:44
float m_lambdaStep
wavelength step [nm]
Definition: TOPPmtQE.h:158
double getLambdaFirst() const
Returns wavelenght of the first data point.
Definition: TOPPmtQE.h:111
const std::string & getSerialNumber() const
Returns PMT serial number.
Definition: TOPPmtQE.h:65
std::vector< float > m_envelopeQE
cache for envelope QE
Definition: TOPPmtQE.h:163
TOPPmtQE()
Default constructor.
Definition: TOPPmtQE.h:33
float m_lambdaFirst
wavelength of the first data point [nm]
Definition: TOPPmtQE.h:157
ClassDef(TOPPmtQE, 3)
don't write out
std::vector< float > m_QE[c_NumPmtPixels]
QE data points.
Definition: TOPPmtQE.h:156
void setQE(unsigned pmtPixel, const std::vector< float > &qe)
Set quantum efficiency data points for a given pmtPixel.
Definition: TOPPmtQE.h:55
double getEfficiency(unsigned pmtPixel, double lambda, bool BfieldOn) const
Returns quantum times collection efficiency for a given pixel and wavelength, using linear interpolat...
Definition: TOPPmtQE.cc:50
const std::vector< float > & getEnvelopeQE() const
Returns envelope quantum efficiency data points (maximum over pixels)
Definition: TOPPmtQE.cc:38
const std::vector< float > & getQE(unsigned pmtPixel) const
Returns quantum efficiency data points for a given pixel.
Definition: TOPPmtQE.cc:21
double getCE(bool BfieldOn) const
Returns collection efficiency.
Definition: TOPPmtQE.cc:59
double getLambdaLast() const
Returns wavelenght of the last data point (maximal of pixels)
Definition: TOPPmtQE.cc:68
double interpolate(double lambda, const std::vector< float > &QE) const
Interpolate between QE datapoints (linear interpolation).
Definition: TOPPmtQE.cc:105
void setEnvelopeQE() const
Sets envelope quantum efficiency.
Definition: TOPPmtQE.cc:87
Abstract base class for different kinds of events.