1 #ifndef __JFIT__JSHOWER3EZREGRESSOR__
2 #define __JFIT__JSHOWER3EZREGRESSOR__
81 using namespace JPHYSICS;
83 const JPDF_t::JSupervisor supervisor(
new JPDF_t::JDefaultResult(
JMATH::zero));
85 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
89 const string file_name =
getFilename(fileDescriptor, pdf_t[i]);
91 NOTICE(
"loading PDF from file " << file_name <<
"... " << flush);
93 pdf[i].load(file_name.c_str());
97 pdf[i].setExceptionHandler(supervisor);
106 for (
int i = 0; i < NUMBER_OF_PDFS; i++) {
107 npe[ i ] =
JNPE_t(pdf[i]);
122 using namespace JGEOMETRY3D;
123 using namespace JPHYSICS;
131 const double x = D.getX() - z * shower.
getDX();
132 const double y = D.getY() - z * shower.
getDY();
133 const double cosDelta = z/D.getLength();
137 const double theta = U.getTheta();
138 const double phi = fabs(U.getPhi());
143 if (H1.f >= Vmax_npe) {
144 H1 *= Vmax_npe / H1.f;
149 const bool hit = pmt.
getN() != 0;
150 const double u = H1.getChi2(hit);
152 return estimator->getRho(u);
177 const double cosDelta,
180 const double E)
const
184 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
186 if (!npe[i].empty() && D <= npe[i].getXmax()) {
198 ERROR(error << std::endl);
216 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
218 if (!pdf[i].empty() && pdf[i].getXmax() > xmax) {
219 xmax = pdf[i].getXmax();
231 static const int NUMBER_OF_PDFS = 1;
Template definition of a data regressor of given model.
double getDot(const JVersor3Z &dir) const
Get dot product.
double getE() const
Get energy.
General purpose data regression method.
double getR() const
Get rate.
Data structure for direction in three dimensions.
JTOOLS::JSplineFunction1S_t JFunction1D_t
Auxiliary class for handling PMT geometry, rate and response.
scattered light from EM shower
JTOOLS::JMapList< JTOOLS::JPolint1FunctionalMap, JTOOLS::JMapList< JTOOLS::JPolint1FunctionalMap, JTOOLS::JMapList< JTOOLS::JPolint0FunctionalGridMap, JTOOLS::JMapList< JTOOLS::JPolint0FunctionalGridMap > > > > JPDFMaplist_t
const JDirection3D & getDirection() const
Get direction.
JTOOLS::JMapList< JTOOLS::JPolint1FunctionalMapH, JTOOLS::JMapList< JTOOLS::JPolint1FunctionalMap, JTOOLS::JMapList< JTOOLS::JPolint0FunctionalGridMap, JTOOLS::JMapList< JTOOLS::JPolint0FunctionalGridMap > > > > JNPEMaplist_t
JNPE_t::result_type getH1(const double D, const double cosDelta, const double theta, const double phi, const double E) const
Get signal hypothesis value for time integrated PDF.
JRegressor()
Default constructor.
static const JZero zero
Function object to assign zero value.
Definition of zero value for any class.
double getDY() const
Get y direction.
Various implementations of functional maps.
Numbering scheme for PDF types.
double operator()(const JShower3EZ &shower, const JPMTW0 &pmt) const
Fit function.
Data structure for fit of straight line in positive z-direction with energy.
The template JSharedPointer class can be used to share a pointer to an object.
Data structure for vector in three dimensions.
multifunction_t::result_type result_type
static double Vmax_npe
Maximal integral of PDF [npe].
direct light from EM shower
const JPosition3D & getPosition() const
Get position.
JLANG::JSharedPointer< JMEstimator > estimator
M-Estimator function.
General purpose messaging.
const JVersor3Z & getDirection() const
Get direction.
int getN() const
Get number of hits.
double getRmax() const
Get maximal road width of PDF.
Simple fit method based on Powell's algorithm, see reference: Numerical Recipes in C++...
double getDX() const
Get x direction.
std::string getFilename(const std::string &file_name)
Get file name part, i.e.
JNPE_t::result_type getH0(const double R_Hz) const
Get background hypothesis value for time integrated PDF.
virtual const char * what() const
Get error message.
JPHYSICS::JPDFTable< JFunction1D_t, JPDFMaplist_t > JPDF_t
Abstract class for global fit method.
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
Maximum likelihood estimator (M-estimators).
JPHYSICS::JNPETable< double, double, JNPEMaplist_t > JNPE_t
JRegressor(const std::string &fileDescriptor)
Parameterized constructor.