Jpp 20.0.0-rc.9-29-gccc23c492-D
the software that should make you happy
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
JFIT::JRegressor< JShower3EZ, JSimplex > Struct Reference

Regressor function object for JShower3EZ fit using JGandalf minimiser. More...

#include <JShower3EZRegressor.hh>

Inheritance diagram for JFIT::JRegressor< JShower3EZ, JSimplex >:
JFIT::JAbstractRegressor< JShower3EZ, JSimplex > JFIT::JRegressorStorage< JShower3EZ, JSimplex >

Public Types

typedef JRegressorStorage< JShower3EZ, JSimplexstorage_type
 
typedef JSimplex< JShower3EZminimiser_type
 
typedef JRegressor< JShower3EZ, JSimplexregressor_type
 
typedef minimiser_type::result_type result_type
 
typedef JTOOLS::JPolint1Function1D_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_tJPDF_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_tJNPE_t
 
typedef std::array< JNPE_t, NUMBER_OF_PDFSJNPEs_t
 NPEs.
 

Public Member Functions

 JRegressor ()
 Default constructor.
 
 JRegressor (const std::string &fileDescriptor, const JTimeRange &T_ns)
 Constructor.
 
 JRegressor (const storage_type &storage)
 Constructor.
 
double operator() (const JShower3EZ &shower, const JPMTW0 &pmt) const
 Fit function.
 
JNPE_t::result_type getH0 (const double R_Hz) const
 Get background hypothesis value for time integrated PDF.
 
JNPE_t::result_type getH1 (const double D, const double cd, const double theta, const double phi, const double E) const
 Get signal hypothesis value for time integrated PDF.
 
result_type operator() (const JShower3EZ &value, T __begin, T __end)
 Global fit.
 
const JNPEs_tgetNPE () const
 Get NPEs.
 

Public Attributes

const JNPEs_tnpe
 
std::shared_ptr< JMEstimatorestimator
 M-Estimator function.
 
JTimeRange T_ns
 Time window with respect to Cherenkov hypothesis [ns].
 

Static Public Attributes

static double Vmax_npe = std::numeric_limits<double>::max()
 Maximal integral of PDF [npe].
 
static const int NUMBER_OF_PDFS = 2
 
static const JPDFType_t pdf_t [NUMBER_OF_PDFS]
 PDF types.
 

Private Attributes

JNPEs_t _npe
 PDFs.
 

Detailed Description

Regressor function object for JShower3EZ fit using JGandalf minimiser.

Definition at line 195 of file JShower3EZRegressor.hh.

Member Typedef Documentation

◆ storage_type

Definition at line 201 of file JShower3EZRegressor.hh.

◆ minimiser_type

typedef JSimplex <JShower3EZ > JFIT::JAbstractRegressor< JShower3EZ , JSimplex >::minimiser_type
inherited

Definition at line 80 of file JRegressor.hh.

◆ regressor_type

typedef JRegressor<JShower3EZ , JSimplex > JFIT::JAbstractRegressor< JShower3EZ , JSimplex >::regressor_type
inherited

Definition at line 81 of file JRegressor.hh.

◆ result_type

Definition at line 82 of file JRegressor.hh.

◆ JFunction1D_t

typedef JTOOLS::JPolint1Function1D_t JFIT::JRegressorStorage< JShower3EZ, JSimplex >::JFunction1D_t
inherited

Definition at line 97 of file JShower3EZRegressor.hh.

◆ JPDFMaplist_t

typedef JTOOLS::JMapList<JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalGridMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalGridMap> > > > JFIT::JRegressorStorage< JShower3EZ, JSimplex >::JPDFMaplist_t
inherited

Definition at line 101 of file JShower3EZRegressor.hh.

◆ JPDF_t

typedef JPHYSICS::JPDFTable<JFunction1D_t, JPDFMaplist_t> JFIT::JRegressorStorage< JShower3EZ, JSimplex >::JPDF_t
inherited

Definition at line 102 of file JShower3EZRegressor.hh.

◆ JNPEMaplist_t

typedef JTOOLS::JMapList<JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalGridMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalGridMap> > > > JFIT::JRegressorStorage< JShower3EZ, JSimplex >::JNPEMaplist_t
inherited

