1#ifndef __JFIT__JENERGYREGRESSOR__
2#define __JFIT__JENERGYREGRESSOR__
33namespace JPP {
using namespace JFIT; }
58 static const int NUMBER_OF_PDFS = 6;
79 JRegressorStorage(
const std::string& fileDescriptor,
const JTimeRange& T_ns = JTimeRange()) :
90 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
94 const JPDFType_t type = pdf_t[i];
95 const string file_name = getFilename(fileDescriptor, type);
97 pdf.load(file_name.c_str());
101 if (is_bremsstrahlung(type))
102 _YB.push_back(
JNPE_t(pdf, T_ns));
103 else if (is_deltarays(type))
104 _YA.push_back(
JNPE_t(pdf, T_ns));
106 _Y1.push_back(
JNPE_t(pdf, T_ns));
111 if (_Y1.size() == 2) { _Y1[1].add(_Y1[0]); _Y1.erase(_Y1.begin()); }
112 if (_YA.size() == 2) { _YA[1].add(_YA[0]); _YA.erase(_YA.begin()); }
113 if (_YB.size() == 2) { _YB[1].add(_YB[0]); _YB.erase(_YB.begin()); }
153 static const JPDFType_t pdf_t[NUMBER_OF_PDFS];
168 SCATTERED_LIGHT_FROM_MUON,
169 DIRECT_LIGHT_FROM_DELTARAYS,
170 SCATTERED_LIGHT_FROM_DELTARAYS,
171 DIRECT_LIGHT_FROM_EMSHOWERS,
172 SCATTERED_LIGHT_FROM_EMSHOWERS };
188 using storage_type::getY1;
189 using storage_type::getYA;
190 using storage_type::getYB;
202 JRegressor(
const std::string& fileDescriptor,
const JTimeRange& T_ns = JTimeRange()) :
236 const double E = x.getE();
239 return estimator->getRho(
u);
295 const double R_Hz)
const
300 const double x = axis.
getX();
301 const double y = axis.
getY();
302 const double R = sqrt(x*x + y*y);
303 const double z = axis.
getZ() - R / getTanThetaC();
305 const double theta = axis.
getTheta();
306 const double phi = fabs(axis.
getPhi());
308 const double y1 = getNPE(Y1, R, theta, phi);
309 const double yA = getNPE(YA, R, theta, phi);
310 const double yB = getNPE(YB, R, theta, phi);
312 return JNPE(getN(T_ns, R_Hz * 1.0e-9), y1, yA, yB, z);
323 return std::max(getRmax(Y1), std::max(getRmax(YA), getRmax(YB)));
344 for (JNPEs_t::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
345 if (!i->empty() && i->getXmax() > xmax) {
372 for (JNPEs_t::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
378 const double y = get_value((*i)(std::max(R, i->getXmin()), theta, phi));
385 ERROR(error << std::endl);
Various implementations of functional maps.
Maximum likelihood estimator (M-estimators).
General purpose messaging.
Numbering scheme for PDF types.
General purpose data regression method.
Data structure for fit of energy.
double getY() const
Get y position.
double getZ() const
Get z position.
double getX() const
Get x position.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
Template definition of a multi-dimensional oscillation probability interpolation table.
Custom class for integrated values of the PDF of the arrival time of Cherenkov light.
Auxiliary classes and methods for linear and iterative data regression.
static const JZero zero
Function object to assign zero value.
@ SCATTERED_LIGHT_FROM_DELTARAYS
scattered light from delta-rays
@ DIRECT_LIGHT_FROM_EMSHOWERS
direct light from EM showers
@ SCATTERED_LIGHT_FROM_EMSHOWERS
scattered light from EM showers
@ SCATTERED_LIGHT_FROM_MUON
scattered light from muon
@ DIRECT_LIGHT_FROM_DELTARAYS
direct light from delta-rays
@ DIRECT_LIGHT_FROM_MUON
direct light from muon
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Abstract class for global fit method.
Auxiliary class for simultaneously handling light yields and response of PMT.
double getChi2(const double E_GeV) const
Get chi2.
Auxiliary class for handling various light yields.
Template specialisation for storage of PDF tables.
JRegressorStorage()
Default constructor.
JNPEs_t _YB
light from EM showers
JPHYSICS::JNPETable< double, double, JNPEMaplist_t > JNPE_t
time integrated PDF
JNPEs_t _YA
light from delta-rays
const JNPEs_t & getYB() const
Get light from EM showers.
JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint1FunctionalGridMap, JTOOLS::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
std::vector< JNPE_t > JNPEs_t
NPEs.
JRegressorStorage(const std::string &fileDescriptor, const JTimeRange &T_ns=JTimeRange())
Constructor.
JNPEs_t _Y1
light from muon
const JNPEs_t & getY1() const
Get light from muon.
JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
const JNPEs_t & getYA() const
Get light from delta-rays.
Template data structure for storage of internal data.
JRegressorStorage< JEnergy > storage_type
double operator()(const JEnergy &x, const JNPEHit &npe) const
Fit function.
double getRmax() const
Get maximal road width of NPE.
static double getRmax(const JNPEs_t &NPE)
Get maximal road width of PDF.
double getY1(const JAxis3D &axis) const
Get number of photo-electrons from muon.
double getYA(const JAxis3D &axis) const
Get number of photo-electrons from delta-rays.
double getYB(const JAxis3D &axis) const
Get number of photo-electrons from Bremsstrahlung.
JRegressor(const std::string &fileDescriptor, const JTimeRange &T_ns=JTimeRange())
Constructor.
JNPE getNPE(const JAxis3D &axis, const double R_Hz) const
Create data structure for handling light yields for PMT.
JRegressor(const storage_type &storage)
Constructor.
static double getNPE(const JNPEs_t &NPE, const double R, const double theta, const double phi)
Get number of photo-electrons.
std::shared_ptr< JMEstimator > estimator
M-Estimator function.
Template definition of a data regressor of given model.