Jpp
JNPE.hh
Go to the documentation of this file.
1 #ifndef __JFIT__JNPE__
2 #define __JFIT__JNPE__
3 
4 #include <cmath>
5 
6 #include "JTools/JConstants.hh"
8 #include "JFit/JK40.hh"
9 #include "JFit/JFitToolkit.hh"
10 
11 
12 /**
13  * \author mdejong
14  */
15 
16 namespace JFIT {}
17 namespace JPP { using namespace JFIT; }
18 
19 namespace JFIT {
20 
21  /**
22  * Auxiliary class for handling various light yields.
23  * Note that the effective light yield due to bremsstrahlung is proportional to the muon energy.
24  * The position along the muon path is used to correct for the energy loss of the muon
25  * between the reference position (z = 0) and the point of emission of the light.
26  */
27  struct JNPE :
28  public JK40
29  {
30 
31  using JK40::getP;
32 
33 
34  /**
35  * Default constructor.
36  */
37  JNPE() :
38  JK40(),
39  __yA(0.0),
40  __yB(0.0),
41  __z (0.0)
42  {}
43 
44 
45  /**
46  * Constructor.
47  *
48  * \param k40 K40 light yields [npe]
49  * \param yA light yield due to minimum ionizing particle [npe]
50  * \param yB light yield due to bremsstrahlung [npe/GeV]
51  * \param z position along muon path [m]
52  */
53  JNPE(const JK40& k40,
54  const double yA,
55  const double yB,
56  const double z) :
57  JK40(k40),
58  __yA(yA),
59  __yB(yB),
60  __z (z)
61  {}
62 
63 
64  /**
65  * Get light yield due to muon itself.
66  *
67  * \return light yield [npe]
68  */
69  double getYA() const
70  {
71  return __yA;
72  }
73 
74 
75  /**
76  * Get light yield due to bremsstrahlung.
77  *
78  * \return light yield [npe/GeV]
79  */
80  double getYB() const
81  {
82  return __yB;
83  }
84 
85 
86  /**
87  * Get position along muon path.
88  *
89  * \return position along muon path [m]
90  */
91  double getZ() const
92  {
93  return __z;
94  }
95 
96 
97  /**
98  * Expected number of photo-electrons for random background hypothesis.
99  *
100  * \return light yield [npe]
101  */
102  inline double getH0() const
103  {
104  return this->getY0();
105  }
106 
107 
108  /**
109  * Expected number of photo-electrons for random background hypothesis.
110  *
111  * \param M multiplicity
112  * \return light yield [npe]
113  */
114  inline double getH0(const size_t M) const
115  {
116  return this->getY1(M);
117  }
118 
119 
120  /**
121  * Expected number of photo-electrons for muon hypothesis as a function of muon energy.
122  *
123  * \param E_GeV energy [GeV]
124  * \return light yield [npe]
125  */
126  inline double getH1(const double E_GeV) const
127  {
128  using namespace JTOOLS;
129  using namespace JPHYSICS;
130 
131  const double E = gWater.getE(E_GeV, this->getZ());
132 
134  return this->getYA() + E * this->getYB();
135  else
136  return 0.0;
137  }
138 
139 
140  /**
141  * Get probability for observing a hit or not as a function of muon energy.
142  *
143  * \param E_GeV energy [GeV]
144  * \param hit hit
145  * \return probability
146  */
147  double getP(const double E_GeV, const bool hit) const
148  {
149  return JFIT::getP(this->getH1(E_GeV) + this->getH0(), hit);
150  }
151 
152 
153  /**
154  * Get chi2 for observing a hit or not as a function of muon energy.
155  *
156  * \param E_GeV energy [GeV]
157  * \param hit hit
158  * \return probability
159  */
160  double getChi2(const double E_GeV, const bool hit) const
161  {
162  return JFIT::getChi2(this->getH1(E_GeV) + this->getH0(), hit);
163  }
164 
165  protected:
166  double __yA; //!< light yield due to minimum ionizing particle [npe]
167  double __yB; //!< light yield due to bremsstrahlung [npe/GeV]
168  double __z; //!< position along muon path [m]
169  };
170 }
171 
172 #endif
JFIT::JNPE::JNPE
JNPE(const JK40 &k40, const double yA, const double yB, const double z)
Constructor.
Definition: JNPE.hh:53
JFIT::JNPE::getZ
double getZ() const
Get position along muon path.
Definition: JNPE.hh:91
JFIT
Auxiliary classes and methods for linear and iterative data regression.
Definition: JEnergy.hh:15
JFIT::JK40::getP
double getP(size_t M) const
Get probability to observe a hit with given multiplicity.
Definition: JK40.hh:129
JTOOLS::MASS_MUON
static const double MASS_MUON
muon mass [GeV]
Definition: JConstants.hh:59
JPHYSICS::gWater
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
Definition: JGeane.hh:328
JFitToolkit.hh
JPDFToolkit.hh
JPHYSICS
Auxiliary classes and methods for calculation of PDF and muon energy loss.
Definition: JAbstractMedium.hh:9
JFIT::JNPE::getYB
double getYB() const
Get light yield due to bremsstrahlung.
Definition: JNPE.hh:80
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
JFIT::JNPE::__yA
double __yA
light yield due to minimum ionizing particle [npe]
Definition: JNPE.hh:166
JK40.hh
JFIT::JK40::getY0
double getY0() const
Get expectation value for number of single hits.
Definition: JK40.hh:101
JPHYSICS::JGeaneWater::getE
virtual double getE(const double E, const double dx) const
Get energy of muon after specified distance.
Definition: JGeane.hh:260
JFIT::JNPE::getH0
double getH0() const
Expected number of photo-electrons for random background hypothesis.
Definition: JNPE.hh:102
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
JConstants.hh
JFIT::JNPE::getH0
double getH0(const size_t M) const
Expected number of photo-electrons for random background hypothesis.
Definition: JNPE.hh:114
JTOOLS::INDEX_OF_REFRACTION_WATER
static const double INDEX_OF_REFRACTION_WATER
average index of refraction of water
Definition: JConstants.hh:37
JFIT::JNPE::getH1
double getH1(const double E_GeV) const
Expected number of photo-electrons for muon hypothesis as a function of muon energy.
Definition: JNPE.hh:126
JFIT::JK40
Auxiliary class for converting various rates to expectation values of the number of hits within a giv...
Definition: JK40.hh:30
JFIT::JNPE::JNPE
JNPE()
Default constructor.
Definition: JNPE.hh:37
JFIT::JNPE
Auxiliary class for handling various light yields.
Definition: JNPE.hh:27
JFIT::getChi2
double getChi2(const double P)
Get chi2 corresponding to given probability.
Definition: JFitToolkit.hh:80
JFIT::getP
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:37
JFIT::JNPE::__yB
double __yB
light yield due to bremsstrahlung [npe/GeV]
Definition: JNPE.hh:167
JTOOLS
Auxiliary classes and methods for multi-dimensional interpolations and histograms.
Definition: JAbstractCollection.hh:9
JFIT::JNPE::getYA
double getYA() const
Get light yield due to muon itself.
Definition: JNPE.hh:69
JFIT::JK40::getY1
double getY1(const size_t M) const
Get expectation value for number of multiple hits.
Definition: JK40.hh:113
JFIT::JNPE::__z
double __z
position along muon path [m]
Definition: JNPE.hh:168