Deprecated/RdLDFFitter/LikelihoodFunction.h
Go to the documentation of this file.
1 #ifndef _RdLDFFitter_LikelihoodFunctions_h_
2 #define _RdLDFFitter_LikelihoodFunctions_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 namespace RdLDFFitter {
18 
19  struct FitConfig {
20  int LDFModel;
22  bool useSDCoreToImproveRadioCore; // Likelihood of SD core position will be added to combined Likelihood
23  bool useChargeExcessCorrectionInLDFFit; // signal strength will be corrected for charge excess contribution in LDF fit
24  bool usePolarisation; // polarization of radio signal will be used to estimate core position (polarization Likelihood will be added to combined Likelihood)
25  double chargeExcessStrength; // value of the charge excess strength relative to geo-magnetic strength for sin(alpha) = 1
26  bool fitChargeExcess; // treat charge excess strength as free fit parameters?
27  bool useScintillator; // use scintiallator signals to fit a particle LDF
28 
30  LDFModel(1),
34  usePolarisation(true),
36  fitChargeExcess(false),
37  useScintillator(false)
38  {
39  }
40  };
41 
42  struct StationFitData {
44  double signal;
45  double signalError;
48 
51  {
52  }
53  };
54 
57  double signal;
58  bool silent;
59 
61  scintillatorPosition(), signal(0.), silent(false)
62  {
63  }
64  };
65 
66  struct EventFitData {
69 
70  utl::Point SDCore; // the SD core only needs to be specified if the useSDCoreToImproveRadioCore flag is set true
71  double SDCoreXError;
72  double SDCoreYError;
74 
77  {
78  }
79 
80  };
81 
82  class LDFLikelihoodFunction: public ROOT::Minuit2::FCNBase {
83 
84  public:
85  LDFLikelihoodFunction(const FitConfig ldfconfig, const EventFitData eventData,
86  const std::vector<StationFitData>& stationData,
87  const std::vector<ScintillatorFitData>& scintillatorData,
88  const utl::Vector magneticFieldVector);
89 
90  double operator()(const std::vector<double>& pars) const;
91 
92  double Up() const
93  {
94  return fTheErrorDef; // needs to be one because the neg. log. likelihood is defined as -2*log(Likelihood)
95  }
96 
97  void SetErrorDef(double def) {
98  fTheErrorDef = def;
99  }
100 
101  protected:
102 
103  private:
104  double GetChi2LDFModel1(const double A, const double R0, const utl::Point& core,
105  const utl::Point& stationPosition, const utl::Vector& showeraxis, const double signal,
106  const double signalError) const;
107 
108  double GetLikelihoodPolarisation(const utl::Point& core, const utl::Vector& showeraxis,
109  const utl::Point& stationPosition, const utl::Vector& EField,
110  const double& lorentzAngleError, const double& chargeExcessStrength) const;
111 
112  double GetSDCoreLikelihood(const double coreX, const double coreY, const double SDCoreX,
113  const double SDCoreY, const double SDCoreXError, const double SDCoreYError,
114  const double SDCoreXYCorrelation) const;
115 
116  double GetScintillatorLDFLikelihood(const utl::Point& core,
117  const utl::Vector& showeraxis,
118  const utl::Point& stationPosition,
119  const double N_charged_particles,
120  const double showerAge,
121  const double moliereRadius,
122  const double signal,
123  const bool silent) const;
124 
126 
128  const std::vector<StationFitData>& fStationData;
129  const std::vector<ScintillatorFitData>& fScintillatorData;
130 
132 
133  double fTheErrorDef;
134  };
135 
136 }
137 
138 #endif
Point object.
Definition: Point.h:32
double GetChi2LDFModel1(const double A, const double R0, const utl::Point &core, const utl::Point &stationPosition, const utl::Vector &showeraxis, const double signal, const double signalError) const
const std::vector< ScintillatorFitData > & fScintillatorData
double operator()(const std::vector< double > &pars) const
double GetSDCoreLikelihood(const double coreX, const double coreY, const double SDCoreX, const double SDCoreY, const double SDCoreXError, const double SDCoreYError, const double SDCoreXYCorrelation) const
reconstructs the core position and LDF
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
double GetLikelihoodPolarisation(const utl::Point &core, const utl::Vector &showeraxis, const utl::Point &stationPosition, const utl::Vector &EField, const double &lorentzAngleError, const double &chargeExcessStrength) const
LDFLikelihoodFunction(const FitConfig ldfconfig, const EventFitData eventData, const std::vector< StationFitData > &stationData, const std::vector< ScintillatorFitData > &scintillatorData, const utl::Vector magneticFieldVector)
double GetScintillatorLDFLikelihood(const utl::Point &core, const utl::Vector &showeraxis, const utl::Point &stationPosition, const double N_charged_particles, const double showerAge, const double moliereRadius, const double signal, const bool silent) const
Vector object.
Definition: Vector.h:30

, generated on Tue Sep 26 2023.