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

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

#include <JShowerEnergyRegressor.hh>

Inheritance diagram for JFIT::JRegressor< JEnergy, JSimplex >:
JFIT::JAbstractRegressor< JEnergy, JSimplex >

Public Types

typedef JTOOLS::JSplineFunction1S_t JFunction1D_t
 
typedef JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint1FunctionalGridMap >::maplist JMapList_t
 
typedef JPHYSICS::JPDFTable< JFunction1D_t, JMapList_tJPDF_t
 
typedef JPHYSICS::JNPETable< double, double, JMapList_tJNPE_t
 
typedef JSimplex< JEnergyminimiser_type
 
typedef JRegressor< JEnergy, JSimplexregressor_type
 
typedef minimiser_type::result_type result_type
 

Public Member Functions

 JRegressor (const std::string &fileDescriptor)
 Parameterized constructor.
 
double operator() (const JEnergy &x, const JShowerNPEHit &npe) const
 Fit function.
 
JShowerNPE getNPE (const JAxis3D &axis, const double R_Hz) const
 Create data structure for handling light yields for PMT.
 
result_type operator() (const JEnergy &value, T __begin, T __end)
 Global fit.
 

Static Public Member Functions

static double getNPE (const std::vector< JNPE_t > &NPE, const double D, const double cd)
 Get number of photo-electrons.
 

Public Attributes

std::vector< JNPE_tY
 light from EM showers
 
JLANG::JSharedPointer< JMEstimatorestimator
 M-Estimator function.
 

Static Public Attributes

static JTimeRange T_ns
 Time window with respect to Cherenkov hypothesis [ns].
 
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.
 

Detailed Description

Regressor function object for JShower3EZ fit using JSimplex minimiser.

Definition at line 51 of file JShowerEnergyRegressor.hh.

Member Typedef Documentation

◆ JFunction1D_t

typedef JTOOLS::JSplineFunction1S_t JFIT::JRegressor< JEnergy, JSimplex >::JFunction1D_t

Definition at line 56 of file JShowerEnergyRegressor.hh.

◆ JMapList_t

typedef JTOOLS::JMAPLIST<JTOOLS::JPolint1FunctionalMap,JTOOLS::JPolint1FunctionalGridMap>::maplist JFIT::JRegressor< JEnergy, JSimplex >::JMapList_t

Definition at line 58 of file JShowerEnergyRegressor.hh.

◆ JPDF_t

typedef JPHYSICS::JPDFTable<JFunction1D_t, JMapList_t> JFIT::JRegressor< JEnergy, JSimplex >::JPDF_t

Definition at line 59 of file JShowerEnergyRegressor.hh.

◆ JNPE_t

typedef JPHYSICS::JNPETable<double, double, JMapList_t> JFIT::JRegressor< JEnergy, JSimplex >::JNPE_t

Definition at line 61 of file JShowerEnergyRegressor.hh.

◆ minimiser_type

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

Definition at line 80 of file JRegressor.hh.

◆ regressor_type

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

Definition at line 81 of file JRegressor.hh.

◆ result_type

Definition at line 82 of file JRegressor.hh.

Constructor & Destructor Documentation

◆ JRegressor()

JFIT::JRegressor< JEnergy, JSimplex >::JRegressor ( const std::string & fileDescriptor)
inline

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<JEnergy, JSimplex>::pdf_t.

Parameters
fileDescriptorPDF file descriptor

Definition at line 72 of file JShowerEnergyRegressor.hh.

72 :
73 estimator(new JMEstimatorNull())
74 {
75 using namespace std;
76 using namespace JPP;
77
78
79 const JPDF_t::JSupervisor supervisor(new JPDF_t::JDefaultResult(JMATH::zero));
80
81 for (int i = 0; i != NUMBER_OF_PDFS; ++i) {
82
83 try {
84
85 JPDF_t pdf;
86
87 const string file_name = getFilename(fileDescriptor, pdf_t[i]);
88
89 NOTICE("loading PDF from file " << file_name << "... " << flush);
90
91 pdf.load(file_name.c_str());
92
93 NOTICE("OK" << endl);
94
95 pdf.setExceptionHandler(supervisor);
96
97 Y.push_back(JNPE_t(pdf));
98 }
99 catch(const JException& error) {
100 FATAL(error.what() << endl);
101 }
102 }
103
104 // Add PDFs
105
106 for (int i = 1; i < NUMBER_OF_PDFS; i += 2) {
107 Y[i].add(Y[i-1]);
108 }
109
110 Y.erase(Y.begin());
111 }
static const JPDFType_t pdf_t[NUMBER_OF_PDFS]
PDF types.
JPHYSICS::JNPETable< double, double, JMapList_t > JNPE_t
JPHYSICS::JPDFTable< JFunction1D_t, JMapList_t > JPDF_t
std::vector< JNPE_t > Y
light from EM showers
JLANG::JSharedPointer< JMEstimator > estimator
M-Estimator function.

