NKGScintillatorLDF.h
Go to the documentation of this file.
1 #ifndef _ScintillatorLDFFinderKG_NKGScintillatorLDF_h_
2 #define _ScintillatorLDFFinderKG_NKGScintillatorLDF_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 ScintillatorLDFFinderKG {
13 
14  class NKGScintillatorLDF : public VLDF {
15 
16  public:
17  NKGScintillatorLDF(const double refDistance) : VLDF(refDistance, 12, 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 
29  return std::pow(r/rRef, beta) *
30  std::pow((k700 + r)/(rRef + k700), beta+gamma);
31  }
32 
33  double
34  FirstDerivative(const double r, const std::vector<double>& shape)
35  const
36  {
37  const double beta = shape[0];
38  const double gamma = shape[1];
39  const double rRef = fReferenceDistance;
40  const double k700 = 700*utl::meter;
41  return (beta*std::pow(r/rRef,beta-1)
42  * std::pow((r+k700)/(k700+rRef),beta+gamma)/rRef)
43  + (std::pow(r/rRef,beta)*std::pow((r+k700)/(k700+rRef),beta+gamma-1)
44  * (beta + gamma))/(k700+rRef);
45  }
46 
47  double
48  SecondDerivative(const double r, const std::vector<double>& shape)
49  const
50  {
51  const double beta = shape[0];
52  const double gamma = shape[1];
53 
54  const double k700 = 700*utl::meter;
55 
56  const double tbg = 2*beta + gamma;
57  const double r2 = utl::Sqr(r);
58  return Value(r, shape) * (
59  utl::Sqr(k700)*beta*(beta - 1) +
60  (tbg - 1)*(2*k700*beta*r + tbg*r2)
61  ) / (r2 * utl::Sqr(r + k700));
62  }
63 
64  std::vector<double>
65  ShapeModel(const double cosTheta, const double showerSize)
66  const
67  {
68  const double lgSRef = std::log10(showerSize);
69  const double secTheta = 1/cosTheta;
70  const double sec2Theta = utl::Sqr(secTheta);
71 
72  const double a0 = fShapeModelVector[0];
73  const double a1 = fShapeModelVector[1];
74  const double b0 = fShapeModelVector[2];
75  const double b1 = fShapeModelVector[3];
76  const double c0 = fShapeModelVector[4];
77  const double c1 = fShapeModelVector[5];
78 
79  const double d0 = fShapeModelVector[6];
80  const double d1 = fShapeModelVector[7];
81  const double e0 = fShapeModelVector[8];
82  const double e1 = fShapeModelVector[9];
83  const double f0 = fShapeModelVector[10];
84  const double f1 = fShapeModelVector[11];
85 
86  std::vector<double> shape(2);
87  double& beta = shape[0];
88  double& gamma = shape[1];
89 
90  beta =
91  a0 + a1*lgSRef +
92  (b0 + b1*lgSRef) * secTheta +
93  (c0 + c1*lgSRef) * sec2Theta;
94 
95  gamma =
96  d0 + d1*lgSRef +
97  (e0 + e1*lgSRef) * secTheta +
98  (f0 + f1*lgSRef) * sec2Theta - beta;
99 
100  return shape;
101  }
102 
103  double
104  BetaUncertainty(const double showerSize)
105  const
106  {
107  const double lgS = std::log10(showerSize);
109  }
110 
111  unsigned int GetNShapeParameters() const { return 2; }
112 
113  };
114 
115 
116 }
117 
118 
119 #endif
constexpr T Sqr(const T &x)
virtual std::vector< double > ShapeModel(const double cosTheta, double showerSize) const =0
double pow(const double x, const unsigned int i)
virtual double BetaUncertainty(const double showerSize) const =0
constexpr double meter
Definition: AugerUnits.h:81
virtual double FirstDerivative(const double r, const std::vector< double > &shape) const =0
std::vector< double > fBetaUncertaintyModelVector
virtual double Value(const double r, const std::vector< double > &shape) const =0
return fBetaUncertaintyModelVector *[0] exp(fBetaUncertaintyModelVector[1]*lgS)
virtual double SecondDerivative(const double r, const std::vector< double > &shape) const =0

, generated on Tue Sep 26 2023.