Jpp
 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 "JTools/JConstants.hh"
7 #include "JPhysics/JGeane.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 JPP;
129 
130  const double E = gWater.getE(E_GeV, this->getZ());
131 
133  return this->getYA() + E * this->getYB();
134  else
135  return 0.0;
136  }
137 
138 
139  /**
140  * Get probability for observing a hit or not as a function of muon energy.
141  *
142  * \param E_GeV energy [GeV]
143  * \param hit hit
144  * \return probability
145  */
146  double getP(const double E_GeV, const bool hit) const
147  {
148  return JFIT::getP(this->getH1(E_GeV) + this->getH0(), hit);
149  }
150 
151 
152  /**
153  * Get chi2 for observing a hit or not as a function of muon energy.
154  *
155  * \param E_GeV energy [GeV]
156  * \param hit hit
157  * \return probability
158  */
159  double getChi2(const double E_GeV, const bool hit) const
160  {
161  return JFIT::getChi2(this->getH1(E_GeV) + this->getH0(), hit);
162  }
163 
164  protected:
165  double __yA; //!< light yield due to minimum ionizing particle [npe]
166  double __yB; //!< light yield due to bremsstrahlung [npe/GeV]
167  double __z; //!< position along muon path [m]
168  };
169 }
170 
171 #endif
Auxiliary methods to evaluate Poisson probabilities and chi2.
JNPE(const JK40 &k40, const double yA, const double yB, const double z)
Constructor.
Definition: JNPE.hh:53
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
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
static const double MASS_MUON
muon mass [GeV]
Definition: JConstants.hh:59
double getY0() const
Get expectation value for number of single hits.
Definition: JK40.hh:101
Energy loss of muon.
double __z
position along muon path [m]
Definition: JNPE.hh:167
double getYB() const
Get light yield due to bremsstrahlung.
Definition: JNPE.hh:80
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
Definition: JGeane.hh:328
Auxiliary class for converting various rates to expectation values of the number of hits within a giv...
Definition: JK40.hh:30
virtual double getE(const double E, const double dx) const
Get energy of muon after specified distance.
Definition: JGeane.hh:260
double getYA() const
Get light yield due to muon itself.
Definition: JNPE.hh:69
Constants.
double getY1(const size_t M) const
Get expectation value for number of multiple hits.
Definition: JK40.hh:113
double __yB
light yield due to bremsstrahlung [npe/GeV]
Definition: JNPE.hh:166
double getH0() const
Expected number of photo-electrons for random background hypothesis.
Definition: JNPE.hh:102
double getP(size_t M) const
Get probability to observe a hit with given multiplicity.
Definition: JK40.hh:129
double __yA
light yield due to minimum ionizing particle [npe]
Definition: JNPE.hh:165
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:146
Auxiliary class for handling various light yields.
Definition: JNPE.hh:27
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:114
JNPE()
Default constructor.
Definition: JNPE.hh:37
static const double INDEX_OF_REFRACTION_WATER
average index of refraction of water
Definition: JConstants.hh:37
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:159
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:91
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37