Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JNPEHit.hh
Go to the documentation of this file.
1#ifndef __JFIT__JNPEHIT__
2#define __JFIT__JNPEHIT__
3
4#include "JFit/JNPE.hh"
5
6
7/**
8 * \author mdejong
9 */
10
11namespace JFIT {}
12namespace JPP { using namespace JFIT; }
13
14namespace JFIT {
15
16 /**
17 * Auxiliary class for simultaneously handling light yields and response of PMT.
18 */
19 struct JNPEHit :
20 public JNPE
21 {
22 /**
23 * Default constructor.
24 */
26 JNPE(),
27 ns(0),
28 QE(1.0),
29 ps(1.0)
30 {}
31
32
33 /**
34 * Constructor.
35 *
36 * \param npe npe
37 * \param ns number of hits
38 * \param QE relative quantum efficiency
39 * \param ps survival probability of one photo-electron
40 */
41 JNPEHit(const JNPE& npe,
42 const size_t ns,
43 const double QE,
44 const double ps) :
45 JNPE(npe),
46 ns(ns),
47 QE(QE),
48 ps(ps)
49 {}
50
51
52 /**
53 * Get number of hits.
54 *
55 * \return number of hits
56 */
57 inline size_t getN() const
58 {
59 return ns;
60 }
61
62
63 /**
64 * Get relative quantum efficiency.
65 *
66 * \return relative quantum efficiency
67 */
68 double getQE() const
69 {
70 return QE;
71 }
72
73
74 /**
75 * Get survival probability of one photo-electron.
76 *
77 * \return survival probability of one photo-electron
78 */
79 double getPS() const
80 {
81 return ps;
82 }
83
84
85 /**
86 * Get muon energy dependent probability.
87 *
88 * \param E_GeV energy [GeV]
89 * \return probability
90 */
91 double getP(const double E_GeV) const
92 {
93 const double x = (this->getH1(E_GeV) * this->getQE() +
94 this->getH0()); // expectation value for total number of photo-electrons
95
96 const double p0 = exp(-x) * (1.0 + // Poisson probability of 0 photo-electrons OR
97 x * (1.0 - ps)); // Poisson probability of 1 photo-electron AND NOT survive
98
99 if (this->getN() > 0)
100 return 1.0 - p0;
101 else
102 return p0;
103 }
104
105
106 /**
107 * Get chi2.
108 *
109 * \param E_GeV energy [GeV]
110 * \return chi2
111 */
112 double getChi2(const double E_GeV) const
113 {
114 return -log(this->getP(E_GeV));
115 }
116
117 protected:
118 size_t ns; //!< number of hits
119 double QE; //!< relative quantum efficiency
120 double ps; //!< survival probability of one photo-electron
121 };
122}
123
124#endif
Auxiliary classes and methods for linear and iterative data regression.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
double getH0() const
Expected number of photo-electrons for random background hypothesis.
Definition JK40.hh:60
Auxiliary class for simultaneously handling light yields and response of PMT.
Definition JNPEHit.hh:21
double getP(const double E_GeV) const
Get muon energy dependent probability.
Definition JNPEHit.hh:91
double getQE() const
Get relative quantum efficiency.
Definition JNPEHit.hh:68
size_t getN() const
Get number of hits.
Definition JNPEHit.hh:57
double getChi2(const double E_GeV) const
Get chi2.
Definition JNPEHit.hh:112
size_t ns
number of hits
Definition JNPEHit.hh:118
double getPS() const
Get survival probability of one photo-electron.
Definition JNPEHit.hh:79
JNPEHit(const JNPE &npe, const size_t ns, const double QE, const double ps)
Constructor.
Definition JNPEHit.hh:41
double ps
survival probability of one photo-electron
Definition JNPEHit.hh:120
JNPEHit()
Default constructor.
Definition JNPEHit.hh:25
double QE
relative quantum efficiency
Definition JNPEHit.hh:119
Auxiliary class for handling various light yields.
Definition JNPE.hh:31
double getH1(const double E_GeV) const
Expected number of photo-electrons for muon hypothesis as a function of muon energy.
Definition JNPE.hh:116