Belle II Software development
TOPNominalQE.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 <top/dbobjects/TOPGeoBase.h>
12#include <top/dbobjects/TOPWavelengthFilter.h>
13#include <vector>
14
15namespace Belle2 {
24 class TOPNominalQE : public TOPGeoBase {
25 public:
26
31 {}
32
41 TOPNominalQE(float lambdaFirst, float lambdaStep, float CE,
42 const std::vector<float>& qe,
43 const std::string& name = "TOPNominalQE"): TOPGeoBase(name),
44 m_lambdaFirst(lambdaFirst), m_lambdaStep(lambdaStep), m_CE(CE), m_QE(qe)
45 {}
46
55 void set(float lambdaFirst, float lambdaStep, float CE,
56 const std::vector<float>& qe,
57 const std::string& name)
58 {
59 m_lambdaFirst = lambdaFirst;
60 m_lambdaStep = lambdaStep;
61 m_CE = CE;
62 m_QE = qe;
63 setName(name);
64 }
65
71
75 void clear()
76 {
77 m_lambdaFirst = 0;
78 m_lambdaStep = 0;
79 m_CE = 0;
80 m_QE.clear();
81 setName("");
82 }
83
88 bool isEmpty() const {return m_QE.empty();}
89
94 const std::vector<float>& getQE() const {return m_QE;}
95
101 double getQE(double lambda) const;
102
109 double getEfficiency(double lambda) const {return getQE(lambda) * m_CE;}
110
115 double getLambdaFirst() const {return m_lambdaFirst;}
116
121 double getLambdaLast() const
122 {
123 return m_lambdaFirst + (m_QE.size() - 1) * m_lambdaStep;
124 }
125
130 double getLambdaStep() const {return m_lambdaStep;}
131
136 double getMinLambda() const;
137
142 double getMaxLambda() const;
143
148 double getCE() const {return m_CE;}
149
154 bool isConsistent() const override;
155
160 void print(const std::string& title = "Nominal quantum efficiency") const override;
161
162
163 private:
164
165 float m_lambdaFirst = 0;
166 float m_lambdaStep = 0;
167 float m_CE = 0;
168 std::vector<float> m_QE;
172 };
173
175} // end namespace Belle2
176
177
Base class for geometry parameters.
Definition: TOPGeoBase.h:25
void setName(const std::string &name)
Sets object name.
Definition: TOPGeoBase.h:45
Nominal quantum efficiency of PMT.
Definition: TOPNominalQE.h:24
double getEfficiency(double lambda) const
Returns quantum times collection efficiency at given photon wavelength using linear interpolation.
Definition: TOPNominalQE.h:109
double getLambdaStep() const
Returns wavelenght step.
Definition: TOPNominalQE.h:130
TOPNominalQE(float lambdaFirst, float lambdaStep, float CE, const std::vector< float > &qe, const std::string &name="TOPNominalQE")
Full constructor.
Definition: TOPNominalQE.h:41
std::vector< float > m_QE
QE data points.
Definition: TOPNominalQE.h:168
const std::vector< float > & getQE() const
Returns quantum efficiency data points.
Definition: TOPNominalQE.h:94
TOPNominalQE()
Default constructor.
Definition: TOPNominalQE.h:30
void set(float lambdaFirst, float lambdaStep, float CE, const std::vector< float > &qe, const std::string &name)
Sets the object.
Definition: TOPNominalQE.h:55
double getCE() const
Returns collection efficiency.
Definition: TOPNominalQE.h:148
float m_lambdaStep
wavelength step [nm]
Definition: TOPNominalQE.h:166
ClassDefOverride(TOPNominalQE, 1)
ClassDef.
double getLambdaFirst() const
Returns wavelenght of the first data point.
Definition: TOPNominalQE.h:115
void clear()
Clears the object.
Definition: TOPNominalQE.h:75
bool isEmpty() const
Checks the status.
Definition: TOPNominalQE.h:88
double getLambdaLast() const
Returns wavelenght of the last data point.
Definition: TOPNominalQE.h:121
float m_lambdaFirst
wavelength of the first data point [nm]
Definition: TOPNominalQE.h:165
float m_CE
collection efficiency
Definition: TOPNominalQE.h:167
Bulk transmittance of wavelength filter.
std::map< ExpRun, std::pair< double, double > > filter(const std::map< ExpRun, std::pair< double, double > > &runs, double cut, std::map< ExpRun, std::pair< double, double > > &runsRemoved)
filter events to remove runs shorter than cut, it stores removed runs in runsRemoved
Definition: Splitter.cc:38
bool isConsistent() const override
Check for consistency of data members.
Definition: TOPNominalQE.cc:58
void print(const std::string &title="Nominal quantum efficiency") const override
Print the content of the class.
Definition: TOPNominalQE.cc:68
double getMaxLambda() const
Returns wavelength of the last nonzero QE data point.
Definition: TOPNominalQE.cc:49
double getMinLambda() const
Returns wavelength of the first nonzero QE data point.
Definition: TOPNominalQE.cc:40
void applyFilterTransmission(const TOPWavelengthFilter &filter)
Multiplies quantum efficiency data points with filter transmission.
Definition: TOPNominalQE.cc:21
Abstract base class for different kinds of events.