Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JPMTParametersToolkit.hh
Go to the documentation of this file.
1#ifndef __JDETECTOR__JPMTPARAMETERSTOOLKIT__
2#define __JDETECTOR__JPMTPARAMETERSTOOLKIT__
3
4#include <limits>
5
8#include "JLang/JException.hh"
9#include "JLang/JThrow.hh"
10
11
12/**
13 * \author mdejong
14 * \file
15 * Auxiliary methods to convert hit probability to QE and vice versa.
16 */
17
18namespace JDETECTOR {}
19namespace JPP { using namespace JDETECTOR; }
20
21namespace JDETECTOR {
22
24
25
26 /**
27 * Get model dependent probability that a one photo-electron hit survives the simulation of the PMT assuming QE = 1.
28 *
29 * \param parameters PMT parameters
30 * \return probability
31 */
32 inline double getSurvivalProbability(const JPMTParameters& parameters)
33 {
34 const int NPE = 1;
35
37 }
38
39
40 /**
41 * Get ratio of hit probabilities for given QE and expectation value of the number of photo-electrons.\n
42 * The ratio corresponds to the hit probability with given QE divided by that with QE = 1.\n
43 * The expectation value is defined for a two-fold (or higher) coincidence.
44 *
45 * \param QE QE
46 * \param mu expectation value
47 * \return ratio
48 */
49 inline double getHitProbability(const double QE, const double mu)
50 {
51 if (mu > 0.0)
52 return (1.0 - exp(-QE*mu)) / (1.0 - exp(-mu));
53 else
54 return QE;
55 }
56
57
58 /**
59 * Get maximal ratio of hit probabilities for given QE and expectation value of the number of photo-electrons.\n
60 * The ratio corresponds to the hit probability with infinite QE divided by that with QE = 1.\n
61 * The expectation value is defined for a two-fold (or higher) coincidence.
62 *
63 * \param mu expectation value
64 * \return ratio
65 */
66 inline double getMaximalHitProbability(const double mu)
67 {
68 using namespace std;
69
70 if (mu > 0.0)
71 return 1.0 / (1.0 - exp(-mu));
72 else
73 return numeric_limits<double>::max();
74 }
75
76
77 /**
78 * Get QE for given ratio of hit probabilities and expectation value of the number of photo-electrons.\n
79 * The ratio corresponds to the hit probability with given QE divided by that with QE = 1.\n
80 * The expectation value is defined for a two-fold (or higher) coincidence.
81 *
82 * \param R ratio
83 * \param mu expectation value
84 * \return QE
85 */
86 inline double getQE(const double R, const double mu)
87 {
88 if (R < getMaximalHitProbability(mu)) {
89
90 if (mu > 0.0)
91 return -log(1.0 - R*(1.0 - exp(-mu))) / mu;
92 else
93 return R;
94
95 } else {
96
97 THROW(JValueOutOfRange, "Inconsistent arguments at method getQE(" << R << "," << mu <<")");
98 }
99 }
100}
101
102#endif
Exceptions.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
PMT analogue signal processor.
Exception handling.
Data structure for PMT parameters.
Exception for accessing a value in a collection that is outside of its range.
file Auxiliary data structures and methods for detector calibration.
Definition JAnchor.hh:12
double getMaximalHitProbability(const double mu)
Get maximal ratio of hit probabilities for given QE and expectation value of the number of photo-elec...
double getHitProbability(const double QE, const double mu)
Get ratio of hit probabilities for given QE and expectation value of the number of photo-electrons.
double getQE(const double R, const double mu)
Get QE for given ratio of hit probabilities and expectation value of the number of photo-electrons.
double getSurvivalProbability(const JPMTParameters &parameters)
Get model dependent probability that a one photo-electron hit survives the simulation of the PMT assu...
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
virtual double getThresholdProbability(const int NPE) const override
Probability that a hit survives the threshold of the PMT.