Jpp  17.1.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JK40.hh
Go to the documentation of this file.
1 #ifndef __JFIT__JK40__
2 #define __JFIT__JK40__
3 
4 #include <cmath>
5 
6 #include "JPhysics/JConstants.hh"
7 #include "JPhysics/JGeane.hh"
9 
10 #include "JFit/JFitToolkit.hh"
11 
12 
13 /**
14  * \author mdejong
15  */
16 
17 namespace JFIT {}
18 namespace JPP { using namespace JFIT; }
19 
20 namespace JFIT {
21 
22  /**
23  * Auxiliary class for handling light yields due to K40 decays.
24  */
25  struct JK40 {
26  /**
27  * Default constructor.
28  */
29  JK40() :
30  y0(0.0)
31  {}
32 
33 
34  /**
35  * Constructor.
36  *
37  * \param y0 light yield due to random background [npe]
38  */
39  JK40(const double y0) :
40  y0(y0)
41  {}
42 
43 
44  /**
45  * Get light yield due to random background.
46  *
47  * \return light yield [npe]
48  */
49  double getY0() const
50  {
51  return y0;
52  }
53 
54 
55  /**
56  * Expected number of photo-electrons for random background hypothesis.
57  *
58  * \return light yield [npe]
59  */
60  inline double getH0() const
61  {
62  return this->getY0();
63  }
64 
65 
66  /**
67  * Get probability for observing a hit or not.
68  *
69  * \param hit hit
70  * \return probability
71  */
72  double getP(const bool hit) const
73  {
74  return JFIT::getP(this->getH0(), hit);
75  }
76 
77 
78  /**
79  * Get chi2 for observing a hit or not.
80  *
81  * \param hit hit
82  * \return probability
83  */
84  double getChi2(const bool hit) const
85  {
86  return JFIT::getChi2(this->getH0(), hit);
87  }
88 
89  protected:
90  double y0; //!< light yield due to random background [npe]
91  };
92 }
93 
94 #endif
Auxiliary methods to evaluate Poisson probabilities and chi2.
JK40(const double y0)
Constructor.
Definition: JK40.hh:39
double getH0() const
Expected number of photo-electrons for random background hypothesis.
Definition: JK40.hh:60
Auxiliary methods for PDF calculations.
double getY0() const
Get light yield due to random background.
Definition: JK40.hh:49
Energy loss of muon.
double getChi2(const bool hit) const
Get chi2 for observing a hit or not.
Definition: JK40.hh:84
Auxiliary class for handling light yields due to K40 decays.
Definition: JK40.hh:25
double getP(const bool hit) const
Get probability for observing a hit or not.
Definition: JK40.hh:72
JK40()
Default constructor.
Definition: JK40.hh:29
Physics constants.
double getP(const double expval, bool hit)
Get Poisson probability to observe a hit or not for given expectation value for the number of hits...
Definition: JFitToolkit.hh:41
double y0
light yield due to random background [npe]
Definition: JK40.hh:90
double getChi2(const double P)
Get chi2 corresponding to given probability.
Definition: JFitToolkit.hh:56