PhysicalFunctions.h
Go to the documentation of this file.
1 #ifndef _utl_PhysicalFuctions_h_
2 #define _utl_PhysicalFuctions_h_
3 
12 #include <cmath>
13 #include <utl/Math.h>
14 #include <utl/PhysicalConstants.h>
15 
16 
17 namespace utl {
18 
20  double GaisserHillas(const double x, const double x0,
21  const double xMax, const double nMax,
22  const double lambda);
23 
24 
34  template<int side>
35  double
36  GaisserHillasInverse(const double n, const double x0,
37  const double xMax, const double nMax,
38  const double lambda)
39  {
40  const double sxMax = (xMax - x0) / lambda;
41  const double sn = n / nMax;
42  const double x =
43  -sxMax * LambertW<(side-1)/2>(-std::pow(sn, 1/sxMax) / M_E);
44  return x * lambda + x0;
45  }
46 
47 
49  inline double Energy(const double beta)
50  { return kElectronMass / std::sqrt(1 - Sqr(beta)); }
51 
52 
54  inline double Beta(const double energy)
55  { return std::sqrt(1 - Sqr(kElectronMass/energy)); }
56 
57  namespace RefractionIndex {
58 
60  double LorentzLorentz(const double verticalDepth);
61 
63  double GladstoneDale(const double density,
64  const double densityAtSeaLevel = kAirDensitySeaLevel,
65  const double refractiveIndexAtSeaLevel = kRefractiveIndexSeaLevel);
66 
68  double Ciddor95(const double wl,
69  const double temperature,
70  const double pressure,
71  const double vaporPressure);
72 
73  }
74 
75 
77  double SaturationVaporPressure(const double temperature);
78 
79 
81  inline double CherenkovThreshold(const double nRef)
82  { return kElectronMass / std::sqrt(1 - 1/Sqr(nRef)); }
83 
84 
86  inline double ShowerAge(const double slantDepth, const double showerMax)
87  { return 3 / (1 + 2*showerMax/slantDepth); }
88 
89 
91  double MoliereRadius(const double temperature,
92  const double pressure,
93  const double cosTheta = 0);
94 
95 
98  double GoraCDF(const double rStar, const double age);
99 
100 
103  double InverseGoraCDF(const double fraction, const double age);
104 
105 
108  double GoraPDF(const double rStar, const double age);
109 
110 
112  double ElectronsAboveCut(const double enCut);
113 
114 
116  double EnergyDeposit(const double age, const double enCut);
117 
118 
120  inline double EnergyDeposit(const double depthX, const double xMax, const double enCut)
121  { return EnergyDeposit(ShowerAge(depthX, xMax), enCut); }
122 
123 
124 
125 
134  bool
135  QuadraticMaximumInterpolation(const std::vector<double>& x, const std::vector<double>& y,
136  double& xMax, double& yMax);
137 
138  namespace wcd {
139 
140  inline
141  double
142  PoissonFactor(const double sigmaFactor)
143  {
144  return std::max(1., 1/utl::Sqr(sigmaFactor));
145  }
146 
147 
151  };
152 
153 
154  double
156  const double cosTheta);
157 
158 
159  double
161  const double cosTheta, const double signal);
162 
163 
164  double TriggerProbability(const bool totdMoPSEnabled,
165  const double lgExpectedSignal, const double sin2Theta);
166 
167  }
168 
169 
170  namespace ssd {
171 
172  inline
173  double
174  PoissonFactor(const double sigmaFactor)
175  {
176  return 1/utl::Sqr(sigmaFactor);
177  }
178 
181  eGAP2019_000 // until gap-note is published.
182  };
183 
184 
185  double
187  const double cosTheta);
188 
189 
190  double
192  const double cosTheta, const double signal);
193 
194  }
195 
196 
197  namespace InvisibleEnergy {
198 
203  };
204 
205 
211  };
212 
213 
214  double
215  EnergyLimits(const double energy);
216 
217 
218  double
219  ModelFactor(const EInteractionModel interaction,
220  const ECompositionModel composition);
221 
222 
223  const double*
224  FitParameters(const ECompositionModel composition);
225 
226 
228  double
229  Factor(const double Eem,
230  const EInteractionModel iMod,
231  const ECompositionModel iCompo,
232  const double CosTheta);
233 
234 
236  double
237  FactorDerivative(const double Eem,
238  const EInteractionModel iMod,
239  const ECompositionModel iCompo,
240  const double CosTheta);
241 
242 
243  // ICRC 2013
244  // variance of invisible energy factor due to shower-to-shower fluctuations
245  // double FactorVariance(const double eTot);
246  // ICRC 2019
247  // variance of invisible energy factor due to shower-to-shower fluctuations and to the mass variance
248  double
249  FactorVariance(const double eCal, const double eTot);
250 
251  }
252 
253 
254  // Enum specifying the high-energy hardronic interaction model to be used to estimate/predict Xmax.
259  };
260 
261 
262  namespace XmaxParam {
263  /* Parameterization of the Xmax moments for CONEX simulated Xmax distributions.
264  The equations from 10.1088/1475-7516/2013/02/026
265  The parameters (for the newest interaction models) from GAP2020_058. */
266 
267  double
268  Mean(const double energy, const double massNumber,
269  const HadronicInteractionModel hadModel);
270 
271  double
272  StandardDeviation(const double energy, const double massNumber,
273  const HadronicInteractionModel hadModel);
274 
275  }
276 
277 
278  namespace GumbelXmax {
279  /* Parameters of the generalized gumbel function.
280 
281  G(z) = 1 / sigma * lambda ^ lambda / Gamma(lambda)
282  * (exp(-lambda * z - lambda * exp(-z)))
283  with z = (x - mu) / sigma
284 
285  The equations are from 10.1088/1475-7516/2013/07/050.
286  The parameters (for the newest interaction models)
287  are from GAP2020_058. */
288 
289  // Does not correspond to the mean of the Xmax distribution
290  double
291  Mu(const double energy, const double massNumber,
292  const HadronicInteractionModel hadModel);
293 
294  // Does not correspond to the standard deviation of the Xmax distribution
295  double
296  Sigma(const double energy, const double massNumber,
297  const HadronicInteractionModel hadModel);
298 
299  double
300  Lambda(const double energy, const double massNumber,
301  const HadronicInteractionModel hadModel);
302  }
303 
304 }
305 
306 
307 #endif
double Factor(const double energyEM, const EInteractionModel intMod, const ECompositionModel compMod, const double cosTheta)
invisible energy factor, finv=Etot/Eem, given Eem. CosTheta only needed when using data driven estima...
double InverseGoraCDF(const double fraction, const double age)
constexpr T Sqr(const T &x)
double GoraCDF(const double rStar, const double age)
double GladstoneDale(const double density, const double densityAtSeaLevel, const double refractiveIndexAtSeaLevel)
Calculate the refraction index for a given density.
double Energy(const double beta)
Calculate the electron energy for a relativistic beta.
double ElectronsAboveCut(double enCut)
Fraction of electrons above energy cutoff enCut (in MeV) at age = 1.
constexpr double kElectronMass
double ModelFactor(const EInteractionModel interaction, const ECompositionModel composition)
double FactorDerivative(const double energyEM, const EInteractionModel intMod, const ECompositionModel compMod, const double cosTheta)
derivative of invisible energy factor dfinv/dEem given Eem. CosTheta only needed when using data driv...
constexpr double kRefractiveIndexSeaLevel
HadronicInteractionModel
double pow(const double x, const unsigned int i)
double StandardDeviation(const double energy, const double massNumber, const HadronicInteractionModel hadModel)
#define max(a, b)
double CherenkovThreshold(const double nRef)
Calculate the electron Cherenkov threshold energy for refraction index.
double MoliereRadius(double temperature, double pressure, const double cosTheta)
The Moliere Radius (2 radiation length above obs-level, GAP-1998-002)
double SignalUncertaintyFactor(const ESignalVarianceModel model, const double cosTheta)
double LambertW(const double x)
constexpr double fraction
Definition: AugerUnits.h:281
double SaturationVaporPressure(const double temperature)
Evaluate the saturation vapor pressure over ice or water.
double Beta(const double energy)
Calculate the electron energy versus the relativistic beta.
double Sigma(const double energy, const double massNumber, const HadronicInteractionModel hadModel)
double GaisserHillas(const double x, const double x0, const double xMax, const double nMax, const double lambda)
Calculate the Gaisser-Hillas function.
double LorentzLorentz(const double verticalDepth)
Calculate the refraction index for a given depth.
constexpr double kAirDensitySeaLevel
double Mean(const double energy, const double massNumber, const HadronicInteractionModel hadModel)
double GoraPDF(const double rStar, const double age)
double SignalUncertainty(const ESignalVarianceModel model, const double cosTheta, const double signal)
double Ciddor95(const double wl, const double temperature, const double pressure, const double vaporPressure)
Wavelength-dependent index of refraction for humid air.
double ShowerAge(const double slantDepth, const double showerMax)
General definition of shower age.
double TriggerProbability(const bool totdMoPSEnabled, const double lgExpectedSignal, const double sin2Theta)
const double * FitParameters(const ECompositionModel composition)
double PoissonFactor(const double sigmaFactor)
double EnergyDeposit(const double age, const double enCut)
Parametrization for the average energy deposit per particle.
double SignalUncertaintyFactor(const ESignalVarianceModel model, const double cosTheta)
double SignalUncertainty(const ESignalVarianceModel model, const double cosTheta, const double signal)
double GaisserHillasInverse(const double n, const double x0, const double xMax, const double nMax, const double lambda)
double Lambda(const double energy, const double massNumber, const HadronicInteractionModel hadModel)
double EnergyLimits(const double energy)
double FactorVariance(const double eCal, const double eTot)
double Mu(const double energy, const double massNumber, const HadronicInteractionModel hadModel)
bool QuadraticMaximumInterpolation(const std::vector< double > &x, const std::vector< double > &y, double &xMax, double &yMax)
double PoissonFactor(const double sigmaFactor)

, generated on Tue Sep 26 2023.