RdWaveFit.h
Go to the documentation of this file.
1 #ifndef _RdWaveFit_h_
2 #define _RdWaveFit_h_
3 
4 #include <fwk/VModule.h>
5 #include <revt/Channel.h>
6 #include <revt/REvent.h>
7 #include <utl/Vector.h>
8 #include <utl/Point.h>
9 #include <utl/TimeStamp.h>
10 #include <utl/CoordinateSystem.h>
11 #include <utl/GeometryUtilities.h>
12 #include "Chi2ForPlaneWaveFit.h"
15 #include "Chi2ForConicalWaveFit.h"
16 
17 /*namespace evt {
18  class Event;
19  }*/
20 
21 namespace revt {
22  class REvent;
23 }
24 
25 // you should assign your module to a namespace
26 
27 namespace RdWaveFit {
28 
37  struct FitParameters {
38 
39  // !!! all angles in rad !!!
40  double theta;
41  double thetaError;
42  double phi;
43  double phiError;
44  double r; // Radius of a spherical wave fit
45  double rError;
46  double rho; // angle for conical wave fit
47  double rhoError;
48 
49  double c00;
50  double c11;
51  double c22;
52  double c01;
53  double c02;
54  double c12;
55 
56  double gamma; // gamma = c/c_0
57  double gammaError;
58 
59  double chiSquareNDF;
60  int status;
61  int nCalls;
62  double minChi;
63  int NDF;
64  bool corrected;
65  int nStations;
66  double recStage; // RecStage defined in trunk/Framework/Shower/ShowerRRecData.cc
67 
68  // type defines which minimization mode is used: 0=migrad, 1=simplex, 2=combined, 3=scan
69  // see Minuit2 Documentation for further information
70  int type;
72  theta(0),
73  thetaError(0),
74  phi(0),
75  phiError(0),
76  r(0),
77  rError(0),
78  rho(0),
79  rhoError(0),
80  c00(0),
81  c11(0),
82  c22(0),
83  c01(0),
84  c02(0),
85  c12(0),
86  gamma(0),
87  gammaError(0),
88  chiSquareNDF(0),
89  status(0),
90  nCalls(0),
91  minChi(0),
92  NDF(0),
93  corrected(0),
94  nStations(0),
95  recStage(0),
96  type(0)
97 
98  {
99  }
100  };
101 
102  class RdWaveFit: public fwk::VModule {
103 
104  public:
105  // If you define a constructor, you MUST provide an implementation
106  // for it, otherwise the REGISTER_MODULE macro will not register
107  // your module. (Here, implementation is in RdWaveFit.cc)
108  RdWaveFit();
109  //virtual ~RdWaveFit();
110 
114 
115  private:
120  fwk::VModule::ResultFlag PlaneWaveFit(revt::REvent& rEvent, FitParameters& fit, int type) const;
121 
127 
133 
138  fwk::VModule::ResultFlag ConicalWaveFit(revt::REvent& rEvent, FitParameters& fit, int type) const;
139 
144  fwk::VModule::ResultFlag ScanPWF(revt::REvent& rEvent, FitParameters& sFitResults) const;
145 
151  fwk::VModule::ResultFlag ScanSWF(revt::REvent& rEvent, FitParameters& sFitResults) const;
152 
158  fwk::VModule::ResultFlag ScanSWFVarC(revt::REvent& rEvent, FitParameters& sFitResults) const;
159 
165  fwk::VModule::ResultFlag ScanCWF(revt::REvent& rEvent, FitParameters& sFitResults) const;
166 
172  bool reuseFit = false) const;
173 
179  bool reuseFit = false);
180 
186  fwk::VModule::ResultFlag CallSphericalWaveFitVarC(revt::REvent& rEvent, FitParameters& sFitResults, bool reuseFit =
187  false);
188 
189  // ############################ Conical Wave Fit ###############################
193  fwk::VModule::ResultFlag CallConicalWaveFit(revt::REvent& rEvent, FitParameters& sFitResults, bool reuseFit = false);
194  // ########################### Conical Wave Fit End ############################
195 
197 
198  const std::vector<double> GetTimeResiduals(const std::vector<utl::Vector> &AntennaPositions,
199  const std::vector<double> &AntennaTimes, const utl::Vector& ShowerAxis,
200  const unsigned int waveFrontModel, const double gamma = 1, const double rho = 0) const;
201 
203 
204  enum InfoLevel {
205  eNone = 0, eFinal = 1, eIntermediate = 2, eObscure = 3, eMinuit = 4
206  };
207 
210  };
211 
212  // xml settings
217  int fFitType;
218  double fThetaMax;
219  double fRMax;
220  double fRhoMax; // for conical fit
224  unsigned int fWaveFrontModel;
225  unsigned int currentWaveFrontModel; // adjusts WaveFrontModel if number of stations is not sufficient
226 
227  //VarC Specific
230  double fSigmaGamma;
231  double fPenaltyTerm;
232  double fThetaVarC;
233 
235 
238  // minuit globals
241 
246 
247  std::string fUsedDirection;
248  std::string fUsedCorePosition;
249 
250  // The REGISTER_MODULE macro makes the framework aware of your module.
251  // You need to put this macro at the very end of your module class definition.
252  // Give your module a name (first argument) and specify its
253  // class name (second argument). In the ModuleSequenceExample.xml file,
254  // you can see this module being refered to by the name we give it here.
255 
256  REGISTER_MODULE("RdWaveFit", RdWaveFit);
257 
258  };
259 
260 }
261 
262 #endif
263 
264 // Configure (x)emacs for this file ...
265 // Local Variables:
266 // mode:c++
267 // compile-command: "make -k"
268 // End:
unsigned int fWaveFrontModel
Definition: RdWaveFit.h:224
fwk::VModule::ResultFlag CallSphericalWaveFitVarC(revt::REvent &rEvent, FitParameters &sFitResults, bool reuseFit=false)
Definition: RdWaveFit.cc:1320
Point object.
Definition: Point.h:32
fwk::VModule::ResultFlag CallConicalWaveFit(revt::REvent &rEvent, FitParameters &sFitResults, bool reuseFit=false)
Definition: RdWaveFit.cc:1373
fwk::VModule::ResultFlag PlaneWaveFit(revt::REvent &rEvent, FitParameters &fit, int type) const
Definition: RdWaveFit.cc:505
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
Definition: RdWaveFit.cc:493
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
fwk::VModule::ResultFlag ScanSWFVarC(revt::REvent &rEvent, FitParameters &sFitResults) const
Definition: RdWaveFit.cc:1140
fwk::VModule::ResultFlag SphericalWaveFit(revt::REvent &rEvent, FitParameters &fit, int type) const
Definition: RdWaveFit.cc:615
bool fAllowUnphysicalCosines
Definition: RdWaveFit.h:216
Objective function for the spherical wave fit.
const std::vector< double > GetTimeResiduals(const std::vector< utl::Vector > &AntennaPositions, const std::vector< double > &AntennaTimes, const utl::Vector &ShowerAxis, const unsigned int waveFrontModel, const double gamma=1, const double rho=0) const
Definition: RdWaveFit.cc:1414
fwk::VModule::ResultFlag SphericalWaveFitVarC(revt::REvent &rEvent, FitParameters &fit, int type) const
Definition: RdWaveFit.cc:733
utl::CoordinateSystemPtr fLocalCS
Definition: RdWaveFit.h:240
Chi2ForSphericalWaveFit * ChiSWF
Definition: RdWaveFit.h:243
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
fwk::VModule::ResultFlag ScanSWF(revt::REvent &rEvent, FitParameters &sFitResults) const
Definition: RdWaveFit.cc:1064
fwk::VModule::ResultFlag CallSphericalWaveFit(revt::REvent &rEvent, FitParameters &sFitResults, bool reuseFit=false)
Definition: RdWaveFit.cc:1290
Objective function for the plane wave fit.
Chi2ForConicalWaveFit * ChiCWF
Definition: RdWaveFit.h:245
std::string fUsedCorePosition
Definition: RdWaveFit.h:248
utl::Point fReferenceCore
Definition: RdWaveFit.h:239
Module interface.
Definition: VModule.h:53
fwk::VModule::ResultFlag ScanPWF(revt::REvent &rEvent, FitParameters &sFitResults) const
Definition: RdWaveFit.cc:972
unsigned int currentWaveFrontModel
Definition: RdWaveFit.h:225
fwk::VModule::ResultFlag ConicalWaveFit(revt::REvent &rEvent, FitParameters &fit, int type) const
Definition: RdWaveFit.cc:851
double fEventTimeNanoSecond
Definition: RdWaveFit.h:236
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
Chi2ForSphericalWaveFitVarC * ChiSWFVarC
Definition: RdWaveFit.h:244
Chi2ForPlaneWaveFit * ChiPWF
Definition: RdWaveFit.h:242
Vector object.
Definition: Vector.h:30
fwk::VModule::ResultFlag ScanCWF(revt::REvent &rEvent, FitParameters &sFitResults) const
Definition: RdWaveFit.cc:1183
utl::CoordinateSystemPtr Create(utl::Point arg1)
fwk::VModule::ResultFlag CallPlaneWaveFit(revt::REvent &rEvent, FitParameters &sFitResults, bool reuseFit=false) const
Definition: RdWaveFit.cc:1262
std::string fUsedDirection
Definition: RdWaveFit.h:247
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
Definition: RdWaveFit.cc:142
REGISTER_MODULE("RdWaveFit", RdWaveFit)
fwk::VModule::ResultFlag ComputeBaryCenter(const revt::REvent &rEvent, utl::Point &baryCenter)
Definition: RdWaveFit.cc:1473
Objective function for the conical wave fit.
Objective function for the spherical wave fit including the speed of light.
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
Definition: RdWaveFit.cc:91

, generated on Tue Sep 26 2023.