RdGeoCeLDFFitter/LikelihoodFunction.h
Go to the documentation of this file.
1 #ifndef _RdGeoCeLDFFitter_LikelihoodFunction_h_
2 #define _RdGeoCeLDFFitter_LikelihoodFunction_h_
3 
4 #include <iostream>
5 #include <cmath>
6 #include <vector>
7 #include <limits>
8 
9 #include <Minuit2/FCNBase.h>
10 
11 #include <utl/CoordinateSystemPtr.h>
12 #include <utl/Vector.h>
13 #include <utl/Point.h>
14 #include <utl/Math.h>
15 #include <utl/PhysicalFunctions.h>
16 
17 
18 namespace RdGeoCeLDFFitter {
19 
20  double getAtmosphere(double h);
21  double getDensity(double h);
22  double getVerticalHeight(double at);
23 
24  struct FitConfig {
26  bool fitCore;
27 
30  fitCore(true)
31  {
32  }
33  };
34 
35  struct StationFitData {
36  double x;
37  double y;
38  double f;
39  double ferror;
40  double f_vB;
41  double ferror_vB;
42  double f_vvB;
43  double ferror_vvB;
44  double distance;
45  bool hasSignal;
46 
48  x(0),
49  y(0),
50  f(0),
51  ferror(0),
52  f_vB(0),
53  ferror_vB(0),
54  f_vvB(0),
55  ferror_vvB(0),
56  distance(0),
57  hasSignal(false)
58  {
59  }
60  };
61 
62  struct EventFitData {
65  double sinalpha;
66  double zenith;
67 
69  fShowerAxis(),
70  fLocalCS(),
71  sinalpha(1),
72  zenith(0)
73  {
74  }
75 
76  };
77 
78  class LDFLikelihoodFunction : public ROOT::Minuit2::FCNBase {
79 
80  public:
81  LDFLikelihoodFunction(const FitConfig ldfconfig, const EventFitData eventData,
82  const std::vector<StationFitData>& stationData);
83 
84  double operator()(const std::vector<double>& pars) const override;
85 
86  double GetChi2FullEnergyFluence(const std::vector<double>& pars) const;
87 
88  double Up() const override
89  {
90  return fTheErrorDef; // needs to be one because the neg. log. likelihood is defined as -2*log(Likelihood)
91  }
92 
93  void SetErrorDef(double def) override
94  {
95  fTheErrorDef = def;
96  }
97 
98  protected:
99 
100  private:
101  double GetChi2LDFModel1(const double x, const double y, const double Erad, const double dxmax,
102  const double coreX, const double coreY, const double f_vB,
103  const double ferror_vB, const double f_vvB, const double ferror_vvB,
104  const double zenith, const double sinalpha) const;
105 
106 
107 
109 
111  const std::vector<StationFitData>& fStationData;
112 
114 
115  double fTheErrorDef;
116  };
117 
118 }
119 
120 #endif
LDFLikelihoodFunction(const FitConfig ldfconfig, const EventFitData eventData, const std::vector< StationFitData > &stationData)
double GetChi2FullEnergyFluence(const std::vector< double > &pars) const
double GetChi2LDFModel1(const double x, const double y, const double Erad, const double dxmax, const double coreX, const double coreY, const double f_vB, const double ferror_vB, const double f_vvB, const double ferror_vvB, const double zenith, const double sinalpha) const
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
double operator()(const std::vector< double > &pars) const override
Vector object.
Definition: Vector.h:30

, generated on Tue Sep 26 2023.