RdScintPlaneFit.h
Go to the documentation of this file.
1 #ifndef _RdScintPlaneFit_h_
2 #define _RdScintPlaneFit_h_
3 
4 #include <fwk/VModule.h>
5 #include <revt/Channel.h>
6 #include <utl/Vector.h>
7 #include <utl/Point.h>
8 #include <utl/TimeStamp.h>
9 #include <utl/CoordinateSystem.h>
10 
11 /*namespace evt {
12  class Event;
13  }*/
14 
15 namespace revt {
16  class REvent;
17 }
18 
19 // you should assign your module to a namespace
20 
21 namespace RdScintPlaneFit {
22 
31  struct FitParameters {
32  double u;
33  double v;
34  double w;
35  double ct0;
36  double sigmaU2;
37  double sigmaV2;
38  double sigmaUV;
39  double sigmact02;
40  double stage;
41 
43  u(0), v(0), w(0), ct0(0), sigmaU2(0), sigmaV2(0), sigmaUV(0), sigmact02(0), stage(0)
44  {
45  }
46  };
47 
48  class RdScintPlaneFit: public fwk::VModule {
49 
50  public:
51  // If you define a constructor, you MUST provide an implementation
52  // for it, otherwise the REGISTER_MODULE macro will not register
53  // your module. (Here, implementation is in RdPlaneFit.cc)
54  // RdPlaneFit();
55  //virtual ~RdPlaneFit();
56 
60 
61  private:
63  fwk::VModule::ResultFlag LinearFit(FitParameters& fit, const bool reuseFit = false) const;
67  static void PlaneFit3DFnc(int& nPar, double* const grad, double& value, double* const par,
68  const int flag);
71  static void PlaneFit3DHorizonFnc(int& nPar, double* const grad, double& value,
72  double* const par, const int flag);
75  void CalculateTimeResidual(const utl::Vector& axis, const double ct0, double& chi2) const;
76 
77  enum InfoLevel {
78  eNone = 0, eFinal = 1, eIntermediate = 2, eObscure = 3, eMinuit = 4
79  };
80 
81  // xml settings
86 
87  // minuit globals
93  static double fgMeanEventTime; // this is the weighted mean of the station signal times with respect to the event time
94 
95  // The REGISTER_MODULE macro makes the framework aware of your module.
96  // You need to put this macro at the very end of your module class definition.
97  // Give your module a name (first argument) and specify its
98  // class name (second argument). In the ModuleSequenceExample.xml file,
99  // you can see this module being refered to by the name we give it here.
100 
101  REGISTER_MODULE("RdScintPlaneFit", RdScintPlaneFit);
102 
103  };
104 
105 }
106 
107 #endif
108 
109 // Configure (x)emacs for this file ...
110 // Local Variables:
111 // mode:c++
112 // compile-command: "make -k"
113 // End:
Point object.
Definition: Point.h:32
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
static utl::CoordinateSystemPtr fgLocalCS
static revt::REvent * fgCurrentREvent
REGISTER_MODULE("RdScintPlaneFit", RdScintPlaneFit)
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
static void PlaneFit3DFnc(int &nPar, double *const grad, double &value, double *const par, const int flag)
Function to minimize the plane fit, z != equal for all stations.
void CalculateTimeResidual(const utl::Vector &axis, const double ct0, double &chi2) const
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
static void PlaneFit3DHorizonFnc(int &nPar, double *const grad, double &value, double *const par, const int flag)
fwk::VModule::ResultFlag LinearFit(FitParameters &fit, const bool reuseFit=false) const
performs a Linear fit, approximation that z= equal for all stations
static utl::TimeStamp fgBaryTime
Module interface.
Definition: VModule.h:53
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
Vector object.
Definition: Vector.h:30
fwk::VModule::ResultFlag PlaneFit3DDriver(FitParameters &fit) const
Setting up / Executing the minimalization routines.
const int nPar
Definition: GeomAsym.h:37
static utl::Point fgCoordinateOrigin
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)

, generated on Tue Sep 26 2023.