Jpp  16.0.0-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  * Note that the effective light yield due to bremsstrahlung is proportional to the muon energy.
26  * The position along the muon path is used to correct for the energy loss of the muon
27  * between the reference position (z = 0) and the point of emission of the light.
28  */
29  struct JNPE :
30  public JK40
31  {
32  /**
33  * Default constructor.
34  */
35  JNPE() :
36  JK40(),
37  y1(0.0),
38  yA(0.0),
39  yB(0.0),
40  z (0.0)
41  {}
42 
43 
44  /**
45  * Constructor.
46  *
47  * \param y0 light yield due to random background [npe]
48  * \param y1 light yield due to minimum ionizing particle [npe]
49  * \param yA light yield due to delta-rays [npe*m/GeV]
50  * \param yB light yield due to bremsstrahlung [npe/GeV]
51  * \param z position along muon path [m]
52  */
53  JNPE(const double y0,
54  const double y1,
55  const double yA,
56  const double yB,
57  const double z) :
58  JK40(y0),
59  y1(y1),
60  yA(yA),
61  yB(yB),
62  z (z)
63  {}
64 
65 
66  /**
67  * Get light yield due to minimum ionizing particle.
68  *
69  * \return light yield [npe]
70  */
71  double getY1() const
72  {
73  return y1;
74  }
75 
76 
77  /**
78  * Get light yield due to delta-rays
79  *
80  * \return light yield [npe*m/GeV]
81  */
82  double getYA() const
83  {
84  return yA;
85  }
86 
87 
88  /**
89  * Get light yield due to bremsstrahlung.
90  *
91  * \return light yield [npe/GeV]
92  */
93  double getYB() const
94  {
95  return yB;
96  }
97 
98 
99  /**
100  * Get position along muon path.
101  *
102  * \return position along muon path [m]
103  */
104  double getZ() const
105  {
106  return z;
107  }
108 
109 
110  /**
111  * Expected number of photo-electrons for muon hypothesis as a function of muon energy.
112  *
113  * \param E_GeV energy [GeV]
114  * \return light yield [npe]
115  */
116  inline double getH1(const double E_GeV) const
117  {
118  using namespace JPP;
119 
120  const double E = gWater.getE(E_GeV, this->getZ());
121 
123  return (this->getY1() +
124  this->getYA() * getDeltaRaysFromMuon(E) +
125  this->getYB() * E);
126  else
127  return 0.0;
128  }
129 
130 
131  /**
132  * Get probability for observing a hit or not as a function of muon energy.
133  *
134  * \param E_GeV energy [GeV]
135  * \param hit hit
136  * \return probability
137  */
138  double getP(const double E_GeV, const bool hit) const
139  {
140  return JFIT::getP(this->getH1(E_GeV) + this->getH0(), hit);
141  }
142 
143 
144  /**
145  * Get chi2 for observing a hit or not as a function of muon energy.
146  *
147  * \param E_GeV energy [GeV]
148  * \param hit hit
149  * \return probability
150  */
151  double getChi2(const double E_GeV, const bool hit) const
152  {
153  return JFIT::getChi2(this->getH1(E_GeV) + this->getH0(), hit);
154  }
155 
156  protected:
157  double y1; //!< light yield due to minimum ionizing particle [npe]
158  double yA; //!< light yield due to delta-rays [npe*m/GeV]
159  double yB; //!< light yield due to bremsstrahlung [npe/GeV]
160  double z; //!< position along muon path [m]
161  };
162 }
163 
164 #endif
Auxiliary methods to evaluate Poisson probabilities and chi2.
double z
position along muon path [m]
Definition: JNPE.hh:160
double getH1(const double E_GeV) const
Expected number of photo-electrons for muon hypothesis as a function of muon energy.
Definition: JNPE.hh:116
double getH0() const
Expected number of photo-electrons for random background hypothesis.
Definition: JK40.hh:60
Auxiliary methods for PDF calculations.
then usage E
Definition: JMuonPostfit.sh:35
Energy loss of muon.
double getYB() const
Get light yield due to bremsstrahlung.
Definition: JNPE.hh:93
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:323
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:159
double getYA() const
Get light yield due to delta-rays.
Definition: JNPE.hh:82
double getY1() const
Get light yield due to minimum ionizing particle.
Definition: JNPE.hh:71
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:138
Auxiliary class for handling various light yields.
Definition: JNPE.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 y1
light yield due to minimum ionizing particle [npe]
Definition: JNPE.hh:157
virtual double getE(const double E, const double dx) const override
Get energy of muon after specified distance.
Definition: JGeane.hh:255
JNPE()
Default constructor.
Definition: JNPE.hh:35
double yA
light yield due to delta-rays [npe*m/GeV]
Definition: JNPE.hh:158
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:151
JNPE(const double y0, const double y1, const double yA, const double yB, const double z)
Constructor.
Definition: JNPE.hh:53
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:104