Jpp 20.0.0-rc.9-29-gccc23c492-D
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 ps (1.0)
29 {}
30
31
32 /**
33 * Constructor.
34 *
35 * \param npe npe
36 * \param ns number of hits
37 * \param ps survival probability of one photo-electron
38 */
39 JNPEHit(const JNPE& npe,
40 const size_t ns,
41 const double ps) :
42 JNPE(npe),
43 ns (ns),
44 ps (ps)
45 {}
46
47
48 /**
49 * Get number of hits.
50 *
51 * \return number of hits
52 */
53 inline size_t getN() const
54 {
55 return ns;
56 }
57
58
59 /**
60 * Get survival probability of one photo-electron.
61 *
62 * \return survival probability of one photo-electron
63 */
64 double getPS() const
65 {
66 return ps;
67 }
68
69
70 /**
71 * Get muon energy dependent probability.
72 *
73 * \param E_GeV energy [GeV]
74 * \return probability
75 */
76 double getP(const double E_GeV) const
77 {
78 const double x = this->getH1(E_GeV) + this->getH0(); // expectation value for total number of photo-electrons
79
80 const double p0 = exp(-x) * (1.0 + // Poisson probability of 0 photo-electrons OR
81 x * (1.0 - ps)); // Poisson probability of 1 photo-electron AND NOT survive
82
83 if (this->getN() > 0)
84 return 1.0 - p0;
85 else
86 return p0;
87 }
88
89
90 /**
91 * Get chi2.
92 *
93 * \param E_GeV energy [GeV]
94 * \return chi2
95 */
96 double getChi2(const double E_GeV) const
97 {
98 return -log(this->getP(E_GeV));
99 }
100
101 protected:
102 size_t ns; //!< number of hits
103 double ps; //!< survival probability of one photo-electron
104 };
105}
106
107#endif
Auxiliary classes and methods for linear and iterative data regression.
Definition JEnergy.hh:15
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:76
size_t getN() const
Get number of hits.
Definition JNPEHit.hh:53
double getChi2(const double E_GeV) const
Get chi2.
Definition JNPEHit.hh:96
size_t ns
number of hits
Definition JNPEHit.hh:102
double getPS() const
Get survival probability of one photo-electron.
Definition JNPEHit.hh:64
double ps
survival probability of one photo-electron
Definition JNPEHit.hh:103
JNPEHit()
Default constructor.
Definition JNPEHit.hh:25
JNPEHit(const JNPE &npe, const size_t ns, const double ps)
Constructor.
Definition JNPEHit.hh:39
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