HerdSoftware  0.1.1
PhotonTool.h
Go to the documentation of this file.
1 /*
2  * PhotonTool.h
3  *
4  * Interface for the tool that transforms deposited energies to photons exiting
5  * the fibre ends
6  *
7  * Created on 03 Mar 2020
8  * Author: Valerio Formato (based on code by Junjing Wang)
9  */
10 
11 #ifndef HERD_PHOTONTOOL_H_
12 #define HERD_PHOTONTOOL_H_
13 
14 #include <random>
15 
17 
18 // this in c++17 will become
19 // namespace Herd::FitDigitizationTools {
20 namespace Herd {
21 namespace FitDigitizationTools {
22 
23 class PhotonTool {
24 
25 public:
27  ~PhotonTool() = default;
28 
29  double numExpectedPhotons(double effective_energy);
30  int numObservedPhotons(double num_expected_photons);
31  double averagePropagationTime(double distToSiPM) {
32  // because the default unit is cm, convert mm to m 1e-3
33  return (distToSiPM * 1e-2) * m_fibrePropagationSpeed;
34  };
35 
37 
38  void generatePhoton(double &time, double &wavelength, double &posX, double &posZ, double &dXdY, double &dZdY);
39  // double &dXdY, double &dZdY, double &newTheta, double &newPhi);
40 
41 private:
43  void generatePosAndDir(double &posX, double &posZ, double &dXdY, double &dZdY);
44 
45  bool m_generateWavelength = true; // "Flag for turning on random wavelength generation"
46  const double m_photonsPerMeV = 455.; //"Average number of photons per MeV"
47  const double m_wavelengthShift = 405. * nm; // "Shift parameter of Wavelength distributions"};
48  const double m_wavelengthScale = 77.89 * nm; // "Scale parameter of Wavelength distributions"};
49  const double m_wavelengthShape = 0.44; // "Shape parameter of Wavelength distributions"};
50 
51  // Fibre properties
52  const double m_effFibreR = 0.0115; // "Effective Radius of the fibre"};
53  const double m_fibrePropagationSpeed = 6.0; //(ns/m) //"Light propagation speed in fibre"};
54  const double m_scintillationDecayTime = 2.8 * ns; //"Decay time of scintillation light release"};
55 
56  // Random number generators
57  std::mt19937 m_generator;
58  std::uniform_real_distribution<double> m_flat_dist;
59  std::poisson_distribution<unsigned int> m_pois_dist;
60  std::normal_distribution<double> m_gauss_dist;
61 };
62 
63 } // namespace FitDigitizationTools
64 } // namespace Herd
65 #endif
int numObservedPhotons(double num_expected_photons)
Definition: PhotonTool.cpp:28
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
double numExpectedPhotons(double effective_energy)
Definition: PhotonTool.cpp:23
std::poisson_distribution< unsigned int > m_pois_dist
Definition: PhotonTool.h:59
double averagePropagationTime(double distToSiPM)
Definition: PhotonTool.h:31
void generatePhoton(double &time, double &wavelength, double &posX, double &posZ, double &dXdY, double &dZdY)
Definition: PhotonTool.cpp:37
double generateScintillationTime()
Definition: PhotonTool.h:36
PhotonTool()
Definition: PhotonTool.h:26
const double m_fibrePropagationSpeed
Definition: PhotonTool.h:53
const double m_photonsPerMeV
Definition: PhotonTool.h:46
bool m_generateWavelength
Definition: PhotonTool.h:45
const double m_scintillationDecayTime
Definition: PhotonTool.h:54
std::uniform_real_distribution< double > m_flat_dist
Definition: PhotonTool.h:58
const double m_wavelengthScale
Definition: PhotonTool.h:48
const double m_effFibreR
Definition: PhotonTool.h:52
constexpr double ns
Definition: Units.h:9
Definition: PhotonTool.h:23
const double m_wavelengthShift
Definition: PhotonTool.h:47
const double m_wavelengthShape
Definition: PhotonTool.h:49
std::mt19937 m_generator
Definition: PhotonTool.h:57
std::normal_distribution< double > m_gauss_dist
Definition: PhotonTool.h:60
constexpr double nm
Definition: Units.h:8
void generatePosAndDir(double &posX, double &posZ, double &dXdY, double &dZdY)
Generate photon exit position and direction in fibre.
Definition: PhotonTool.cpp:50