1#ifndef __JFIT__JENERGYREGRESSOR__ 
    2#define __JFIT__JENERGYREGRESSOR__ 
   33namespace JPP { 
using namespace JFIT; }
 
   58    static const int           NUMBER_OF_PDFS  =  6;                                 
 
   88      const JPDF_t::JSupervisor supervisor(
new JPDF_t::JDefaultResult(
JMATH::zero));
 
   90      for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
 
   95        const string     file_name = getFilename(fileDescriptor, type);
 
   97        pdf.load(file_name.c_str());
 
   99        pdf.setExceptionHandler(supervisor);
 
  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()); }
 
 
 
  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;
 
  203      storage_type(fileDescriptor, T_ns),
 
  234    inline double operator()(
const JEnergy& x, 
const JNPEHit& npe)
 const 
  236      const double E = 
x.getE();
 
  237      const double u = npe.
getChi2(E);
 
  239      return estimator->getRho(u);
 
  251    inline double getY1(
const JAxis3D& axis)
 const 
  265    inline double getYA(
const JAxis3D& axis)
 const 
  279    inline double getYB(
const JAxis3D& axis)
 const 
  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);
 
  321    inline double getRmax()
 const 
  323      return std::max(getRmax(Y1), std::max(getRmax(YA), getRmax(YB)));
 
  331    std::shared_ptr<JMEstimator> estimator;        
 
  340    static inline double getRmax(
const JNPEs_t& NPE)
 
  344      for (JNPEs_t::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
 
  345        if (!i->empty() && i->getXmax() > xmax) {
 
  363    static inline double getNPE(
const JNPEs_t& NPE,
 
  372      for (JNPEs_t::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
 
  374        if (R <= i->getXmax()) {
 
  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.
 
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
 
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
 
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.
 
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.