Jpp  18.0.1-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JNPE.hh
Go to the documentation of this file.
1 #ifndef __JFIT__JNPE__
2 #define __JFIT__JNPE__
3 
4 #include <cmath>
5 
6 #include "JPhysics/JConstants.hh"
7 #include "JPhysics/JGeane.hh"
9 
10 #include "JFit/JK40.hh"
11 #include "JFit/JFitToolkit.hh"
12 
13 
14 /**
15  * \author mdejong
16  */
17 
18 namespace JFIT {}
19 namespace JPP { using namespace JFIT; }
20 
21 namespace JFIT {
22 
23  /**
24  * Auxiliary class for handling various light yields.
25  *
26  * Note that the effective light yield due to bremsstrahlung is proportional to the muon energy.\n
27  * The position along the muon path is used to correct for the energy loss of the muon
28  * between the reference position (z = 0) and the point of emission of the light.
29  */
30  struct JNPE :
31  public JK40
32  {
33  /**
34  * Default constructor.
35  */
36  JNPE() :
37  JK40(),
38  y1(0.0),
39  yA(0.0),
40  yB(0.0),
41  z (0.0)
42  {}
43 
44 
45  /**
46  * Constructor.
47  *
48  * \param y0 light yield due to random background [npe]
49  * \param y1 light yield due to minimum ionizing particle [npe]
50  * \param yA light yield due to delta-rays [npe*m/GeV]
51  * \param yB light yield due to bremsstrahlung [npe/GeV]
52  * \param z position along muon path [m]
53  */
54  JNPE(const double y0,
55  const double y1,
56  const double yA,
57  const double yB,
58  const double z) :
59  JK40(y0),
60  y1(y1),
61  yA(yA),
62  yB(yB),
63  z (z)
64  {}
65 
66 
67  /**
68  * Get light yield due to minimum ionizing particle.
69  *
70  * \return light yield [npe]
71  */
72  double getY1() const
73  {
74  return y1;
75  }
76 
77 
78  /**
79  * Get light yield due to delta-rays
80  *
81  * \return light yield [npe*m/GeV]
82  */
83  double getYA() const
84  {
85  return yA;
86  }
87 
88 
89  /**
90  * Get light yield due to bremsstrahlung.
91  *
92  * \return light yield [npe/GeV]
93  */
94  double getYB() const
95  {
96  return yB;
97  }
98 
99 
100  /**
101  * Get position along muon path.
102  *
103  * \return position along muon path [m]
104  */
105  double getZ() const
106  {
107  return z;
108  }
109 
110 
111  /**
112  * Expected number of photo-electrons for muon hypothesis as a function of muon energy.
113  *
114  * \param E_GeV energy [GeV]
115  * \return light yield [npe]
116  */
117  inline double getH1(const double E_GeV) const
118  {
119  using namespace JPP;
120 
121  const double E = gWater.getE(E_GeV, this->getZ());
122 
124  return (this->getY1() +
125  this->getYA() * getDeltaRaysFromMuon(E) +
126  this->getYB() * E);
127  else
128  return 0.0;
129  }
130 
131 
132  /**
133  * Get probability for observing a hit or not as a function of muon energy.
134  *
135  * \param E_GeV energy [GeV]
136  * \param hit hit
137  * \return probability
138  */
139  double getP(const double E_GeV, const bool hit) const
140  {
141  return JFIT::getP(this->getH1(E_GeV) + this->getH0(), hit);
142  }
143 
144 
145  /**
146  * Get chi2 for observing a hit or not as a function of muon energy.
147  *
148  * \param E_GeV energy [GeV]
149  * \param hit hit
150  * \return probability
151  */
152  double getChi2(const double E_GeV, const bool hit) const
153  {
154  return JFIT::getChi2(this->getH1(E_GeV) + this->getH0(), hit);
155  }
156 
157  protected:
158  double y1; //!< light yield due to minimum ionizing particle [npe]
159  double yA; //!< light yield due to delta-rays [npe*m/GeV]
160  double yB; //!< light yield due to bremsstrahlung [npe/GeV]
161  double z; //!< position along muon path [m]
162  };
163 }
164 
165 #endif
Auxiliary methods to evaluate Poisson probabilities and chi2.
double z
position along muon path [m]
Definition: JNPE.hh:161
double getH1(const double E_GeV) const
Expected number of photo-electrons for muon hypothesis as a function of muon energy.
Definition: JNPE.hh:117
double getH0() const
Expected number of photo-electrons for random background hypothesis.
Definition: JK40.hh:60
Auxiliary methods for PDF calculations.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
Energy loss of muon.
double getYB() const
Get light yield due to bremsstrahlung.
Definition: JNPE.hh:94
static const double MASS_MUON
muon mass [GeV]
static const double INDEX_OF_REFRACTION_WATER
Average index of refraction of water corresponding to the group velocity.
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
Definition: JGeane.hh:381
Auxiliary class for handling light yields due to K40 decays.
Definition: JK40.hh:25
double yB
light yield due to bremsstrahlung [npe/GeV]
Definition: JNPE.hh:160
double getYA() const
Get light yield due to delta-rays.
Definition: JNPE.hh:83
double getY1() const
Get light yield due to minimum ionizing particle.
Definition: JNPE.hh:72
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
Auxiliary class for handling various light yields.
Definition: JNPE.hh:30
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 y1
light yield due to minimum ionizing particle [npe]
Definition: JNPE.hh:158
virtual double getE(const double E, const double dx) const override
Get energy of muon after specified distance.
Definition: JGeane.hh:257
JNPE()
Default constructor.
Definition: JNPE.hh:36
double yA
light yield due to delta-rays [npe*m/GeV]
Definition: JNPE.hh:159
double getDeltaRaysFromMuon(const double E)
Equivalent EM-shower energy due to delta-rays per unit muon track length.
Definition: JPDFToolkit.hh:67
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
JNPE(const double y0, const double y1, const double yA, const double yB, const double z)
Constructor.
Definition: JNPE.hh:54
double getChi2(const double P)
Get chi2 corresponding to given probability.
Definition: JFitToolkit.hh:56
double getZ() const
Get position along muon path.
Definition: JNPE.hh:105