ZombieGraveyard/LDFFinderOG/LDFFinder.h
Go to the documentation of this file.
1 
11 #ifndef _LDFFinderOG_LDFFinder_h_
12 #define _LDFFinderOG_LDFFinder_h_
13 
14 #include <fwk/VModule.h>
15 #include <utl/Point.h>
16 #include <utl/Vector.h>
17 #include <utl/TimeStamp.h>
18 #include "EnergyConversion.h"
19 #include "LDFFunctions.h"
20 
21 namespace utl {
22  class RandomEngine;
23 }
24 
25 namespace evt {
26  class Event;
27 }
28 
29 namespace sevt {
30  class SEvent;
31 }
32 
33 
34 namespace LDFFinderOG {
35 
62  class LDFFinder : public fwk::VModule {
63  public:
67 
68  struct LDFFitInterface {
69 
71 
72  double fS1000;
73  double fS1000Err;
76  double fErrMatrix[5][5];
78  double fBeta;
79  double fBetaErr;
81  double fGamma;
82  double fGammaErr;
83  double fEnergy;
84  double fEnergyErr;
85  double fChi2;
86  double fNdof;
87  double fLikelihood;
88  double fRecStage;
90  double fMaxChi2;
91  };
92 
94 
96 
98  bool fFixedAxis;
101  double fSigmaU2;
102  double fSigmaV2;
103  double fSigmaUV;
104  bool fFixedRc;
105  double fRc;
106  double fRcErr;
107  double fct0;
108  double fct0Err;
109  };
110 
111  private:
112  // LDF part
113 
114  void EstimateS1000(LDFFitInterface& fi) const;
115  void EstimateEnergy(LDFFitInterface& fi) const;
116  double ParameterizedRc(const LDFFitInterface& fi) const;
117  double EstimateChi2(const LDFFitInterface& fi) const;
118  double EstimateNStationsInFit(const LDFFitInterface& fi) const;
119  void EstimateLDF(LDFFitInterface& fi, const utl::Point& core) const;
121  const utl::Point& core) const;
122  bool FixBeta(const LDFFitInterface& fi) const;
123  bool FixGamma(const LDFFitInterface& fi) const;
124  bool FitLDF(LDFFitInterface& fi, const int nStations) const;
125  double FitLDFDriver(LDFFitInterface& fi) const;
126  static void LDFFitMaxLikeFnc(int& nPar, double* const grad, double& value,
127  double* const par, const int iFlag);
128  static void LDFFitChi2Fnc(int& nPar, double* const grad, double& value,
129  double* const par, const int iFlag);
130 
131  // Curvature part
133  double FitCurvatureDriver(CurvatureFitInterface& fi) const;
134  static void CurvatureFitFnc(int& nPar, double* const grad, double& value,
135  double* const par, const int iFlag);
136 
137  void SetRecData(evt::Event& event, const LDFFitInterface& lfi,
138  const CurvatureFitInterface& cfi) const;
139  void OutputStations(const LDFFitInterface& fi) const;
140  void OutputResults(const evt::Event& event) const;
141 
142  bool FixCore(const evt::Event& event, Point& core,
143  TimeStamp& coreTime, Vector& axis) const;
144 
145  // vars
151  static bool fgUseSilentStations;
152  static double fgSilentMaxRadius;
154  static double fgSilentSignalThreshold;
155  static bool fgFixLDF;
156  static double fgNoRecovery;
157  static bool fgLowerLimit;
158  static double fgNKGFermiMu;
159  static double fgNKGFermiTau;
160 
164  double fMaxTheta;
166  double fMaxChi2;
170 
171  int fRoptN;
173  struct Stage0 {
176  } fStage0;
177 
178  struct Stage1 {
180  double fMaxChi2;
181  } fStage1;
182 
183  struct Stage2 {
186  } fStage2;
187 
188  struct Stage3 {
192  } fStage3;
193 
195 
196  enum InfoLevel {
197  eNone = 0,
198  eFinal = 1,
200  eObscure = 3,
202  };
203 
204 
205  public:
207 
208  enum CoreType {
212  };
213 
214  REGISTER_MODULE("LDFFinderOG", LDFFinder);
215 
216  };
217 
218 } // LDFFinderOG
219 
220 
221 #endif // _LDFFinderOG_LDFFinder_h_
222 
223 // Configure (x)emacs for this file ...
224 // Local Variables:
225 // mode: c++
226 // End:
Point object.
Definition: Point.h:32
bool FixGamma(const LDFFitInterface &fi) const
Interface class to access to the SD part of an event.
Definition: SEvent.h:39
double ParameterizedRc(const LDFFitInterface &fi) const
double FitCurvatureDriver(CurvatureFitInterface &fi) const
bool EstimateCurvature(CurvatureFitInterface &fi) const
struct LDFFinderOG::LDFFinder::Stage3 fStage3
static const sevt::SEvent * fgCurrentSEvent
bool FixBeta(const LDFFitInterface &fi) const
REGISTER_MODULE("LDFFinderOG", LDFFinder)
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
void EstimateLDFbySeedStations(LDFFitInterface &fi, const utl::Point &core) const
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
struct LDFFinderOG::LDFFinder::Stage1 fStage1
struct LDFFinderOG::LDFFinder::Stage0 fStage0
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
void EstimateEnergy(LDFFitInterface &fi) const
void EstimateLDF(LDFFitInterface &fi, const utl::Point &core) const
void OutputStations(const LDFFitInterface &fi) const
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
Wraps the random number engine used to generate distributions.
Definition: RandomEngine.h:27
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
Module interface.
Definition: VModule.h:53
bool FitLDF(LDFFitInterface &fi, const int nStations) const
static utl::CoordinateSystemPtr fgLocalCS
static void CurvatureFitFnc(int &nPar, double *const grad, double &value, double *const par, const int iFlag)
void SetRecData(evt::Event &event, const LDFFitInterface &lfi, const CurvatureFitInterface &cfi) const
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
double EstimateChi2(const LDFFitInterface &fi) const
Estimate Chi2 using Minuit.
static void LDFFitMaxLikeFnc(int &nPar, double *const grad, double &value, double *const par, const int iFlag)
Likelihood function to minimize.
Vector object.
Definition: Vector.h:30
bool FixCore(const evt::Event &event, Point &core, TimeStamp &coreTime, Vector &axis) const
const int nPar
Definition: GeomAsym.h:37
void EstimateS1000(LDFFitInterface &fi) const
First guess of S1000 to give a starting point.
struct LDFFinderOG::LDFFinder::Stage2 fStage2
static void LDFFitChi2Fnc(int &nPar, double *const grad, double &value, double *const par, const int iFlag)
double FitLDFDriver(LDFFitInterface &fi) const
Fit using Minuit.
void OutputResults(const evt::Event &event) const
double EstimateNStationsInFit(const LDFFitInterface &fi) const

, generated on Tue Sep 26 2023.