1 #ifndef __JFIT__JSHOWERENERGYREGRESSOR__
2 #define __JFIT__JSHOWERENERGYREGRESSOR__
36 namespace JPP {
using namespace JFIT; }
78 const JPDF_t::JSupervisor supervisor(
new JPDF_t::JDefaultResult(
JMATH::zero));
80 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
86 const string file_name =
getFilename(fileDescriptor, pdf_t[i]);
88 NOTICE(
"loading PDF from file " << file_name <<
"... " << flush);
90 pdf.
load(file_name.c_str());
105 for (
int i = 1; i < NUMBER_OF_PDFS; i += 2) {
124 const double E = x.
getE();
127 return estimator->getRho(
u);
138 const double R_Hz)
const
145 const double U_length = std::sqrt(U.getDX()*U.getDX() +
146 U.getDY()*U.getDY() +
147 U.getDZ()*U.getDZ());
149 const double ct = U.getDot(
D) / (
D.getLength()*U_length);
151 const double y =
getNPE(
Y,
D.getLength(), ct);
173 if (D <= i->getXmax()) {
177 const double y =
get_value((*i)(std::max(D, i->getXmin()), cd));
184 ERROR(error << std::endl);
196 static const int NUMBER_OF_PDFS = 2;
Template definition of a data regressor of given model.
double getE() const
Get energy.
double getChi2(const double E_GeV) const
Get chi2.
void load(const char *file_name)
Load from input file.
General purpose data regression method.
JRegressor(const std::string &fileDescriptor)
Parameterized constructor.
JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint1FunctionalGridMap >::maplist JMapList_t
static double Vmax_npe
Maximal integral of PDF [npe].
This include file containes various data structures that can be used as specific return types for the...
const JDirection3D & getDirection() const
Get direction.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
double operator()(const JEnergy &x, const JShowerNPEHit &npe) const
Fit function.
std::vector< JNPE_t > Y
light from EM showers
static const JZero zero
Function object to assign zero value.
direct light from bright point
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
JShowerNPE getNPE(const JAxis3D &axis, const double R_Hz) const
Create data structure for handling light yields for PMT.
Definition of zero value for any class.
Numbering scheme for PDF types.
The template JSharedPointer class can be used to share a pointer to an object.
Multi-dimensional PDF table for arrival time of Cherenkov light.
JTOOLS::JSplineFunction1S_t JFunction1D_t
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
const JPosition3D & getPosition() const
Get position.
General purpose messaging.
scattered light from bright point
virtual const char * what() const override
Get error message.
Simple fit method based on Powell's algorithm, see reference: Numerical Recipes in C++...
JPHYSICS::JNPETable< double, double, JMapList_t > JNPE_t
Auxiliary class for simultaneously handling light yields and response of PMT.
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
Data structure for fit of energy.
double getNPE(const Hit &hit)
Get true charge of hit.
Data structure for position in three dimensions.
Auxiliary class for handling EM shower light yield.
Abstract class for global fit method.
JLANG::JSharedPointer< JMEstimator > estimator
M-Estimator function.
do echo Generating $dir eval D
JPHYSICS::JPDFTable< JFunction1D_t, JMapList_t > JPDF_t
Maximum likelihood estimator (M-estimators).
static double getNPE(const std::vector< JNPE_t > &NPE, const double D, const double cd)
Get number of photo-electrons.
Custom class for integrated values of the PDF of the arrival time of Cherenkov light.