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 | Static Protected Member Functions | Private Attributes | List of all members
JFIT::JRegressor< JEnergy > Struct Reference

Regressor function object for fit of muon energy. More...

#include <JEnergyRegressor.hh>

Inheritance diagram for JFIT::JRegressor< JEnergy >:
JFIT::JAbstractRegressor< JEnergy > JFIT::JRegressorStorage< JEnergy >

Public Types

typedef JRegressorStorage< JEnergystorage_type
 
typedef JAbstractMinimiser< JEnergyminimiser_type
 
typedef JRegressor< JEnergy, JAbstractMinimiserregressor_type
 
typedef minimiser_type::result_type result_type
 
typedef JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint1FunctionalGridMap, JTOOLS::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
 
typedef JPHYSICS::JNPETable< double, double, JNPEMaplist_tJNPE_t
 time integrated PDF
 
typedef std::vector< JNPE_tJNPEs_t
 NPEs.
 

Public Member Functions

 JRegressor (const std::string &fileDescriptor, const JTimeRange &T_ns=JTimeRange())
 Constructor.
 
 JRegressor (const storage_type &storage)
 Constructor.
 
double operator() (const JEnergy &x, const JNPEHit &npe) const
 Fit function.
 
double getY1 (const JAxis3D &axis) const
 Get number of photo-electrons from muon.
 
double getYA (const JAxis3D &axis) const
 Get number of photo-electrons from delta-rays.
 
double getYB (const JAxis3D &axis) const
 Get number of photo-electrons from Bremsstrahlung.
 
JNPE getNPE (const JAxis3D &axis, const double R_Hz) const
 Create data structure for handling light yields for PMT.
 
double getRmax () const
 Get maximal road width of NPE.
 
const JNPEs_tgetY1 () const
 Get light from muon.
 
const JNPEs_tgetYA () const
 Get light from delta-rays.
 
const JNPEs_tgetYB () const
 Get light from EM showers.
 
result_type operator() (const JEnergy &value, T __begin, T __end)
 Global fit.
 

Public Attributes

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

Static Public Attributes

static const int NUMBER_OF_PDFS = 6
 Number of PDFs.
 
static const JPDFType_t pdf_t [NUMBER_OF_PDFS]
 PDF types.
 

Static Protected Member Functions

static double getRmax (const JNPEs_t &NPE)
 Get maximal road width of PDF.
 
static double getNPE (const JNPEs_t &NPE, const double R, const double theta, const double phi)
 Get number of photo-electrons.
 

Private Attributes

JNPEs_t _Y1
 light from muon
 
JNPEs_t _YA
 light from delta-rays
 
JNPEs_t _YB
 light from EM showers
 

Detailed Description

Regressor function object for fit of muon energy.

Definition at line 180 of file JEnergyRegressor.hh.

Member Typedef Documentation

◆ storage_type

Definition at line 186 of file JEnergyRegressor.hh.

◆ minimiser_type

Definition at line 80 of file JRegressor.hh.

◆ regressor_type

Definition at line 81 of file JRegressor.hh.

◆ result_type

Definition at line 82 of file JRegressor.hh.

◆ JNPEMaplist_t

typedef JTOOLS::JMAPLIST<JTOOLS::JPolint1FunctionalMap,JTOOLS::JPolint1FunctionalGridMap,JTOOLS::JPolint1FunctionalGridMap>::maplist JFIT::JRegressorStorage< JEnergy >::JNPEMaplist_t
inherited

Definition at line 55 of file JEnergyRegressor.hh.

◆ JNPE_t

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

time integrated PDF

Definition at line 56 of file JEnergyRegressor.hh.

◆ JNPEs_t

typedef std::vector<JNPE_t> JFIT::JRegressorStorage< JEnergy >::JNPEs_t
inherited

NPEs.

Definition at line 60 of file JEnergyRegressor.hh.

Constructor & Destructor Documentation

◆ JRegressor() [1/2]

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

Constructor.

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

Parameters
fileDescriptorPDF file descriptor
T_nstime range [ns]

Definition at line 202 of file JEnergyRegressor.hh.

202 :
203 storage_type(fileDescriptor, T_ns),
204 Y1(getY1()),
205 YA(getYA()),
206 YB(getYB()),
207 estimator(new JMEstimatorNormal())
208 {}
JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
JRegressorStorage< JEnergy > storage_type
const JNPEs_t & getYB() const
Get light from EM showers.
std::shared_ptr< JMEstimator > estimator
M-Estimator function.
const JNPEs_t & getY1() const
Get light from muon.
const JNPEs_t & getYA() const
Get light from delta-rays.

