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 {
20
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;
169
171
172 };
173
175} // end namespace Belle2
176
177
void setName(const std::string &name)
Sets object name.
Definition TOPGeoBase.h:45
TOPGeoBase()
Default constructor.
Definition TOPGeoBase.h:31
double getEfficiency(double lambda) const
Returns quantum times collection efficiency at given photon wavelength using linear interpolation.
double getLambdaStep() const
Returns wavelenght step.
TOPNominalQE(float lambdaFirst, float lambdaStep, float CE, const std::vector< float > &qe, const std::string &name="TOPNominalQE")
Full constructor.
std::vector< float > m_QE
QE data points.
const std::vector< float > & getQE() const
Returns quantum efficiency data points.
TOPNominalQE()
Default constructor.
void set(float lambdaFirst, float lambdaStep, float CE, const std::vector< float > &qe, const std::string &name)
Sets the object.
double getCE() const
Returns collection efficiency.
float m_lambdaStep
wavelength step [nm]
ClassDefOverride(TOPNominalQE, 1)
ClassDef.
double getLambdaFirst() const
Returns wavelenght of the first data point.
void clear()
Clears the object.
bool isEmpty() const
Checks the status.
double getLambdaLast() const
Returns wavelenght of the last data point.
float m_lambdaFirst
wavelength of the first data point [nm]
float m_CE
collection efficiency
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.
void print(const std::string &title="Nominal quantum efficiency") const override
Print the content of the class.
double getMaxLambda() const
Returns wavelength of the last nonzero QE data point.
double getMinLambda() const
Returns wavelength of the first nonzero QE data point.
void applyFilterTransmission(const TOPWavelengthFilter &filter)
Multiplies quantum efficiency data points with filter transmission.
Abstract base class for different kinds of events.