Go to the documentation of this file. 1 #ifndef __JFIT__JLINE3ZREGRESSOR__
2 #define __JFIT__JLINE3ZREGRESSOR__
34 namespace JPP {
using namespace JFIT; }
83 template<
class JHit_t>
93 const double R = sqrt(D.getLengthSquared() - z*z);
97 const double u = (t1 - hit.getT()) / sigma;
99 return estimator->getRho(
u) * hit.getW();
150 const double epsilon = 1.0e-10) :
157 const JPDF_t::JSupervisor supervisor(
new JPDF_t::JDefaultResult(
JMATH::zero));
159 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
163 const string file_name =
getFilename(fileDescriptor, pdf_t[i]);
165 NOTICE(
"loading PDF from file " << file_name <<
"... " << flush);
167 pdf[i].load(file_name.c_str());
171 pdf[i].setExceptionHandler(supervisor);
175 }
else if (TTS < 0.0) {
176 ERROR(
"Illegal value of TTS [ns]: " << TTS << endl);
186 for (
int i = 1; i < NUMBER_OF_PDFS; i += 2) {
188 pdf[ i ].add(pdf[i-1]);
191 npe[ i ] =
JNPE_t(pdf[i]);
213 template<
class JHit_t>
224 const double x = D.getX() - z * track.
getDX();
225 const double y = D.getY() - z * track.
getDY();
226 const double R = sqrt(D.getLengthSquared() - z*z);
232 const double theta = U.getTheta();
233 const double phi = fabs(U.getPhi());
236 const double dt = T_ns.constrain(hit.getT() - t1);
241 if (H1.V >= Vmax_npe) {
242 H1 *= Vmax_npe / H1.V;
249 result.chi2 = H1.getChi2() - H0.getChi2();
258 wc * (D.getY() - D.getZ()*track.
getDY()/track.
getDZ())));
261 H0.getDerivativeOfChi2()));
286 const double x = D.getX() - z * track.
getDX();
287 const double y = D.getY() - z * track.
getDY();
288 const double R = sqrt(D.getLengthSquared() - z*z);
292 const double theta = U.getTheta();
293 const double phi = fabs(U.getPhi());
300 if (H1.f >= Vmax_npe) {
301 H1 *= Vmax_npe / H1.f;
306 const bool hit = pmt.
getN() != 0;
307 const double u = H1.getChi2(hit);
311 result.chi2 = estimator->getRho(
u);
320 result.gradient.mul(estimator->getPsi(
u));
321 result.gradient.mul(H1.getDerivativeOfChi2(hit));
335 const double t1)
const
355 const double t1)
const
362 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
364 if (!pdf[i].empty() && R <= pdf[i].getXmax()) {
419 const double phi)
const
426 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
428 if (!npe[i].empty() && R <= npe[i].getXmax()) {
450 ERROR(error << endl);
470 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
471 if (!pdf[i].empty() && R_compress.
is_valid()) {
472 pdf[ i ].compress(R_compress);
488 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
489 if (!pdf[i].empty() && pdf[i].getXmax() > xmax) {
490 xmax = pdf[i].getXmax();
501 static const int NUMBER_OF_PDFS = 4;
direct light from delta-rays
result_type operator()(const JLine3Z &track, const JHit_t &hit) const
Fit function.
Auxiliary class to set-up Hit.
JTOOLS::JSplineFunction1S_t JFunction1D_t
JNPE_t::result_type getH0(const double R_Hz) const
Get background hypothesis value for time integrated PDF.
Abstract class for global fit method.
double sigma
Time resolution [ns].
Auxiliary classes and methods for linear and iterative data regression.
Data structure for fit of straight line in positive z-direction.
JPHYSICS::JNPETable< double, double, JNPEMaplist_t > JNPE_t
time integrated PDF
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
JRegressor()
Default constructor.
JPDF_t::result_type getH0(const double R_Hz, const double t1) const
Get background hypothesis value for time differentiated PDF.
Data structure for normalised vector in positive z-direction.
multifunction_t::result_type result_type
double getR() const
Get rate.
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays.
const JDirection3D & getDirection() const
Get direction.
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
Simple fit method based on Powell's algorithm, see reference: Numerical Recipes in C++,...
double getRmax() const
Get maximal road width of PDF.
JLANG::JSharedPointer< JMEstimator > estimator
M-Estimator function.
Fit method based on the Levenberg-Marquardt method.
double getDot(const JAngle3D &angle) const
Get dot product.
result_type operator()(const JLine3Z &track, const JPMTW0 &pmt) const
Fit function.
Auxiliary classes and methods for calculation of PDF and muon energy loss.
Data structure for direction in three dimensions.
JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint0FunctionalGridMap, JTOOLS::JPolint0FunctionalGridMap >::maplist JPDFMaplist_t
static double Vmax_npe
Maximal integral of PDF [npe].
minimiser_type::result_type result_type
JPDF_t::result_type getH1(const double E, const double R, const double theta, const double phi, const double t1) const
Get signal hypothesis value for time differentiated PDF.
double getDeltaRaysFromMuon(const double E)
Equivalent EM-shower energy due to delta-rays per unit muon track length.
virtual double getE(const double E, const double dx) const
Get energy of muon after specified distance.
Auxiliary class for handling PMT geometry, rate and response.
double E_GeV
Energy of muon at vertex [GeV].
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JLANG::JSharedPointer< JMEstimator > estimator
M-Estimator function.
int getN() const
Get number of hits.
JVersor3D getDirection(const JVector3D &pos) const
Get photon direction of Cherenkov light on PMT.
JRegressor(double sigma)
Constructor.
Data structure for position in three dimensions.
JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMapH, JTOOLS::JPolint1FunctionalGridMap, JTOOLS::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
Template definition of a data regressor of given model.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
std::string getFilename(const std::string &file_name)
Get file name part, i.e.
scattered light from EM showers
void compress(const JRange< typename JFunction1D_t::abscissa_type > &R_compress)
Compresses PDFs to abscissa range specified by R_compress.
Data structure for fit of straight line paralel to z-axis.
JRegressor(const std::string &fileDescriptor, const double TTS, const int numberOfPoints=25, const double epsilon=1.0e-10)
Constructor.
const JPosition3D & getPosition() const
Get position.
JNPE_t::result_type getH1(const double E, const double R, const double theta, const double phi) const
Get signal hypothesis value for time integrated PDF.
JPHYSICS::JPDFTable< JFunction1D_t, JPDFMaplist_t > JPDF_t
time dependent PDF
double getDot(const JVector3D &vector) const
Get dot product.
double getDY() const
Get y direction.
Auxiliary classes and methods for 3D geometrical objects and operations.
virtual const char * what() const
Get error message.
static const JZero zero
Function object to assign zero value.
transformablemultifunction_t::result_type result_type
double getDZ() const
Get z direction.
direct light from EM showers
JVector3D & sub(const JVector3D &vector)
Subtract vector.
scattered light from delta-rays
double getDX() const
Get x direction.
The template JSharedPointer class can be used to share a pointer to an object.
double operator()(const JLine3Z &track, const JHit_t &hit) const
Fit function.
scattered light from muon