Belle II Software  release-08-01-10
ARICHSimulationPar.cc
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 #include <arich/dbobjects/ARICHSimulationPar.h>
10 
11 #include <framework/logging/Logger.h>
12 #include <iostream>
13 
14 using namespace std;
15 using namespace Belle2;
16 
17 double ARICHSimulationPar::getQE(double e) const
18 {
19  if (e < 0.001) return 0;
20  if (m_qe.size() == 0) B2ERROR("ARICHSimulationPar: QE curve not initialized!");
21  double dlam = 1240 / e - m_lambdaFirst;
22 
23  int i = int(dlam / m_lambdaStep);
24  if (i < 0) i = 0;
25  if (i > int(m_qe.size()) - 2) return 0;
26 
27  // linear interpolation
28  double qe = m_qe[i] + (m_qe[i + 1] - m_qe[i]) / m_lambdaStep * (dlam - i * m_lambdaStep);
29  return qe * m_peakQE;
30 }
31 
32 void ARICHSimulationPar::setQECurve(float lambdaFirst, float lambdaStep, const std::vector<float>& qe)
33 {
34  m_lambdaFirst = lambdaFirst;
35  m_lambdaStep = lambdaStep;
36  m_qe = qe;
37 }
38 
39 void ARICHSimulationPar::print() const
40 {
41  cout << endl;
42  cout << "ARICH simulation parameters" << endl;
43  cout << endl;
44  cout << " QE curve (peak should be above QE of highest QE HAPD!)" << endl;
45  int ipoint = 0;
46  cout << " wl [nm] QE" << endl;
47  for (auto qe : m_qe) {
48  float lambda = m_lambdaFirst + ipoint * m_lambdaStep;
49  cout << " " << lambda << " " << qe* m_peakQE << endl;
50  ipoint++;
51  }
52 
53  cout << endl;
54  cout << " HAPD simulation parameters" << endl;
55  cout << " QE scaling for photons internally reflected in HAPD window: " << getQEScaling() << endl;
56  cout << " absorbtion probablity for internally reflected photons: " << getWindowAbsorbtion() << endl;
57  cout << " channels negative crosstalk factor: " << getChipNegativeCrosstalk() << endl;
58  cout << " collection efficiency: " << m_colEff << endl;
59 }
Abstract base class for different kinds of events.