1#ifndef __JFIT__JENERGYREGRESSOR__
2#define __JFIT__JENERGYREGRESSOR__
31namespace JPP {
using namespace JFIT; }
69 JRegressor(
const std::string& fileDescriptor) :
78 const JPDF_t::JSupervisor supervisor(
new JPDF_t::JDefaultResult(
JMATH::zero));
80 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
87 const string file_name = getFilename(fileDescriptor, type);
89 NOTICE(
"loading PDF from file " << file_name <<
"... " << flush);
91 pdf.load(file_name.c_str());
95 pdf.setExceptionHandler(supervisor);
98 YB.push_back(JNPE_t(pdf));
100 YA.push_back(JNPE_t(pdf));
102 Y1.push_back(JNPE_t(pdf));
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()); }
125 inline double operator()(
const JEnergy& x,
const JNPEHit& npe)
const
127 const double E =
x.getE();
130 return estimator->getRho(u);
144 const double R_Hz)
const
149 const double x = axis.
getX();
150 const double y = axis.
getY();
151 const double R = sqrt(x*x + y*y);
152 const double z = axis.
getZ() - R / getTanThetaC();
154 const double theta = axis.
getTheta();
155 const double phi = fabs(axis.
getPhi());
157 const double y1 =
getNPE(Y1, R, theta, phi);
158 const double yA =
getNPE(YA, R, theta, phi);
159 const double yB =
getNPE(YB, R, theta, phi);
161 return JNPE(
getN(T_ns, R_Hz * 1.0e-9), y1, yA, yB, z);
170 inline double getRmax()
const
172 return std::max(getRmax(Y1), std::max(getRmax(YA), getRmax(YB)));
183 static const int NUMBER_OF_PDFS = 6;
185 static const JPDFType_t pdf_t[NUMBER_OF_PDFS];
201 for (std::vector<JNPE_t>::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
202 if (!i->empty() && i->getXmax() > xmax) {
229 for (std::vector<JNPE_t>::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
231 if (R <= i->getXmax()) {
235 const double y = get_value((*i)(std::max(R, i->getXmin()), theta, phi));
242 ERROR(error << std::endl);
256 SCATTERED_LIGHT_FROM_MUON,
257 DIRECT_LIGHT_FROM_DELTARAYS,
258 SCATTERED_LIGHT_FROM_DELTARAYS,
259 DIRECT_LIGHT_FROM_EMSHOWERS,
260 SCATTERED_LIGHT_FROM_EMSHOWERS };
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.
virtual const char * what() const override
Get error message.
The template JSinglePointer class can be used to hold a pointer to an object.
Custom class for integrated values of the PDF of the arrival time of Cherenkov light.
Multi-dimensional PDF table for arrival time of Cherenkov light.
double getNPE(const Hit &hit)
Get true charge of hit.
Auxiliary classes and methods for linear and iterative data regression.
static const JZero zero
Function object to assign zero value.
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays.
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
@ 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).
Auxiliary class for handling debug parameter within a class.
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 definition of a data regressor of given model.