◆ JRegressor() [2/2]

JFIT::JRegressor< JEnergy >::JRegressor ( const storage_type & storage)
inline

Constructor.

Parameters
storagePDF storage

Definition at line 216 of file JEnergyRegressor.hh.

216 :
217 Y1(storage.getY1()),
218 YA(storage.getYA()),
219 YB(storage.getYB()),
220 estimator(new JMEstimatorNormal())
221 {
222 T_ns = storage.T_ns;
223 }

Member Function Documentation

◆ operator()() [1/2]

double JFIT::JRegressor< JEnergy >::operator() ( const JEnergy & x,
const JNPEHit & npe ) const
inline

Fit function.

This method is used to determine chi2 of given number of photo-electrons for given energy of muon.

Parameters
xenergy
npenpe
Returns
chi2

Definition at line 234 of file JEnergyRegressor.hh.

235 {
236 const double E = x.getE();
237 const double u = npe.getChi2(E);
238
239 return estimator->getRho(u);
240 }

◆ getY1() [1/2]

double JFIT::JRegressor< JEnergy >::getY1 ( const JAxis3D & axis) const
inline

Get number of photo-electrons from muon.

Note that the PMT geometry should be relative to the muon trajectory, conform method JGEOMETRY3D::JAxis3D::transform.

Parameters
axisPMT axis
Returns
npe

Definition at line 251 of file JEnergyRegressor.hh.

252 {
253 return getNPE(Y1, hypot(axis.getX(), axis.getY()), axis.getTheta(), fabs(axis.getPhi()));
254 }
JNPE getNPE(const JAxis3D &axis, const double R_Hz) const
Create data structure for handling light yields for PMT.

◆ getYA() [1/2]

double JFIT::JRegressor< JEnergy >::getYA ( const JAxis3D & axis) const
inline

Get number of photo-electrons from delta-rays.

Note that the PMT geometry should be relative to the muon trajectory, conform method JGEOMETRY3D::JAxis3D::transform.

Parameters
axisPMT axis
Returns
npe

Definition at line 265 of file JEnergyRegressor.hh.

266 {
267 return getNPE(YA, hypot(axis.getX(), axis.getY()), axis.getTheta(), fabs(axis.getPhi()));
268 }

◆ getYB() [1/2]

double JFIT::JRegressor< JEnergy >::getYB ( const JAxis3D & axis) const
inline

Get number of photo-electrons from Bremsstrahlung.

Note that the PMT geometry should be relative to the muon trajectory, conform method JGEOMETRY3D::JAxis3D::transform.

Parameters
axisPMT axis
Returns
npe

Definition at line 279 of file JEnergyRegressor.hh.

280 {
281 return getNPE(YB, hypot(axis.getX(), axis.getY()), axis.getTheta(), fabs(axis.getPhi()));
282 }

◆ getNPE() [1/2]

JNPE JFIT::JRegressor< JEnergy >::getNPE ( const JAxis3D & axis,
const double R_Hz ) const
inline

Create data structure for handling light yields for PMT.

Note that the PMT geometry should be relative to the muon trajectory, conform method JGEOMETRY3D::JAxis3D::transform.

Parameters
axisPMT axis
R_Hzsingles rate [Hz]
Returns
light yields

Definition at line 294 of file JEnergyRegressor.hh.

296 {
297 using namespace std;
298 using namespace JPP;
299
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();
304
305 const double theta = axis.getTheta();
306 const double phi = fabs(axis.getPhi());
307
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);
311
312 return JNPE(getN(T_ns, R_Hz * 1.0e-9), y1, yA, yB, z);
313 }
Auxiliary class for handling various light yields.
Definition JNPE.hh:31

◆ getRmax() [1/2]

double JFIT::JRegressor< JEnergy >::getRmax ( ) const
inline

Get maximal road width of NPE.

Returns
road width [m]

Definition at line 321 of file JEnergyRegressor.hh.

322 {
323 return std::max(getRmax(Y1), std::max(getRmax(YA), getRmax(YB)));
324 }
double getRmax() const
Get maximal road width of NPE.

◆ getRmax() [2/2]

static double JFIT::JRegressor< JEnergy >::getRmax ( const JNPEs_t & NPE)
inlinestaticprotected

Get maximal road width of PDF.

Parameters
NPENPE tables
Returns
road width [m]

Definition at line 340 of file JEnergyRegressor.hh.

