Jpp  17.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JPoint4DRegressor.hh
Go to the documentation of this file.
1 #ifndef __JPOINT4DREGRESSOR__
2 #define __JPOINT4DREGRESSOR__
3 
4 #include <cmath>
5 
6 #include "JPhysics/JConstants.hh"
7 
9 
10 #include "JFit/JTimeRange.hh"
11 #include "JFit/JSimplex.hh"
12 #include "JFit/JMEstimator.hh"
13 #include "JFit/JRegressor.hh"
14 #include <JFit/JPoint4D.hh>
15 
16 #include "Jeep/JMessage.hh"
17 
18 /**
19  * \author adomi
20  */
21 
22 namespace JFIT{
23 
24  /**
25  * Regressor function object for JPoint4D fit using JSimplex minimiser.
26  */
27  template<>
29  public JAbstractRegressor<JPoint4D, JSimplex>
30  {
32 
33  /**
34  * Constructor.
35  */
36  JRegressor(double sigma)
37  {
38  this->sigma = sigma;
39  }
40 
41  /* Fit Function
42  * This method is used to determine the chi2 of given hit with respect
43  * to Shower's vertex (brightest point)
44  *
45  * \param vx Shower's vertex
46  * \param hit hit
47  * \return chi2
48  */
49  template<class JHit_t>
50  double operator()(const JPoint4D& vx, const JHit_t& hit) const
51  {
52  using namespace JPP;
53 
54  const double dt = hit.getT() - vx.getT(hit.getPosition());
55 
56  const double u = dt / sigma;
57 
58  return estimator->getRho(u) * hit.getW();
59  }
60 
61  JLANG::JSharedPointer<JMEstimator> estimator; //!< M-Estimator function
62  double sigma; //!< Time resolution [ns]
63  };
64 }
65 
66 #endif
Template definition of a data regressor of given model.
Definition: JRegressor.hh:68
General purpose data regression method.
Data structure for vertex fit.
Definition: JPoint4D.hh:22
const double sigma[]
Definition: JQuadrature.cc:74
JLANG::JSharedPointer< JMEstimator > estimator
M-Estimator function.
double operator()(const JPoint4D &vx, const JHit_t &hit) const
The template JSharedPointer class can be used to share a pointer to an object.
double sigma
Time resolution [ns].
Physics constants.
General purpose messaging.
Simple fit method based on Powell&#39;s algorithm, see reference: Numerical Recipes in C++...
Definition: JSimplex.hh:42
JRegressor(double sigma)
Constructor.
double u[N+1]
Definition: JPolint.hh:776
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition: JVertex3D.hh:147
Abstract class for global fit method.
Definition: JRegressor.hh:75
Maximum likelihood estimator (M-estimators).