Jpp - 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 #include "JFit/JK40.hh"
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 various light yields.
24  * Note that the effective light yield due to bremsstrahlung is proportional to the muon energy.
25  * The position along the muon path is used to correct for the energy loss of the muon
26  * between the reference position (z = 0) and the point of emission of the light.
27  */
28  struct JNPE :
29  public JK40
30  {
31  /**
32  * Default constructor.
33  */
34  JNPE() :
35  JK40(),
36  y1(0.0),
37  yA(0.0),
38  yB(0.0),
39  z (0.0)
40  {}
41 
42 
43  /**
44  * Constructor.
45  *
46  * \param k40 K40 light yields [npe]
47  * \param y1 light yield due to minimum ionizing particle [npe]
48  * \param yA light yield due to delta-rays [npe*m/GeV]
49  * \param yB light yield due to bremsstrahlung [npe/GeV]
50  * \param z position along muon path [m]
51  */
52  JNPE(const JK40& k40,
53  const double y1,
54  const double yA,
55  const double yB,
56  const double z) :
57  JK40(k40),
58  y1(y1),
59  yA(yA),
60  yB(yB),
61  z (z)
62  {}
63 
64 
65  /**
66  * Get light yield due to muon itself.
67  *
68  * \return light yield [npe]
69  */
70  double getY1() const
71  {
72  return y1;
73  }
74 
75 
76  /**
77  * Get light yield due to delta-rays
78  *
79  * \return light yield [npe*m/GeV]
80  */
81  double getYA() const
82  {
83  return yA;
84  }
85 
86 
87  /**
88  * Get light yield due to bremsstrahlung.
89  *
90  * \return light yield [npe/GeV]
91  */
92  double getYB() const
93  {
94  return yB;
95  }
96 
97 
98  /**
99  * Get position along muon path.
100  *
101  * \return position along muon path [m]
102  */
103  double getZ() const
104  {
105  return z;
106  }
107 
108 
109  /**
110  * Expected number of photo-electrons for random background hypothesis.
111  *
112  * \return light yield [npe]
113  */
114  inline double getH0() const
115  {
116  return this->JK40::getY0();
117  }
118 
119 
120  /**
121  * Expected number of photo-electrons for random background hypothesis.
122  *
123  * \param M multiplicity
124  * \return light yield [npe]
125  */
126  inline double getH0(const size_t M) const
127  {
128  return this->JK40::getY1(M);
129  }
130 
131 
132  /**
133  * Expected number of photo-electrons for muon hypothesis as a function of muon energy.
134  *
135  * \param E_GeV energy [GeV]
136  * \return light yield [npe]
137  */
138  inline double getH1(const double E_GeV) const
139  {
140  using namespace JPP;
141 
142  const double E = gWater.getE(E_GeV, this->getZ());
143 
145  return (this->getY1() +
146  this->getYA() * getDeltaRaysFromMuon(E) +
147  this->getYB() * E);
148  else
149  return 0.0;
150  }
151 
152 
153  /**
154  * Get probability 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 getP(const double E_GeV, const bool hit) const
161  {
162  return JFIT::getP(this->getH1(E_GeV) + this->getH0(), hit);
163  }
164 
165 
166  /**
167  * Get chi2 for observing a hit or not as a function of muon energy.
168  *
169  * \param E_GeV energy [GeV]
170  * \param hit hit
171  * \return probability
172  */
173  double getChi2(const double E_GeV, const bool hit) const
174  {
175  return JFIT::getChi2(this->getH1(E_GeV) + this->getH0(), hit);
176  }
177 
178  protected:
179  double y1; //!< light yield due to minimum ionizing particle [npe]
180  double yA; //!< light yield due to delta-rays [npe*m/GeV]
181  double yB; //!< light yield due to bremsstrahlung [npe/GeV]
182  double z; //!< position along muon path [m]
183  };
184 }
185 
186 #endif
Auxiliary methods to evaluate Poisson probabilities and chi2.
double z
position along muon path [m]
Definition: JNPE.hh:182
double getH1(const double E_GeV) const
Expected number of photo-electrons for muon hypothesis as a function of muon energy.
Definition: JNPE.hh:138
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
Auxiliary methods for PDF calculations.
double getY0() const
Get expectation value for number of single hits.
Definition: JK40.hh:100
Energy loss of muon.
double getYB() const
Get light yield due to bremsstrahlung.
Definition: JNPE.hh:92
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 converting various rates to expectation values of the number of hits within a giv...
Definition: JK40.hh:29
JNPE(const JK40 &k40, const double y1, const double yA, const double yB, const double z)
Constructor.
Definition: JNPE.hh:52
double yB
light yield due to bremsstrahlung [npe/GeV]
Definition: JNPE.hh:181
double getYA() const
Get light yield due to delta-rays.
Definition: JNPE.hh:81
double getY1() const
Get light yield due to muon itself.
Definition: JNPE.hh:70
double getY1(const size_t M) const
Get expectation value for number of multiple hits.
Definition: JK40.hh:112
double getH0() const
Expected number of photo-electrons for random background hypothesis.
Definition: JNPE.hh:114
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:160
Auxiliary class for handling various light yields.
Definition: JNPE.hh:28
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:36
double getH0(const size_t M) const
Expected number of photo-electrons for random background hypothesis.
Definition: JNPE.hh:126
double y1
light yield due to minimum ionizing particle [npe]
Definition: JNPE.hh:179
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:34
double yA
light yield due to delta-rays [npe*m/GeV]
Definition: JNPE.hh:180
double getDeltaRaysFromMuon(const double E)
Equivalent EM-shower energy due to delta-rays per unit muon track length.
Definition: JPDFToolkit.hh:75
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:173
double getChi2(const double P)
Get chi2 corresponding to given probability.
Definition: JFitToolkit.hh:79
double getZ() const
Get position along muon path.
Definition: JNPE.hh:103
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37