341 {
342 double xmax = 0.0;
343
344 for (JNPEs_t::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
345 if (!i->empty() && i->getXmax() > xmax) {
346 xmax = i->getXmax();
347 }
348 }
349
350 return xmax;
351 }

◆ getNPE() [2/2]

static double JFIT::JRegressor< JEnergy >::getNPE ( const JNPEs_t & NPE,
const double R,
const double theta,
const double phi )
inlinestaticprotected

Get number of photo-electrons.

Parameters
NPENPE tables
Rdistance between muon and PMT [m]
thetazenith angle orientation PMT [rad]
phiazimuth angle orientation PMT [rad]
Returns
number of photo-electrons

Definition at line 363 of file JEnergyRegressor.hh.

367 {
368 using JTOOLS::get_value;
369
370 double npe = 0.0;
371
372 for (JNPEs_t::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
373
374 if (R <= i->getXmax()) {
375
376 try {
377
378 const double y = get_value((*i)(std::max(R, i->getXmin()), theta, phi));
379
380 if (y > 0.0) {
381 npe += y;
382 }
383 }
384 catch(const JLANG::JException& error) {
385 ERROR(error << std::endl);
386 }
387 }
388 }
389
390 return npe;
391 }

◆ getY1() [2/2]

const JNPEs_t & JFIT::JRegressorStorage< JEnergy >::getY1 ( ) const
inline

Get light from muon.

Returns
NPEs

Definition at line 122 of file JEnergyRegressor.hh.

123 {
124 return _Y1;
125 }

◆ getYA() [2/2]

const JNPEs_t & JFIT::JRegressorStorage< JEnergy >::getYA ( ) const
inline

Get light from delta-rays.

Returns
NPEs

Definition at line 133 of file JEnergyRegressor.hh.

134 {
135 return _YA;
136 }
JNPEs_t _YA
light from delta-rays

◆ getYB() [2/2]

const JNPEs_t & JFIT::JRegressorStorage< JEnergy >::getYB ( ) const
inline

Get light from EM showers.

Returns
NPEs

Definition at line 144 of file JEnergyRegressor.hh.

145 {
146 return _YB;
147 }
JNPEs_t _YB
light from EM showers

◆ operator()() [2/2]

result_type JFIT::JAbstractRegressor< JEnergy , JAbstractMinimiser >::operator() ( const JEnergy & 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.

Member Data Documentation

◆ Y1

PDF.

Definition at line 327 of file JEnergyRegressor.hh.

◆ YA

PDF.

Definition at line 328 of file JEnergyRegressor.hh.

◆ YB

PDF.

Definition at line 329 of file JEnergyRegressor.hh.

◆ estimator

std::shared_ptr<JMEstimator> JFIT::JRegressor< JEnergy >::estimator

M-Estimator function.

Definition at line 331 of file JEnergyRegressor.hh.

◆ NUMBER_OF_PDFS

const int JFIT::JRegressorStorage< JEnergy >::NUMBER_OF_PDFS = 6
staticinherited

Number of PDFs.

Definition at line 58 of file JEnergyRegressor.hh.

◆ pdf_t

const JPDFType_t JFIT::JRegressorStorage< JEnergy >::pdf_t
staticinherited
Initial value:
= { DIRECT_LIGHT_FROM_MUON,
SCATTERED_LIGHT_FROM_MUON,
DIRECT_LIGHT_FROM_DELTARAYS,
SCATTERED_LIGHT_FROM_DELTARAYS,
DIRECT_LIGHT_FROM_EMSHOWERS,
SCATTERED_LIGHT_FROM_EMSHOWERS }

PDF types.

Definition at line 153 of file JEnergyRegressor.hh.

◆ T_ns

JTimeRange JFIT::JRegressorStorage< JEnergy >::T_ns
inherited

Time window with respect to Cherenkov hypothesis [ns].

Definition at line 155 of file JEnergyRegressor.hh.

◆ _Y1

JNPEs_t JFIT::JRegressorStorage< JEnergy >::_Y1
privateinherited

light from muon

Definition at line 158 of file JEnergyRegressor.hh.

◆ _YA

JNPEs_t JFIT::JRegressorStorage< JEnergy >::_YA
privateinherited

light from delta-rays

Definition at line 159 of file JEnergyRegressor.hh.

◆ _YB

JNPEs_t JFIT::JRegressorStorage< JEnergy >::_YB
privateinherited

light from EM showers

Definition at line 160 of file JEnergyRegressor.hh.


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