Jpp
JGeane.hh
Go to the documentation of this file.
1 #ifndef __JPHYSICS__JGEANE__
2 #define __JPHYSICS__JGEANE__
3 
4 #include <cmath>
5 #include <map>
6 
7 #include "JTools/JConstants.hh"
8 
9 
10 /**
11  * \file
12  * Energy loss of muon.
13  * \author mdejong
14  */
15 
16 namespace JPHYSICS {}
17 namespace JPP { using namespace JPHYSICS; }
18 
19 namespace JPHYSICS {
20 
21  using JTOOLS::MASS_MUON;
24 
25 
26  /**
27  * Equivalent muon track length per unit shower energy.
28  *
29  * \return equivalent muon track length [m/Gev]
30  */
31  inline double geanc()
32  {
33  return 4.7; // dx/dE [m/GeV]
34  }
35 
36 
37  /**
38  * Interface for muon energy loss.
39  *
40  * This interface provides for the various function object operators.
41  */
42  class JGeane {
43  public:
44  /**
45  * Get energy loss constant.
46  *
47  * \return Energy loss due to ionisation [GeV/m]
48  */
49  virtual double getA() const = 0;
50 
51 
52  /**
53  * Get energy loss constant.
54  *
55  * \return Energy loss due to pair production and Bremstrahlung [m^-1]
56  */
57  virtual double getB() const = 0;
58 
59 
60  /**
61  * Get energy of muon after specified distance.
62  *
63  * \param E Energy of muon [GeV]
64  * \param dx distance traveled [m]
65  * \return Energy of muon [GeV]
66  */
67  virtual double getE(const double E, const double dx) const = 0;
68 
69 
70  /**
71  * Get distance traveled by muon.
72  *
73  * \param E0 Energy of muon at start [GeV]
74  * \param E1 Energy of muon at end [GeV]
75  * \return distance traveled [m]
76  */
77  virtual double getX(const double E0,
78  const double E1) const = 0;
79 
80 
81  /**
82  * Energy of muon after specified distance.
83  *
84  * \param E Energy of muon [GeV]
85  * \param dx distance traveled [m]
86  * \return Energy of muon [GeV]
87  */
88  double operator()(const double E, const double dx) const
89  {
90  return this->getE(E, dx);
91  }
92 
93 
94  /**
95  * Range of muon.
96  *
97  * \param E Energy of muon [GeV]
98  * \return range [m]
99  */
100  double operator()(const double E) const
101  {
102  return this->getX(E, 0.0);
103  }
104 
105 
106  /**
107  * Equivalent unit track length per unit shower energy and per unit track length.
108  *
109  * \return equivalent unit track length [Gev^-1]
110  */
111  double operator()() const
112  {
113  return this->getB() * geanc();
114  }
115  };
116 
117 
118  /**
119  * Function object for the energy loss of the muon.\n
120  * The energy loss can be formulated as:
121  *
122  * \f[ -\frac{dE}{dx} = a + bE\f]
123  *
124  * N.B:
125  * \f$a\f$ and \f$b\f$ are assumed constant (internal units m and GeV, respectively).
126  */
127  class JGeane_t :
128  public JGeane
129  {
130  public:
131  /**
132  * constructor
133  * \param __a Energy loss due to ionisation [GeV/m]
134  * \param __b Energy loss due to pair production and Bremstrahlung [m^-1]
135  */
136  JGeane_t(const double __a,
137  const double __b) :
138  a(__a),
139  b(__b)
140  {}
141 
142 
143  /**
144  * Get energy loss constant.
145  *
146  * \return Energy loss due to ionisation [GeV/m]
147  */
148  virtual double getA() const
149  {
150  return a;
151  }
152 
153 
154  /**
155  * Get energy loss constant.
156  *
157  * \return Energy loss due to pair production and Bremstrahlung [m^-1]
158  */
159  virtual double getB() const
160  {
161  return b;
162  }
163 
164 
165  /**
166  * Get energy of muon after specified distance.
167  *
168  * \param E Energy of muon [GeV]
169  * \param dx distance traveled [m]
170  * \return Energy of muon [GeV]
171  */
172  virtual double getE(const double E, const double dx) const
173  {
174  const double y = (a/b + E) * exp(-b*dx) - a/b;
175 
176  if (y > 0.0)
177  return y;
178  else
179  return 0.0;
180  }
181 
182 
183  /**
184  * Get distance traveled by muon.
185  *
186  * \param E0 Energy of muon at start [GeV]
187  * \param E1 Energy of muon at end [GeV]
188  * \return distance traveled [m]
189  */
190  virtual double getX(const double E0,
191  const double E1) const
192  {
193  return -log((a + b*E1) / (a+b*E0)) / b;
194  }
195 
196  protected:
197  const double a;
198  const double b;
199  };
200 
201 
202  /**
203  * Function object for energy dependent energy loss of the muon.
204  *
205  * Approximate values of energy loss parameters taken from reference:
206  * Proceedings of ICRC 2001, "Precise parametrizations of muon energy losses in water",
207  * S. Klimushin, E. Bugaev and I. Sokalski.
208  */
209  class JGeaneWater :
210  public JGeane,
211  protected std::map<double, JGeane_t>
212  {
213  public:
214  /**
215  * Default constructor.
216  */
218  {
219  using namespace std;
220 
221  this->insert(make_pair( 0.0e0, JGeane_t( 2.30e-1 * DENSITY_SEA_WATER, 15.50e-4 * DENSITY_SEA_WATER)));
222  this->insert(make_pair(30.0e0, JGeane_t( 2.67e-1 * DENSITY_SEA_WATER, 3.40e-4 * DENSITY_SEA_WATER)));
223  this->insert(make_pair(35.3e3, JGeane_t(-6.50e-1 * DENSITY_SEA_WATER, 3.66e-4 * DENSITY_SEA_WATER)));
224  }
225 
226 
227  /**
228  * Get energy loss constant.
229  *
230  * N.B. The return value corresponds to the low-energy regime.
231  *
232  * \return Energy loss due to ionisation [GeV/m]
233  */
234  virtual double getA() const
235  {
236  return 2.30e-1 * DENSITY_SEA_WATER;
237  }
238 
239 
240  /**
241  * Get energy loss constant.
242  *
243  * N.B. The return value corresponds to the medium-energy regime.
244  *
245  * \return Energy loss due to pair production and Bremstrahlung [m^-1]
246  */
247  virtual double getB() const
248  {
249  return 3.40e-4 * DENSITY_SEA_WATER;
250  }
251 
252 
253  /**
254  * Get energy of muon after specified distance.
255  *
256  * \param E Energy of muon [GeV]
257  * \param dx distance traveled [m]
258  * \return Energy of muon [GeV]
259  */
260  virtual double getE(const double E, const double dx) const
261  {
262  double E1 = E;
263  double x1 = dx;
264 
265  if (E1 > MASS_MUON) {
266 
267  const_iterator p = this->lower_bound(E1);
268 
269  do {
270 
271  --p;
272 
273  const double x2 = p->second.getX(E1, p->first);
274 
275  if (x2 > x1) {
276  return p->second.getE(E1, x1);
277  }
278 
279  E1 = p->first;
280  x1 -= x2;
281 
282  } while (p != this->begin());
283  }
284 
285  return E1;
286  }
287 
288 
289  /**
290  * Get distance traveled by muon.
291  *
292  * \param E0 Energy of muon at start [GeV]
293  * \param E1 Energy of muon at end [GeV]
294  * \return distance traveled [m]
295  */
296  virtual double getX(const double E0,
297  const double E1) const
298  {
299  double E = E0;
300  double dx = 0.0;
301 
302  if (E > MASS_MUON) {
303 
304  const_iterator p = this->lower_bound(E);
305 
306  do {
307 
308  --p;
309 
310  if (E1 > p->first) {
311  return dx + p->second.getX(E, E1);
312  }
313 
314  dx += p->second.getX(E, p->first);
315  E = p->first;
316 
317  } while (p != this->begin());
318  }
319 
320  return dx;
321  }
322  };
323 
324 
325  /**
326  * Function object for energy loss of muon in sea water.
327  */
328  static const JGeaneWater gWater;
329 
330 
331  /**
332  * Function object for energy loss of muon in rock.
333  */
334  static const JGeane_t gRock(2.67e-1 * 0.9 * DENSITY_ROCK,
335  3.40e-4 * 1.2 * DENSITY_ROCK);
336 
337 }
338 
339 #endif
JPHYSICS::JGeane::getE
virtual double getE(const double E, const double dx) const =0
Get energy of muon after specified distance.
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
JTOOLS::DENSITY_SEA_WATER
static const double DENSITY_SEA_WATER
Fixed environment values.
Definition: JConstants.hh:34
JPHYSICS::JGeane_t::getB
virtual double getB() const
Get energy loss constant.
Definition: JGeane.hh:159
JPHYSICS::JGeane::getX
virtual double getX(const double E0, const double E1) const =0
Get distance traveled by muon.
JPHYSICS::JGeane::operator()
double operator()(const double E) const
Range of muon.
Definition: JGeane.hh:100
JPHYSICS::JGeane_t
Function object for the energy loss of the muon.
Definition: JGeane.hh:127
JPHYSICS
Auxiliary classes and methods for calculation of PDF and muon energy loss.
Definition: JAbstractMedium.hh:9
JPHYSICS::JGeane::operator()
double operator()() const
Equivalent unit track length per unit shower energy and per unit track length.
Definition: JGeane.hh:111
JPHYSICS::JGeaneWater::getE
virtual double getE(const double E, const double dx) const
Get energy of muon after specified distance.
Definition: JGeane.hh:260
JPHYSICS::JGeane_t::b
const double b
Definition: JGeane.hh:198
JPHYSICS::JGeane::getB
virtual double getB() const =0
Get energy loss constant.
JPHYSICS::JGeane_t::getX
virtual double getX(const double E0, const double E1) const
Get distance traveled by muon.
Definition: JGeane.hh:190
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JPHYSICS::JGeane::getA
virtual double getA() const =0
Get energy loss constant.
JPHYSICS::gRock
static const JGeane_t gRock(2.67e-1 *0.9 *DENSITY_ROCK, 3.40e-4 *1.2 *DENSITY_ROCK)
Function object for energy loss of muon in rock.
JPHYSICS::JGeane_t::getE
virtual double getE(const double E, const double dx) const
Get energy of muon after specified distance.
Definition: JGeane.hh:172
JPHYSICS::geanc
double geanc()
Equivalent muon track length per unit shower energy.
Definition: JGeane.hh:31
JConstants.hh
JPHYSICS::JGeane_t::a
const double a
Definition: JGeane.hh:197
JPHYSICS::JGeaneWater::getX
virtual double getX(const double E0, const double E1) const
Get distance traveled by muon.
Definition: JGeane.hh:296
JPHYSICS::JGeane
Interface for muon energy loss.
Definition: JGeane.hh:42
std::map
Definition: JSTDTypes.hh:16
JPHYSICS::JGeane_t::JGeane_t
JGeane_t(const double __a, const double __b)
constructor
Definition: JGeane.hh:136
JPHYSICS::JGeane::operator()
double operator()(const double E, const double dx) const
Energy of muon after specified distance.
Definition: JGeane.hh:88
JPHYSICS::JGeaneWater
Function object for energy dependent energy loss of the muon.
Definition: JGeane.hh:209
JPHYSICS::JGeaneWater::JGeaneWater
JGeaneWater()
Default constructor.
Definition: JGeane.hh:217
JTOOLS::DENSITY_ROCK
static const double DENSITY_ROCK
Density of rock [g/cm^3].
Definition: JConstants.hh:35
std
Definition: jaanetDictionary.h:36
JPHYSICS::JGeane_t::getA
virtual double getA() const
Get energy loss constant.
Definition: JGeane.hh:148
JPHYSICS::JGeaneWater::getB
virtual double getB() const
Get energy loss constant.
Definition: JGeane.hh:247
JPHYSICS::JGeaneWater::getA
virtual double getA() const
Get energy loss constant.
Definition: JGeane.hh:234