#ifndef __JPOINT4DREGRESSOR__ #define __JPOINT4DREGRESSOR__ #include #include "JPhysics/JConstants.hh" #include "JGeometry3D/JVector3D.hh" #include "JFit/JTimeRange.hh" #include "JFit/JSimplex.hh" #include "JFit/JMEstimator.hh" #include "JFit/JRegressor.hh" #include #include "Jeep/JMessage.hh" /** * \author adomi */ namespace JFIT{ /** * Regressor function object for JPoint4D fit using JSimplex minimiser. */ template<> struct JRegressor : public JAbstractRegressor { using JAbstractRegressor::operator(); /** * Constructor. */ JRegressor(double sigma) { this->sigma = sigma; } /* Fit Function * This method is used to determine the chi2 of given hit with respect * to Shower's vertex (brightest point) * * \param vx Shower's vertex * \param hit hit * \return chi2 */ template double operator()(const JPoint4D& vx, const JHit_t& hit) const { using namespace JPP; const double dt = hit.getT() - vx.getT(hit.getPosition()); const double u = dt / sigma; return estimator->getRho(u) * hit.getW(); } JLANG::JSharedPointer estimator; //!< M-Estimator function double sigma; //!< Time resolution [ns] }; } #endif