1#ifndef __JFIT__JENERGYREGRESSOR__
2#define __JFIT__JENERGYREGRESSOR__
33namespace JPP {
using namespace JFIT; }
58 static const int NUMBER_OF_PDFS = 6;
87 const JPDF_t::JSupervisor supervisor(
new JPDF_t::JDefaultResult(
JMATH::zero));
89 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
94 const string file_name = getFilename(fileDescriptor, type);
96 pdf.load(file_name.c_str());
98 pdf.setExceptionHandler(supervisor);
100 if (is_bremsstrahlung(type))
101 _YB.push_back(
JNPE_t(pdf, range));
102 else if (is_deltarays(type))
103 _YA.push_back(
JNPE_t(pdf, range));
105 _Y1.push_back(
JNPE_t(pdf, range));
110 if (_Y1.size() == 2) { _Y1[1].add(_Y1[0]); _Y1.erase(_Y1.begin()); }
111 if (_YA.size() == 2) { _YA[1].add(_YA[0]); _YA.erase(_YA.begin()); }
112 if (_YB.size() == 2) { _YB[1].add(_YB[0]); _YB.erase(_YB.begin()); }
165 SCATTERED_LIGHT_FROM_MUON,
166 DIRECT_LIGHT_FROM_DELTARAYS,
167 SCATTERED_LIGHT_FROM_DELTARAYS,
168 DIRECT_LIGHT_FROM_EMSHOWERS,
169 SCATTERED_LIGHT_FROM_EMSHOWERS };
185 using storage_type::getY1;
186 using storage_type::getYA;
187 using storage_type::getYB;
200 storage_type(fileDescriptor, range),
229 inline double operator()(
const JEnergy& x,
const JNPEHit& npe)
const
231 const double E =
x.getE();
232 const double u = npe.
getChi2(E);
234 return estimator->getRho(u);
246 inline double getY1(
const JAxis3D& axis)
const
260 inline double getYA(
const JAxis3D& axis)
const
274 inline double getYB(
const JAxis3D& axis)
const
290 const double R_Hz)
const
295 const double x = axis.
getX();
296 const double y = axis.
getY();
297 const double R = sqrt(x*x + y*y);
298 const double z = axis.
getZ() - R / getTanThetaC();
300 const double theta = axis.
getTheta();
301 const double phi = fabs(axis.
getPhi());
303 const double y1 =
getNPE(Y1, R, theta, phi);
304 const double yA =
getNPE(YA, R, theta, phi);
305 const double yB =
getNPE(YB, R, theta, phi);
307 return JNPE(
getN(T_ns, R_Hz * 1.0e-9), y1, yA, yB, z);
316 inline double getRmax()
const
318 return std::max(getRmax(Y1), std::max(getRmax(YA), getRmax(YB)));
328 std::shared_ptr<JMEstimator> estimator;
337 static inline double getRmax(
const JNPEs_t& NPE)
341 for (JNPEs_t::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
342 if (!i->empty() && i->getXmax() > xmax) {
360 static inline double getNPE(
const JNPEs_t& NPE,
369 for (JNPEs_t::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
371 if (R <= i->getXmax()) {
375 const double y = get_value((*i)(std::max(R, i->getXmin()), theta, phi));
382 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.
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.
@ 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
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
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.
JRegressorStorage()
Default constructor.
JNPEs_t _YB
light from EM showers
JNPEs_t _YA
light from delta-rays
JRegressorStorage(const std::string &fileDescriptor, const JTimeRange &range=JTimeRange())
Constructor.
const JNPEs_t & getYB() const
Get light from EM showers.
std::vector< JNPE_t > JNPEs_t
NPEs.
JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint1FunctionalGridMap, JTOOLS::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
JNPEs_t _Y1
light from muon
const JNPEs_t & getY1() const
Get light from muon.
const JNPEs_t & getYA() const
Get light from delta-rays.
JPHYSICS::JNPETable< double, double, JNPEMaplist_t > JNPE_t
time integrated PDF
Template data structure for storage of internal data.
Template definition of a data regressor of given model.