9 #include <top/dbobjects/TOPNominalQE.h>
23 for (
size_t i = 0; i < m_QE.size(); i++) {
24 double lambda = m_lambdaFirst + m_lambdaStep * i;
25 m_QE[i] *=
filter.getBulkTransmittance(lambda);
30 double TOPNominalQE::getQE(
double lambda)
const
32 double dlam = lambda - m_lambdaFirst;
33 if (dlam < 0 or dlam > (m_QE.size() - 1) * m_lambdaStep)
return 0;
34 unsigned i = int(dlam / m_lambdaStep);
35 if (i > m_QE.size() - 2)
return m_QE.back();
36 return m_QE[i] + (m_QE[i + 1] - m_QE[i]) / m_lambdaStep * (dlam - i * m_lambdaStep);
40 double TOPNominalQE::getMinLambda()
const
42 for (
size_t i = 0; i < m_QE.size(); i++) {
43 if (m_QE[i] > 0)
return m_lambdaFirst + m_lambdaStep * i;
45 return getLambdaLast();
49 double TOPNominalQE::getMaxLambda()
const
51 for (
size_t i = m_QE.size() - 1; i < m_QE.size(); i--) {
52 if (m_QE[i] > 0)
return m_lambdaFirst + m_lambdaStep * i;
58 bool TOPNominalQE::isConsistent()
const
60 if (m_lambdaFirst <= 0)
return false;
61 if (m_lambdaStep <= 0)
return false;
62 if (m_CE <= 0)
return false;
63 if (m_QE.empty())
return false;
68 void TOPNominalQE::print(
const std::string& title)
const
70 TOPGeoBase::printUnderlined(title);
71 cout <<
" first point: " << getLambdaFirst() <<
" nm";
72 cout <<
", step: " << getLambdaStep() <<
" nm";
73 cout <<
", CE: " << getCE() << endl;
75 for (
const auto& qe : m_QE) cout << qe <<
", ";
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
Abstract base class for different kinds of events.