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