NKGASLDF.h
Go to the documentation of this file.
1 #ifndef _LDFFinderKG_NKGASLDF_h_
2 #define _LDFFinderKG_NKGASLDF_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 NKGASLDF : public VLDF {
15 
16  const double k700 = 700*utl::meter;
17 
18  public:
19  NKGASLDF(const double refDistance) : VLDF(refDistance, 12, 2) { }
20 
21  double
22  Value(const double r, const std::vector<double>& shape)
23  const
24  {
25  const double rRef = fReferenceDistance;
26  const double beta = shape[0];
27  const double gamma = shape[1];
28 
29  return std::pow(r/rRef, beta) *
30  std::pow((k700 + r)/(rRef + k700), beta+gamma);
31  }
32 
33  double
34  SecondDerivative(const double r, const std::vector<double>& shape)
35  const
36  {
37  const double beta = shape[0];
38  const double gamma = shape[1];
39 
40  const double tbg = 2*beta + gamma;
41  const double r2 = utl::Sqr(r);
42  return Value(r, shape) * (
43  utl::Sqr(k700)*beta*(beta - 1) +
44  (tbg - 1)*(2*k700*beta*r + tbg*r2)
45  ) / (r2 * utl::Sqr(r + k700));
46  }
47 
48  std::vector<double>
49  ShapeModel(const double cosTheta, const double showerSize)
50  const
51  {
52  const double lgSRef = std::log10(showerSize);
53  const double secTheta = 1/cosTheta;
54 
55  const double a0 = fShapeModelVector[0];
56  const double a1 = fShapeModelVector[1];
57  const double b0 = fShapeModelVector[2];
58  const double b1 = fShapeModelVector[3];
59  const double c0 = fShapeModelVector[4];
60  const double c1 = fShapeModelVector[5];
61 
62  const double d0 = fShapeModelVector[6];
63  const double d1 = fShapeModelVector[7];
64  const double e0 = fShapeModelVector[8];
65  const double e1 = fShapeModelVector[9];
66  const double f0 = fShapeModelVector[10];
67  const double f1 = fShapeModelVector[11];
68 
69  std::vector<double> shape(2);
70  double& beta = shape[0];
71  double& gamma = shape[1];
72 
73  beta = a0 + a1*lgSRef + secTheta*(b0 + b1*lgSRef + secTheta*(c0 + c1*lgSRef));
74 
75  gamma = d0 + d1*lgSRef + secTheta*(e0 + e1*lgSRef + secTheta*(f0 + f1*lgSRef));
76  return shape;
77  }
78 
79  double
80  BetaUncertainty(const double showerSize)
81  const
82  {
83  const double lgS = std::log10(showerSize);
85  }
86 
87  unsigned int GetNShapeParameters() const { return 2; }
88 
89  };
90 
91 }
92 
93 
94 #endif
const double d0
Definition: NKGASLDF.h:62
const double c0
Definition: NKGASLDF.h:59
constexpr T Sqr(const T &x)
const double e0
Definition: NKGASLDF.h:64
const double fReferenceDistance
std::vector< double > fShapeModelVector
const double r2
Definition: NKGASLDF.h:41
const double a0
Definition: NKGASLDF.h:55
const double gamma
Definition: NKGASLDF.h:27
double pow(const double x, const unsigned int i)
const double b1
Definition: NKGASLDF.h:58
const double c1
Definition: NKGASLDF.h:60
virtual double Value(const double r, const std::vector< double > &shape) const =0
const double e1
Definition: NKGASLDF.h:65
virtual double SecondDerivative(const double r, const std::vector< double > &shape) const =0
constexpr double meter
Definition: AugerUnits.h:81
const double tbg
Definition: NKGASLDF.h:40
std::vector< double > fBetaUncertaintyModelVector
const double f0
Definition: NKGASLDF.h:66
const double b0
Definition: NKGASLDF.h:57
NKGASLDF(const double refDistance)
Definition: NKGASLDF.h:19
const double d1
Definition: NKGASLDF.h:63
const double secTheta
Definition: NKGASLDF.h:53
const double f1
Definition: NKGASLDF.h:67
return fBetaUncertaintyModelVector *[0] exp(fBetaUncertaintyModelVector[1]*lgS)
virtual std::vector< double > ShapeModel(const double cosTheta, double showerSize) const =0
const double beta
Definition: NKGASLDF.h:26
const double a1
Definition: NKGASLDF.h:56
const double k700
Definition: NKGASLDF.h:16
unsigned int GetNShapeParameters() const
Definition: NKGASLDF.h:87
virtual double BetaUncertainty(const double showerSize) const =0

, generated on Tue Sep 26 2023.