Definition at line 107 of file JShower3EZRegressor.hh.

◆ JNPE_t

typedef JPHYSICS::JNPETable<double, double, JNPEMaplist_t> JFIT::JRegressorStorage< JShower3EZ, JSimplex >::JNPE_t
inherited

Definition at line 108 of file JShower3EZRegressor.hh.

◆ JNPEs_t

typedef std::array<JNPE_t, NUMBER_OF_PDFS> JFIT::JRegressorStorage< JShower3EZ, JSimplex >::JNPEs_t
inherited

NPEs.

Definition at line 113 of file JShower3EZRegressor.hh.

Constructor & Destructor Documentation

◆ JRegressor() [1/3]

JFIT::JRegressor< JShower3EZ, JSimplex >::JRegressor ( )
inline

Default constructor.

Definition at line 206 of file JShower3EZRegressor.hh.

206 :
207 storage_type(),
208 npe(getNPE()),
209 estimator()
210 {}
std::shared_ptr< JMEstimator > estimator
M-Estimator function.
JRegressorStorage< JShower3EZ, JSimplex > storage_type

◆ JRegressor() [2/3]

JFIT::JRegressor< JShower3EZ, JSimplex >::JRegressor ( const std::string & fileDescriptor,
const JTimeRange & T_ns )
inline

Constructor.

The PDF file descriptor should contain the wild card character JPHYSICS::WILDCARD which will be replaced by the PDF types listed in JRegressorStorage<JShower3EZ, JSimplex>::pdf_t.

Parameters
fileDescriptorPDF file descriptor
T_nstime range [ns]

Definition at line 221 of file JShower3EZRegressor.hh.

221 :
222 storage_type(fileDescriptor, T_ns),
223 npe(getNPE()),
224 estimator(new JMEstimatorNull())
225 {}
JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].

◆ JRegressor() [3/3]

JFIT::JRegressor< JShower3EZ, JSimplex >::JRegressor ( const storage_type & storage)
inline

Constructor.

Parameters
storagePDF storage

Definition at line 232 of file JShower3EZRegressor.hh.

232 :
233 npe(storage.getNPE()),
234 estimator(new JMEstimatorNull())
235 {
236 T_ns = storage.T_ns;
237 }

Member Function Documentation

◆ operator()() [1/2]

double JFIT::JRegressor< JShower3EZ, JSimplex >::operator() ( const JShower3EZ & shower,
const JPMTW0 & pmt ) const
inline

Fit function.

This method is used to determine the chi2 of given PMT with respect to shower hypothesis.

Parameters
showershower
pmtpmt
Returns
chi2

Definition at line 248 of file JShower3EZRegressor.hh.

249 {
250 using namespace JPP;
251
252 JPosition3D D(pmt.getPosition());
253 JDirection3D U(pmt.getDirection());
254
255 D.sub(shower.getPosition());
256
257 const double z = D.getDot(shower.getDirection());
258 const double x = D.getX();
259 const double y = D.getY();
260 const double cd = z/D.getLength(); // cosine angle between shower direction and PMT position
261
262 U.rotate(JRotation3Z(-atan2(y,x))); // rotate PMT axis to x-z plane
263
264 const double theta = getPMTAngle(U.getTheta());
265 const double phi = getPMTAngle(U.getPhi());
266
267 JNPE_t::result_type H0 = getH0(pmt.getR()); // background hypothesis value for time integrated PDF.
268 JNPE_t::result_type H1 = getH1(D.getLength(), cd, theta, phi, shower.getE()); // signal hypothesis value for time integrated PDF.
269
270 if (get_value(H1) >= Vmax_npe) {
271 H1 *= Vmax_npe / get_value(H1);
272 }
273
274 H1 += H0; // now H1 is signal + background
275
276 const bool hit = pmt.getN() != 0;
277 const double u = getChi2(get_value(H1), hit) - getChi2(get_value(H0), hit); // - log likelihood ratio
278
279 return estimator->getRho(u);
280 }
double getPMTAngle(const double angle)
Constrain PMT angle to [0,pi].
double getChi2(const double P)
Get chi2 corresponding to given probability.
static double Vmax_npe
Maximal integral of PDF [npe].
JNPE_t::result_type getH0(const double R_Hz) const
Get background hypothesis value for time integrated PDF.
JNPE_t::result_type getH1(const double D, const double cd, const double theta, const double phi, const double E) const
Get signal hypothesis value for time integrated PDF.

