Regressor function object for JShowerEH fit using JSimplex minimiser.
More...
#include <JShowerBjorkenYRegressor.hh>
|
typedef JTOOLS::JSplineFunction1S_t | JFunction1D_t |
|
typedef JTOOLS::JMapList< JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList< JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList< JTOOLS::JPolint0FunctionalGridMap, JTOOLS::JMapList< JTOOLS::JPolint0FunctionalGridMap > > > > | JPDFMaplist_t |
|
typedef JPHYSICS::JPDFTable< JFunction1D_t, JPDFMaplist_t > | JPDF_t |
|
typedef JTOOLS::JMapList< JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList< JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList< JTOOLS::JPolint0FunctionalGridMap, JTOOLS::JMapList< JTOOLS::JPolint0FunctionalGridMap > > > > | JNPEMaplist_t |
|
typedef JPHYSICS::JNPETable< double, double, JNPEMaplist_t > | JNPE_t |
|
typedef JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint1FunctionalGridMap >::maplist | JMapList_t2 |
|
typedef JPHYSICS::JPDFTable< JFunction1D_t, JMapList_t2 > | JPDF_t2 |
|
typedef JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint1FunctionalGridMap >::maplist | JNPEMapList_t2 |
|
typedef JPHYSICS::JNPETable< double, double, JNPEMapList_t2 > | JNPE_t2 |
|
typedef JSimplex< JShowerEH > | minimiser_type |
|
typedef JRegressor< JShowerEH, JSimplex > | regressor_type |
|
typedef minimiser_type::result_type | result_type |
|
|
| JRegressor (const std::string &fileDescriptor) |
| Parameterized constructor. More...
|
|
double | operator() (const JShowerEH &shower, const JPMTW0 &pmt) const |
| Fit function. More...
|
|
double | getH0 (const double R_Hz) const |
| Get background hypothesis value for time integrated PDF. More...
|
|
double | getH1 (const double D, const double ct, const double cosDelta, const double theta, const double phi, const double Eem, const double Eh, const double Y) const |
| Get signal hypothesis value for time integrated PDF. More...
|
|
result_type | operator() (const JShowerEH &value, T __begin, T __end) |
| Global fit. More...
|
|
template<class JFunction_t , class T > |
double | operator() (const JFunction_t &fit, T __begin, T __end) |
| Multi-dimensional fit. More...
|
|
template<class JFunction_t , class T > |
double | operator() (const JFunction_t &fit, T __begin, T __end, const JModel_t &step) |
| 1D fit. More...
|
|
|
template<class JFunction_t , class T > |
double | evaluate (const JFunction_t &fit, T __begin, T __end) const |
| Evaluate chi2 for given data set. More...
|
|
Regressor function object for JShowerEH fit using JSimplex minimiser.
Definition at line 53 of file JShowerBjorkenYRegressor.hh.
◆ JFunction1D_t
◆ JPDFMaplist_t
◆ JPDF_t
◆ JNPEMaplist_t
◆ JNPE_t
◆ JMapList_t2
◆ JPDF_t2
◆ JNPEMapList_t2
◆ JNPE_t2
◆ minimiser_type
◆ regressor_type
◆ result_type
◆ JRegressor()
Parameterized constructor.
The PDF file descriptor should contain the wild card character JPHYSICS::WILDCARD which will be replaced by the corresponding PDF types listed in JRegressor<JShower3Z, JGandalf>::pdf_t.
- Parameters
-
fileDescriptor | PDF file descriptor |
Definition at line 91 of file JShowerBjorkenYRegressor.hh.
97 const JPDF_t::JSupervisor supervisor(
new JPDF_t::JDefaultResult(
JMATH::zero));
98 const JPDF_t2::JSupervisor supervisor2(
new JPDF_t2::JDefaultResult(
JMATH::zero));
109 NOTICE(
"loading PDF from file " << file_name <<
"... " << flush);
113 pdf.load(file_name.c_str());
115 pdf.setExceptionHandler(supervisor);
121 pdf2.load(file_name.c_str());
125 pdf2.setExceptionHandler(supervisor2);
143 npe[i-1].swap(buffer);
149 npe2[i-1].swap(buffer2);
virtual const char * what() const override
Get error message.
void add(const JNPETable &input)
Add NPE table.
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
static const JZero zero
Function object to assign zero value.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const JPDFType_t pdf_t[NUMBER_OF_PDFS]
PDF types.
JPHYSICS::JPDFTable< JFunction1D_t, JMapList_t2 > JPDF_t2
JNPE_t npe[NUMBER_OF_PDFS-2]
PDF.
JNPE_t2 npe2[NUMBER_OF_PDFS-2]
PDF.
JLANG::JSharedPointer< JMEstimator > estimator
M-Estimator function.
JPHYSICS::JPDFTable< JFunction1D_t, JPDFMaplist_t > JPDF_t
static const int NUMBER_OF_PDFS
JPHYSICS::JNPETable< double, double, JNPEMaplist_t > JNPE_t
JPHYSICS::JNPETable< double, double, JNPEMapList_t2 > JNPE_t2
◆ operator()() [1/4]
Fit function.
This method is used to determine the chi2 of given PMT with respect to shower hypothesis.
- Parameters
-
- Returns
- chi2
Definition at line 162 of file JShowerBjorkenYRegressor.hh.
172 double ct = U.getDot(D) / D.getLength();
176 const double z = D.getDot(shower_dir);
177 const double x = D.getX() - z * shower.
getDX();
178 const double y = D.getY() - z * shower.
getDY();
179 const double cosDelta = z/D.getLength();
183 const double theta = U.getTheta();
184 const double phi = fabs(U.getPhi());
187 double H1 =
getH1(D.getLength(), ct, cosDelta, theta, phi,
196 const bool hit = pmt.
getN() != 0;
const JVersor3Z & getDirection() const
Get direction.
double getEem() const
Get EM energy.
double getEh() const
Get Hadronic energy.
double getBy() const
Get bjorken y.
Data structure for direction in three dimensions.
const JDirection3D & getDirection() const
Get direction.
Data structure for position in three dimensions.
const JPosition3D & getPosition() const
Get position.
Data structure for normalised vector in three dimensions.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
double getChi2(const double P)
Get chi2 corresponding to given probability.
int getN() const
Get number of hits.
double getR() const
Get rate.
double getH1(const double D, const double ct, const double cosDelta, const double theta, const double phi, const double Eem, const double Eh, const double Y) const
Get signal hypothesis value for time integrated PDF.
double getH0(const double R_Hz) const
Get background hypothesis value for time integrated PDF.
static double Vmax_npe
Maximal integral of PDF [npe].
◆ getH0()
Get background hypothesis value for time integrated PDF.
- Parameters
-
- Returns
- hypothesis value
Definition at line 208 of file JShowerBjorkenYRegressor.hh.
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
◆ getH1()
double JFIT::JRegressor< JShowerEH, JSimplex >::getH1 |
( |
const double |
D, |
|
|
const double |
ct, |
|
|
const double |
cosDelta, |
|
|
const double |
theta, |
|
|
const double |
phi, |
|
|
const double |
Eem, |
|
|
const double |
Eh, |
|
|
const double |
Y |
|
) |
| const |
|
inline |
Get signal hypothesis value for time integrated PDF.
- Parameters
-
D | PMT distance from shower [m] |
ct | angle between shower direction and PMT position |
cosDelta | angle between shower direction and PMT position |
theta | PMT zenith angle [deg] |
phi | PMT azimuth angle [deg] |
Eem | EM shower energy [GeV] |
Eh | H shower energy [GeV] |
Y | Bjorken Y
|
- Returns
- hypothesis value
Definition at line 226 of file JShowerBjorkenYRegressor.hh.
240 if (!
npe[i].empty() && D <=
npe[i].getXmax() && !
npe2[i].empty() && D <=
npe2[i].getXmax()) {
244 JNPE_t::result_type P_em;
245 JNPE_t2::result_type P_h;
247 P_em = fabs(Eem) *
npe[i](std::max(D,
npe[i].getXmin()), cosDelta, theta, phi);
249 P_h = fabs(Eh) *
npe2[i](std::max(D,
npe2[i].getXmin()), ct);
259 ERROR(error << std::endl);
◆ operator()() [2/4]
Global fit.
- Parameters
-
value | start value |
__begin | begin of data set |
__end | end of data set |
- Returns
- chi2
Definition at line 94 of file JRegressor.hh.
JSimplex< JShowerEH > minimiser_type
JRegressor< JShowerEH, JSimplex > regressor_type
◆ operator()() [3/4]
template<class JModel_t >
template<class JFunction_t , class T >
Multi-dimensional fit.
The given fit function should return the equivalent of chi2 for the current value of the given model and a given data point.
- Parameters
-
fit | fit function |
__begin | begin of data |
__end | end of data |
- Returns
- chi2
Definition at line 71 of file JSimplex.hh.
76 double chi2_old =
evaluate(fit, __begin, __end);
78 const int N =
step.size();
92 DEBUG(
"old: " <<
FIXED(12,5) << chi2_old << endl);
96 for (
int i = 0; i != N; ++i) {
100 chi2[i] = (*this)(fit, __begin, __end,
step[i]);
108 const double chi2_new = (*this)(fit, __begin, __end,
wall);
110 DEBUG(
"new: " <<
FIXED(12,5) << chi2_new << endl);
113 if (fabs(chi2_old - chi2_new) <
EPSILON*fabs(chi2_old)) {
123 const double fe =
evaluate(fit, __begin, __end);
128 for (
int i = N-1; i != 0; --i) {
129 chi2[i] = chi2[i-1] - chi2[i];
132 chi2[0] = chi2_old - chi2[0];
137 for (
int i = 0; i != N; ++i) {
143 const double fn = chi2_new;
144 const double f0 = chi2_old;
145 const double ff = f0 - fn - df;
149 if (fe < f0 && 2.0*(f0 - 2.0*fn + fe)*ff*ff < (f0-fe)*(f0-fe)*df) {
151 for (
int i = 0; i != N - 1; ++i) {
#define DEBUG(A)
Message macros.
static int MAXIMUM_ITERATIONS
maximal number of iterations
std::vector< JModel_t > step
static double EPSILON
maximal distance to minimum
double evaluate(const JFunction_t &fit, T __begin, T __end) const
Evaluate chi2 for given data set.
Auxiliary data structure for floating point format specification.
◆ operator()() [4/4]
template<class JModel_t >
template<class JFunction_t , class T >
1D fit.
The given fit function should return the equivalent of chi2 for the current value of the given model and a given data point.
- Parameters
-
fit | fit function |
__begin | begin of data |
__end | end of data |
step | step direction |
Definition at line 178 of file JSimplex.hh.
186 double chi2_old =
evaluate(fit, __begin, __end);
194 const double chi2_new =
evaluate(fit, __begin, __end);
196 DEBUG(
"step: " << setw(3) << i <<
' ' <<
FIXED(12,5) << chi2_old <<
' ' <<
FIXED(12,5) << chi2_new <<
' ' <<
FIXED(5,2) << lambda << endl);
198 if (fabs(chi2_old - chi2_new) <
EPSILON*fabs(chi2_old)) {
200 if (chi2_new > chi2_old) {
214 if (chi2_new < chi2_old) {
230 lambda = factor * lambda;
◆ evaluate()
template<class JModel_t >
template<class JFunction_t , class T >
Evaluate chi2 for given data set.
- Parameters
-
fit | fit function |
__begin | begin of data |
__end | end of data |
Definition at line 253 of file JSimplex.hh.
257 for (T hit = __begin; hit != __end; ++hit) {
258 chi2 += fit(
value, *hit);
◆ T_ns
◆ Vmax_npe
◆ NUMBER_OF_PDFS
◆ pdf_t
Initial value:
@ SCATTERED_LIGHT_FROM_EMSHOWER
scattered light from EM shower
@ SCATTERED_LIGHT_FROM_BRIGHT_POINT
scattered light from bright point
@ DIRECT_LIGHT_FROM_BRIGHT_POINT
direct light from bright point
@ DIRECT_LIGHT_FROM_EMSHOWER
direct light from EM shower
PDF types.
Definition at line 272 of file JShowerBjorkenYRegressor.hh.
◆ npe
◆ npe2
◆ estimator
◆ MAXIMUM_ITERATIONS
template<class JModel_t >
maximal number of iterations
maximal number of iterations.
Definition at line 237 of file JSimplex.hh.
◆ EPSILON
template<class JModel_t >
maximal distance to minimum
maximal distance to minimum.
Definition at line 238 of file JSimplex.hh.
◆ value
template<class JModel_t >
◆ step
template<class JModel_t >
◆ numberOfIterations
template<class JModel_t >
◆ p0
template<class JModel_t >
◆ p1
template<class JModel_t >
◆ wall
template<class JModel_t >
◆ debug
debug level (default is off).
Definition at line 45 of file JMessage.hh.
The documentation for this struct was generated from the following file: