Jpp
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 
11 namespace JFIT {}
12 namespace JPP { using namespace JFIT; }
13 
14 namespace 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  */
28  JNPEHit() :
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
JFIT::JNPEHit::getP
double getP(const double E_GeV) const
Get muon energy dependent probability.
Definition: JNPEHit.hh:75
JFIT
Auxiliary classes and methods for linear and iterative data regression.
Definition: JEnergy.hh:15
JFIT::JNPEHit::getN
size_t getN() const
Get number of hits.
Definition: JNPEHit.hh:52
JTOOLS::n
const int n
Definition: JPolint.hh:628
JFIT::JNPEHit::getP
double getP() const
Get probability.
Definition: JNPEHit.hh:63
JFIT::JNPEHit
Auxiliary class for simultaneously handling light yields and response of PMT.
Definition: JNPEHit.hh:19
JFIT::JNPE::getP
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:147
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JFIT::JNPE::getChi2
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:160
JFIT::JNPEHit::__n
size_t __n
Definition: JNPEHit.hh:93
JFIT::JNPEHit::getChi2
double getChi2(const double E_GeV) const
Get chi2.
Definition: JNPEHit.hh:87
JFIT::JNPE
Auxiliary class for handling various light yields.
Definition: JNPE.hh:27
JFIT::JNPEHit::JNPEHit
JNPEHit()
Default constructor.
Definition: JNPEHit.hh:28
JNPE.hh
JFIT::JNPEHit::JNPEHit
JNPEHit(const JNPE &npe, const size_t n)
Constructor.
Definition: JNPEHit.hh:40