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