LDFFinderKG/NKGLDF.h
Go to the documentation of this file.
1 #ifndef _LDFFinderKG_NKGLDF_h_
2 #define _LDFFinderKG_NKGLDF_h_
3 
4 
5 #include "VLDF.h"
6 #include <cmath>
7 #include <vector>
8 #include <utl/Math.h>
9 #include <utl/AugerUnits.h>
10 
11 
12 namespace LDFFinderKG {
13 
14  class NKGLDF : public VLDF {
15 
16  public:
17  NKGLDF(const double refDistance) : VLDF(refDistance, 18, 2) { }
18 
19  protected:
20  NKGLDF(const double refDistance, const unsigned int shapeSize) : VLDF(refDistance, shapeSize, 2) { }
21 
22  const double k700 = 700*utl::meter;
23 
24  public:
25  double
26  Value(const double r, const std::vector<double>& shape)
27  const
28  {
29  const double rRef = fReferenceDistance;
30  const double beta = shape[0];
31  const double gamma = shape[1];
32 
33  return std::pow(r/rRef, beta) *
34  std::pow((r + k700)/(rRef + k700), beta+gamma);
35  }
36 
37  double
38  SecondDerivative(const double r, const std::vector<double>& shape)
39  const
40  {
41  const double beta = shape[0];
42  const double gamma = shape[1];
43 
44  const double tbg = 2*beta + gamma;
45  const double r2 = utl::Sqr(r);
46  return Value(r, shape) * (
47  utl::Sqr(k700)*beta*(beta - 1) +
48  (tbg - 1)*(2*k700*beta*r + tbg*r2)
49  ) / (r2 * utl::Sqr(r+k700));
50  }
51 
52  std::vector<double>
53  ShapeModel(const double cosTheta, const double showerSize)
54  const
55  {
56  std::vector<double> shape(2);
57 
58  double& beta = shape[0];
59  const double lgS = std::log10(showerSize);
60  const double sec = 1 / cosTheta;
61  const double a0 = fShapeModelVector[0];
62  const double a1 = fShapeModelVector[1];
63  const double b0 = fShapeModelVector[2];
64  const double b1 = fShapeModelVector[3];
65  const double c0 = fShapeModelVector[4];
66  const double c1 = fShapeModelVector[5];
67  beta = a0 + a1*lgS + sec*(b0 + b1*lgS + sec*(c0 + c1*lgS));
68 
69  double& gamma = shape[1];
70  const double cos2 = utl::Sqr(cosTheta);
71  const double fo0 = fShapeModelVector[6];
72  const double fo1 = fShapeModelVector[7];
73  const double fa0 = fShapeModelVector[8];
74  const double fa1 = fShapeModelVector[9];
75  const double fp0 = fShapeModelVector[10];
76  const double fp1 = fShapeModelVector[11];
77  const double fs0 = fShapeModelVector[12];
78  const double fs1 = fShapeModelVector[13];
79  const double fb = fShapeModelVector[14];
80  const double fet = fShapeModelVector[15];
81  const double fps = fShapeModelVector[16];
82  const double fss = fShapeModelVector[17];
83  gamma =
84  fo0 + fo1 * lgS +
85  (fa0 + fa1 * lgS) / (std::exp((fs0 + fs1 * lgS) * (cos2 - (fp0 + fp1 * lgS))) + 1) +
86  fb * std::pow(cos2, fet) / (std::exp((lgS - fps) * fss) + 1) -
87  beta; // define as modification of exponent on second term for backwards compatibility
88 
89  return shape;
90  }
91 
92  double
93  BetaUncertainty(const double showerSize)
94  const
95  {
96  const double lgS = std::log10(showerSize);
98  }
99 
100  unsigned int GetNShapeParameters() const { return 2; }
101 
102  };
103 
104 }
105 
106 
107 #endif
constexpr T Sqr(const T &x)
const double fReferenceDistance
std::vector< double > fShapeModelVector
double pow(const double x, const unsigned int i)
NKGLDF(const double refDistance, const unsigned int shapeSize)
virtual double Value(const double r, const std::vector< double > &shape) const =0
virtual double SecondDerivative(const double r, const std::vector< double > &shape) const =0
constexpr double meter
Definition: AugerUnits.h:81
std::vector< double > fBetaUncertaintyModelVector
unsigned int GetNShapeParameters() const
return fBetaUncertaintyModelVector *[0] exp(fBetaUncertaintyModelVector[1]*lgS)
NKGLDF(const double refDistance)
virtual std::vector< double > ShapeModel(const double cosTheta, double showerSize) const =0
virtual double BetaUncertainty(const double showerSize) const =0

, generated on Tue Sep 26 2023.