◆ getH0()

JNPE_t::result_type JFIT::JRegressor< JShower3EZ, JSimplex >::getH0 ( const double R_Hz) const
inline

Get background hypothesis value for time integrated PDF.

Parameters
R_Hzrate [Hz]
Returns
hypothesis value

Definition at line 288 of file JShower3EZRegressor.hh.

289 {
290 return JNPE_t::result_type(R_Hz * 1e-9 * T_ns.getLength());
291 }

◆ getH1()

JNPE_t::result_type JFIT::JRegressor< JShower3EZ, JSimplex >::getH1 ( const double D,
const double cd,
const double theta,
const double phi,
const double E ) const
inline

Get signal hypothesis value for time integrated PDF.

Parameters
DPMT distance from shower [m]
cdcosine angle between shower direction and PMT position
thetaPMT zenith angle [deg]
phiPMT azimuth angle [deg]
Eshower energy [GeV]
Returns
hypothesis value

Definition at line 303 of file JShower3EZRegressor.hh.

308 {
309 JNPE_t::result_type h1 = JMATH::zero;
310
311 for (int i = 0; i != NUMBER_OF_PDFS; ++i) {
312
313 if (!npe[i].empty() && D <= npe[i].getXmax()) {
314
315 try {
316
317 JNPE_t::result_type y1 = E * npe[i](std::max(D, npe[i].getXmin()), cd, theta, phi);
318
319 // safety measure
320
321 if(y1 < 0){
322 y1 = 0;
323 }
324
325 h1 += y1;
326
327 }
328 catch(JLANG::JException& error) {
329 ERROR(error << std::endl);
330 }
331 }
332 }
333
334 return h1;
335 }

◆ operator()() [2/2]

result_type JFIT::JAbstractRegressor< JShower3EZ , JSimplex >::operator() ( const JShower3EZ & value,
T __begin,
T __end )
inlineinherited

Global fit.

Parameters
valuestart value
__beginbegin of data set
__endend of data set
Returns
chi2

Definition at line 94 of file JRegressor.hh.

◆ getNPE()

const JNPEs_t & JFIT::JRegressorStorage< JShower3EZ, JSimplex >::getNPE ( ) const
inlineinherited

Get NPEs.

Returns
PDFs

Definition at line 168 of file JShower3EZRegressor.hh.

Member Data Documentation

◆ Vmax_npe

double JFIT::JRegressor< JShower3EZ, JSimplex >::Vmax_npe = std::numeric_limits<double>::max()
static

Maximal integral of PDF [npe].

Default values.

Definition at line 338 of file JShower3EZRegressor.hh.

◆ npe

Definition at line 340 of file JShower3EZRegressor.hh.

◆ estimator

std::shared_ptr<JMEstimator> JFIT::JRegressor< JShower3EZ, JSimplex >::estimator

M-Estimator function.

Definition at line 342 of file JShower3EZRegressor.hh.

◆ NUMBER_OF_PDFS

const int JFIT::JRegressorStorage< JShower3EZ, JSimplex >::NUMBER_OF_PDFS = 2
staticinherited

Definition at line 111 of file JShower3EZRegressor.hh.

◆ pdf_t

const JPDFType_t JFIT::JRegressorStorage< JShower3EZ, JSimplex >::pdf_t
staticinherited
Initial value:
= {
DIRECT_LIGHT_FROM_EMSHOWER,
SCATTERED_LIGHT_FROM_EMSHOWER
}

PDF types.

Definition at line 176 of file JShower3EZRegressor.hh.

◆ T_ns

JTimeRange JFIT::JRegressorStorage< JShower3EZ, JSimplex >::T_ns
inherited

Time window with respect to Cherenkov hypothesis [ns].

Definition at line 177 of file JShower3EZRegressor.hh.

◆ _npe

JNPEs_t JFIT::JRegressorStorage< JShower3EZ, JSimplex >::_npe
privateinherited

PDFs.

Definition at line 180 of file JShower3EZRegressor.hh.


The documentation for this struct was generated from the following file: