Jpp  17.3.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JShowerNPEHit.hh
Go to the documentation of this file.
1 #ifndef __JFIT__JNPEHIT__
2 #define __JFIT__JNPEHIT__
3 
4 #include "JFit/JShowerNPE.hh"
5 
6 
7 /**
8  * \author mdejong, adomi
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 JShowerNPEHit :
20  public JShowerNPE
21  {
22  using JShowerNPE::getP;
23  using JShowerNPE::getChi2;
24 
25  /**
26  * Default constructor.
27  */
29  JShowerNPE(),
30  __n (0)
31  {}
32 
33 
34  /**
35  * Constructor.
36  *
37  * \param npe npe
38  * \param n number of hits
39  */
41  const size_t n) :
42  JShowerNPE(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 shower 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
double getChi2(const double E_GeV) const
Get chi2.
double getChi2(const double E_GeV, const bool hit) const
Get chi2 for observing a hit or not as a function of shower energy.
Definition: JShowerNPE.hh:93
double getP(const double E_GeV, const bool hit) const
Get probability for observing a hit or not as a function of shower energy.
Definition: JShowerNPE.hh:80
const int n
Definition: JPolint.hh:697
double getP(const double E_GeV) const
Get shower energy dependent probability.
size_t getN() const
Get number of hits.
JShowerNPEHit(const JShowerNPE &npe, const size_t n)
Constructor.
Auxiliary class for simultaneously handling light yields and response of PMT.
JShowerNPEHit()
Default constructor.
Auxiliary class for handling EM shower light yield.
Definition: JShowerNPE.hh:25
double getP() const
Get probability.