Member Function Documentation

◆ operator()() [1/2]

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

Fit function.

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

Parameters
xenergy
npenumber of photoelectrons
Returns
chi2

Definition at line 121 of file JShowerEnergyRegressor.hh.

122 {
123 using namespace JPP;
124
125 const double E = x.getE();
126 const double u = npe.getChi2(E);
127
128 return estimator->getRho(u);
129 }

◆ getNPE() [1/2]

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

Create data structure for handling light yields for PMT.

Parameters
axisPMT axis
R_Hzsingles rate [Hz]
Returns
light yields

Definition at line 138 of file JShowerEnergyRegressor.hh.

140 {
141 using namespace JPP;
142
143 const JPosition3D D(axis.getPosition());
144 const JDirection3D U(axis.getDirection());
145
146 const double U_length = std::sqrt(U.getDX()*U.getDX() +
147 U.getDY()*U.getDY() +
148 U.getDZ()*U.getDZ());
149
150 const double ct = U.getDot(D) / (D.getLength()*U_length);
151
152 const double y = getNPE(Y, D.getLength(), ct);
153
154 return JShowerNPE(getN(T_ns, R_Hz * 1.0e-9), y);
155 }
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
JShowerNPE getNPE(const JAxis3D &axis, const double R_Hz) const
Create data structure for handling light yields for PMT.
Auxiliary class for handling EM shower light yield.
Definition JShowerNPE.hh:27

◆ getNPE() [2/2]

static double JFIT::JRegressor< JEnergy, JSimplex >::getNPE ( const std::vector< JNPE_t > & NPE,
const double D,
const double cd )
inlinestatic

Get number of photo-electrons.

Parameters
NPENPE tables
DPMT distance from shower [m]
cdcosine of the PMT angle wrt the photon direction
Returns
number of photo-electrons

Definition at line 166 of file JShowerEnergyRegressor.hh.

169 {
170 double npe = 0.0;
171
172 for (std::vector<JNPE_t>::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
173
174 if (D <= i->getXmax()) {
175
176 try {
177
178 const double y = get_value((*i)(std::max(D, i->getXmin()), cd));
179
180 if (y > 0.0) {
181 npe += y;
182 }
183 }
184 catch(const JLANG::JException& error) {
185 ERROR(error << std::endl);
186 }
187 }
188 }
189
190 return npe;
191 }

◆ operator()() [2/2]

result_type JFIT::JAbstractRegressor< JEnergy , JSimplex >::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

◆ T_ns

JTimeRange JFIT::JRegressor< JEnergy, JSimplex >::T_ns
static

Time window with respect to Cherenkov hypothesis [ns].

Default values.

Definition at line 194 of file JShowerEnergyRegressor.hh.

◆ Vmax_npe

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

Maximal integral of PDF [npe].

Definition at line 195 of file JShowerEnergyRegressor.hh.

◆ NUMBER_OF_PDFS

const int JFIT::JRegressor< JEnergy, JSimplex >::NUMBER_OF_PDFS = 2
static

Definition at line 197 of file JShowerEnergyRegressor.hh.

◆ pdf_t

const JPDFType_t JFIT::JRegressor< JEnergy, JSimplex >::pdf_t
static
Initial value:
= { DIRECT_LIGHT_FROM_BRIGHT_POINT,
SCATTERED_LIGHT_FROM_BRIGHT_POINT }

PDF types.

Definition at line 199 of file JShowerEnergyRegressor.hh.

◆ Y

std::vector<JNPE_t> JFIT::JRegressor< JEnergy, JSimplex >::Y

light from EM showers

Definition at line 201 of file JShowerEnergyRegressor.hh.

◆ estimator

JLANG::JSharedPointer<JMEstimator> JFIT::JRegressor< JEnergy, JSimplex >::estimator

M-Estimator function.

Definition at line 203 of file JShowerEnergyRegressor.hh.


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