RdLDFFitter.h
Go to the documentation of this file.
1 #ifndef _RdLDFFitter_h_
2 #define _RdLDFFitter_h_
3 
4 #include <fwk/VModule.h>
5 #include <rdet/RDetector.h>
6 #include <revt/REvent.h>
7 #include <utl/CoordinateSystemPtr.h>
8 #include "LikelihoodFunction.h"
9 #include "Minuit2/MnUserCovariance.h"
10 
11 namespace evt {
12  class Event;
13 }
14 
15 namespace revt {
16  class Station;
17 }
18 
19 namespace utl {
20  class AnalyticFilter;
21 }
22 
23 // you should assign your module to a namespace
24 
25 namespace RdLDFFitter {
26 
28  double A;
29  double AError;
30  double R0;
31  double R0Error;
32 
34  A(0), AError(0), R0(0), R0Error(0)
35  {
36  }
37  };
38 
40  int status;
41  double N_e;
42  double N_eError;
43  double Rm;
44  double RmError;
46  status(0), N_e(0), N_eError(0), Rm(0), RmError(0)
47  {
48  }
49  };
50 
51  enum InfoLevel {
52  eNone = 0, eFinal = 1, eIntermediate = 2, eObscure = 3, eDebug = 4
53  };
54  enum ScanCenter {
55  eRadio = 0, eSD = 1, eFD = 2, eMC = 3
56  };
57 
67  class RdLDFFitter: public fwk::VModule {
68 
69  public:
70  // If you define a constructor, you MUST provide an implementation
71  // for it, otherwise the REGISTER_MODULE macro will not register
72  // your module. (Here, implementation is in RdLDFFitter.cc)
73  RdLDFFitter();
74  virtual ~RdLDFFitter();
75 
79 
80  private:
81 
82  ParameterLDFModel PreLDFFit(int LDFModel, const std::vector<StationFitData>& vStationFitData,
83  utl::Vector ShowerAxis, utl::Point CorePosition);
84 
85  ParameterScintillatorLDFModel PreScintillatorLDFFit(const std::vector<ScintillatorFitData>& vScintillatorData,
86  utl::Vector ShowerAxis, utl::Point CorePosition);
87 
88 
89 
90  fwk::VModule::ResultFlag SaveContours(unsigned int runNumber, const int eventId,
91  const std::vector<std::pair<double, double> > contour,
92  const std::vector<std::pair<double, double> > contour2, ROOT::Minuit2::MnUserCovariance cov,
93  const double coreX, const double coreY);
94 
95  utl::Point Scan(std::vector< std::vector<double> >& scanResult,
96  const LDFLikelihoodFunction L,
97  const utl::Point core,
98  const unsigned int nStepsX, const unsigned int nStepsY,
99  const double widthX, const double widthY, const double a);
100 
101  utl::Point Scan(std::vector< std::vector<double> >& scanResult,
102  const LDFLikelihoodFunction L,
103  const utl::Point core,
104  const unsigned int nSteps,
105  const double width, const double a) {
106  return Scan(scanResult, L, core, nSteps, nSteps, width, width, a);
107  }
108 
109  fwk::VModule::ResultFlag SaveScan(const std::vector< std::vector<double> >& scanResult,
110  const std::string filename,
111  const double coreX, const double coreY,
112  const unsigned int nStepsX, const unsigned int nStepsY,
113  const double widthX, const double widthY);
114  fwk::VModule::ResultFlag PlotScan(const std::vector<std::vector<double> >& scanResult,
115  const std::string filename,
116  const utl::Point scanCenter, const utl::CoordinateSystemPtr cs,
117  const utl::Point coreSd, const utl::Point coreRd,
118  const unsigned int nStepsX, const unsigned int nStepsY,
119  const double widthX, const double widthY,
120  const std::vector<StationFitData>& vStationFitData,
121  const EventFitData& eventFitData, const double a);
122 
123  std::vector<std::pair<double, double> > GetAnglesToLorentzVector();
124 
125  std::vector<std::pair<double, double> > GetAnglesToEFieldExpectation(const utl::Point core, const double a);
126 
127  fwk::VModule::ResultFlag PlotGoodnessOfFit(const std::string folder,
128  const std::string eventIdentifier,
129  const utl::Point core);
130 
131  double GetEnergy(const double energy_estimator);
132 
133  // The REGISTER_MODULE macro makes the framework aware of your module.
134  // You need to put this macro at the very end of your module class definition.
135  // Give your module a name (first argument) and specify its
136  // class name (second argument). In the ModuleSequenceExample.xml file,
137  // you can see this module being refered to by the name we give it here.
138 
140 
142 
144 
145  bool fSaveContour; // if true the 68% and 95% confidence contours are calculated using MnContour (MINOS) (Warning: this procedure needs a lot of computing resrouces)
146  bool fPerformScan; // perform a "time consuming" scan of the Likelihood function
147  bool fPlotSigmaContours; // if true the color scale in the TH2D is adjusted to correspond with the "sigma" regions
148  unsigned int fNStepsX, fNStepsY; // number of steps in x/y direction
149  double fStepWidthX, fStepWidthY; // step width
150  ScanCenter fScanCenter; // center of scan, can be e.g. SD core position
151  double fMCUncertaintyOnEFieldVector; // the measured efield vector is artificially smeared according to a Fisher-Distribution
152 
153  const short fPlotStyle; // 0 = Release, 1 = Debug
154 
160 
161  std::string fOutputFolder;
162 
163 
164  REGISTER_MODULE("RdLDFFitter", RdLDFFitter);
165 
166  };
167 
168 }
169 
170 #endif
171 
172 // Configure (x)emacs for this file ...
173 // Local Variables:
174 // mode:c++
175 // compile-command: "make -k"
176 // End:
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
Definition: RdLDFFitter.cc:652
Point object.
Definition: Point.h:32
ParameterScintillatorLDFModel PreScintillatorLDFFit(const std::vector< ScintillatorFitData > &vScintillatorData, utl::Vector ShowerAxis, utl::Point CorePosition)
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
fwk::VModule::ResultFlag PlotScan(const std::vector< std::vector< double > > &scanResult, const std::string filename, const utl::Point scanCenter, const utl::CoordinateSystemPtr cs, const utl::Point coreSd, const utl::Point coreRd, const unsigned int nStepsX, const unsigned int nStepsY, const double widthX, const double widthY, const std::vector< StationFitData > &vStationFitData, const EventFitData &eventFitData, const double a)
Definition: RdLDFFitter.cc:734
std::vector< std::pair< double, double > > GetAnglesToEFieldExpectation(const utl::Point core, const double a)
fwk::VModule::ResultFlag SaveScan(const std::vector< std::vector< double > > &scanResult, const std::string filename, const double coreX, const double coreY, const unsigned int nStepsX, const unsigned int nStepsY, const double widthX, const double widthY)
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
Definition: RdLDFFitter.cc:107
double GetEnergy(const double energy_estimator)
fwk::VModule::ResultFlag PlotGoodnessOfFit(const std::string folder, const std::string eventIdentifier, const utl::Point core)
reconstructs the core position and LDF
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
utl::Point Scan(std::vector< std::vector< double > > &scanResult, const LDFLikelihoodFunction L, const utl::Point core, const unsigned int nSteps, const double width, const double a)
Definition: RdLDFFitter.h:101
REGISTER_MODULE("RdLDFFitter", RdLDFFitter)
utl::Point Scan(std::vector< std::vector< double > > &scanResult, const LDFLikelihoodFunction L, const utl::Point core, const unsigned int nStepsX, const unsigned int nStepsY, const double widthX, const double widthY, const double a)
nSteps is considered to be odd. If it is even, nSteps will be increased by 1 to be odd...
Definition: RdLDFFitter.cc:665
Module interface.
Definition: VModule.h:53
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
Definition: RdLDFFitter.cc:160
fwk::VModule::ResultFlag SaveContours(unsigned int runNumber, const int eventId, const std::vector< std::pair< double, double > > contour, const std::vector< std::pair< double, double > > contour2, ROOT::Minuit2::MnUserCovariance cov, const double coreX, const double coreY)
const revt::REvent * fREvent
Definition: RdLDFFitter.h:155
std::vector< std::pair< double, double > > GetAnglesToLorentzVector()
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
utl::CoordinateSystemPtr fLocalCS
Definition: RdLDFFitter.h:143
ParameterLDFModel PreLDFFit(int LDFModel, const std::vector< StationFitData > &vStationFitData, utl::Vector ShowerAxis, utl::Point CorePosition)
Vector object.
Definition: Vector.h:30
char * filename
Definition: dump1090.h:266
utl::Vector fMagneticFieldAxis
Definition: RdLDFFitter.h:159
const evt::Event * fConstEvent
Definition: RdLDFFitter.h:156
Definition: XbArray.h:7

, generated on Tue Sep 26 2023.