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

, generated on Tue Sep 26 2023.