ExpSqrtPolyLDF.h
Go to the documentation of this file.
1 #ifndef _LDFFinderKG_ExpSqrtPolyLDF_h_
2 #define _LDFFinderKG_ExpSqrtPolyLDF_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 ExpSqrtPolyLDF : public VLDF {
15 
16  public:
17  ExpSqrtPolyLDF(const double refDistance) : VLDF(refDistance, 0, 2) { }
18 
19  double
20  Value(const double r, const std::vector<double>& shape)
21  const
22  {
23  const double z = std::sqrt(r);
25  const double alpha = shape[0];
26  const double beta = shape[1];
27  const double gamma = shape[2];
28  const double delta = shape[3];
29 
30  // z0 is to make f(rRef) = 1
31  const double z0 = -zRef*(alpha + zRef*(beta + zRef*(gamma + zRef*delta)));
32  return std::exp(z0 + z*(alpha + z*(beta + z*(gamma + z*delta))));
33  }
34 
35  double
36  SecondDerivative(const double r, const std::vector<double>& shape)
37  const
38  {
39  const double z = std::sqrt(r);
40  const double alpha = shape[0];
41  const double beta = shape[1];
42  const double gamma = shape[2];
43  const double delta = shape[3];
44 
45  const double f = Value(r, shape);
46  const double g = z*(0.5*alpha + z*(beta + z*(1.5*gamma + z*2*delta))) / r;
47  const double dfdr = f * g;
48  const double dgdr = z*(-0.25*alpha + z*z*(0.75*gamma + z*2*delta)) / (r*r);
49  return dfdr*g + f*dgdr;
50  }
51 
52  std::vector<double>
53  ShapeModel(const double /* cosTheta */, const double /* showerSize */)
54  const
55  {
56  // not implemented yet
57  return std::vector<double>(4);
58  }
59 
60  double
61  BetaUncertainty(const double /* showerSize */)
62  const
63  {
64  // not implemented yet
65  return 0;
66  }
67 
68  unsigned int GetNShapeParameters() const { return 4; }
69 
70  };
71 
72 }
73 
74 
75 #endif
unsigned int GetNShapeParameters() const
ExpSqrtPolyLDF(const double refDistance)
return dfdr *g f * dgdr
const double fReferenceDistance
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
virtual std::vector< double > ShapeModel(const double cosTheta, double showerSize) const =0
virtual double BetaUncertainty(const double showerSize) const =0
return std::exp(z0+z *(alpha+z *(beta+z *(gamma+z *delta))))

, generated on Tue Sep 26 2023.