Jpp 19.3.0-rc.1
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 using JNPE::getP;
23 using JNPE::getChi2;
24
25 /**
26 * Default constructor.
27 */
29 JNPE(),
30 __n (0)
31 {}
32
33
34 /**
35 * Constructor.
36 *
37 * \param npe npe
38 * \param n number of hits
39 */
40 JNPEHit(const JNPE& npe,
41 const size_t n) :
42 JNPE(npe),
43 __n (n)
44 {}
45
46
47 /**
48 * Get number of hits.
49 *
50 * \return number of hits
51 */
52 inline size_t getN() const
53 {
54 return __n;
55 }
56
57
58 /**
59 * Get probability.
60 *
61 * \return probability
62 */
63 double getP() const
64 {
65 return this->getP(this->getN());
66 }
67
68
69 /**
70 * Get muon energy dependent probability.
71 *
72 * \param E_GeV energy [GeV]
73 * \return probability
74 */
75 double getP(const double E_GeV) const
76 {
77 return this->getP(E_GeV, this->getN() > 0);
78 }
79
80
81 /**
82 * Get chi2.
83 *
84 * \param E_GeV energy [GeV]
85 * \return chi2
86 */
87 double getChi2(const double E_GeV) const
88 {
89 return this->getChi2(E_GeV, this->getN() > 0);
90 }
91
92 protected:
93 size_t __n;
94 };
95}
96
97#endif
Auxiliary classes and methods for linear and iterative data regression.
Definition JEnergy.hh:15
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
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:75
size_t getN() const
Get number of hits.
Definition JNPEHit.hh:52
size_t __n
Definition JNPEHit.hh:93
double getChi2(const double E_GeV) const
Get chi2.
Definition JNPEHit.hh:87
JNPEHit(const JNPE &npe, const size_t n)
Constructor.
Definition JNPEHit.hh:40
double getP() const
Get probability.
Definition JNPEHit.hh:63
JNPEHit()
Default constructor.
Definition JNPEHit.hh:28
Auxiliary class for handling various light yields.
Definition JNPE.hh:32
double getChi2(const double E_GeV, const bool hit) const
Get chi2 for observing a hit or not as a function of muon energy.
Definition JNPE.hh:152
double getP(const double E_GeV, const bool hit) const
Get probability for observing a hit or not as a function of muon energy.
Definition JNPE.hh:139