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 | List of all members
JFIT::JRegressor< JShowerEH, JSimplex > Struct Reference

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

#include <JShowerBjorkenYRegressor.hh>

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

Public Types

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_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 JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint1FunctionalGridMap >::maplist JMapList_t2
 
typedef JPHYSICS::JPDFTable< JFunction1D_t, JMapList_t2JPDF_t2
 
typedef JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint1FunctionalGridMap >::maplist JNPEMapList_t2
 
typedef JPHYSICS::JNPETable< double, double, JNPEMapList_t2JNPE_t2
 
typedef JSimplex< JShowerEHminimiser_type
 
typedef JRegressor< JShowerEH, JSimplexregressor_type
 
typedef minimiser_type::result_type result_type
 

Public Member Functions

 JRegressor (const std::string &fileDescriptor)
 Parameterized constructor.
 
double operator() (const JShowerEH &shower, const JPMTW0 &pmt) const
 Fit function.
 
double getH0 (const double R_Hz) const
 Get background hypothesis value for time integrated PDF.
 
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.
 
result_type operator() (const JShowerEH &value, T __begin, T __end)
 Global fit.
 

Public Attributes

JNPE_t npe [NUMBER_OF_PDFS-2]
 PDF.
 
JNPE_t2 npe2 [NUMBER_OF_PDFS-2]
 PDF.
 
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 = 4
 
static const JPDFType_t pdf_t [NUMBER_OF_PDFS]
 PDF types.
 

Detailed Description

Regressor function object for JShowerEH fit using JSimplex minimiser.

Definition at line 54 of file JShowerBjorkenYRegressor.hh.

Member Typedef Documentation

◆ JFunction1D_t

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

Definition at line 59 of file JShowerBjorkenYRegressor.hh.

◆ JPDFMaplist_t

typedef JTOOLS::JMapList<JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalGridMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalGridMap> > > > JFIT::JRegressor< JShowerEH, JSimplex >::JPDFMaplist_t

Definition at line 63 of file JShowerBjorkenYRegressor.hh.

◆ JPDF_t

typedef JPHYSICS::JPDFTable<JFunction1D_t, JPDFMaplist_t> JFIT::JRegressor< JShowerEH, JSimplex >::JPDF_t

Definition at line 64 of file JShowerBjorkenYRegressor.hh.

◆ JNPEMaplist_t

typedef JTOOLS::JMapList<JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalGridMap, JTOOLS::JMapList<JTOOLS::JPolint0FunctionalGridMap> > > > JFIT::JRegressor< JShowerEH, JSimplex >::JNPEMaplist_t

Definition at line 69 of file JShowerBjorkenYRegressor.hh.

◆ JNPE_t

typedef JPHYSICS::JNPETable<double, double, JNPEMaplist_t> JFIT::JRegressor< JShowerEH, JSimplex >::JNPE_t

Definition at line 70 of file JShowerBjorkenYRegressor.hh.

◆ JMapList_t2

typedef JTOOLS::JMAPLIST<JTOOLS::JPolint1FunctionalMap,JTOOLS::JPolint1FunctionalGridMap>::maplist JFIT::JRegressor< JShowerEH, JSimplex >::JMapList_t2

Definition at line 75 of file JShowerBjorkenYRegressor.hh.

◆ JPDF_t2

typedef JPHYSICS::JPDFTable<JFunction1D_t, JMapList_t2> JFIT::JRegressor< JShowerEH, JSimplex >::JPDF_t2

Definition at line 76 of file JShowerBjorkenYRegressor.hh.

◆ JNPEMapList_t2

typedef JTOOLS::JMAPLIST<JTOOLS::JPolint1FunctionalMap,JTOOLS::JPolint1FunctionalGridMap>::maplist JFIT::JRegressor< JShowerEH, JSimplex >::JNPEMapList_t2

Definition at line 79 of file JShowerBjorkenYRegressor.hh.

◆ JNPE_t2

typedef JPHYSICS::JNPETable<double, double, JNPEMapList_t2> JFIT::JRegressor< JShowerEH, JSimplex >::JNPE_t2

Definition at line 80 of file JShowerBjorkenYRegressor.hh.

◆ minimiser_type

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

Definition at line 80 of file JRegressor.hh.

◆ regressor_type

typedef JRegressor<JShowerEH , JSimplex > JFIT::JAbstractRegressor< JShowerEH , 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< JShowerEH, 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<JShower3Z, JGandalf>::pdf_t.

Parameters
fileDescriptorPDF file descriptor

Definition at line 92 of file JShowerBjorkenYRegressor.hh.

92 :
93 estimator(new JMEstimatorNull())
94 {
95 using namespace std;
96 using namespace JPP;
97
98 const JPDF_t::JSupervisor supervisor(new JPDF_t::JDefaultResult(JMATH::zero));
99 const JPDF_t2::JSupervisor supervisor2(new JPDF_t2::JDefaultResult(JMATH::zero));
100
101 for (int i = 0; i != NUMBER_OF_PDFS; ++i) {
102
103 try {
104
105 JPDF_t pdf;
106 JPDF_t2 pdf2;
107
108 const string file_name = getFilename(fileDescriptor, pdf_t[i]);
109
110 NOTICE("loading PDF from file " << file_name << "... " << flush);
111
112 if(i < 2){
113
114 pdf.load(file_name.c_str());
115
116 pdf.setExceptionHandler(supervisor);
117
118 npe[ i ] = JNPE_t(pdf);
119
120 } else {
121
122 pdf2.load(file_name.c_str());
123
124 NOTICE("OK" << endl);
125
126 pdf2.setExceptionHandler(supervisor2);
127
128 npe2[ i-2 ] = JNPE_t2(pdf2);
129
130 }
131 }
132 catch(const JException& error) {
133 FATAL(error.what() << endl);
134 }
135 }
136
137 // Add PDFs
138 for (int i = 1; i < (NUMBER_OF_PDFS-2); i += 2) {
139
140 npe[ i ].add(npe[i-1]);
141
142 JNPE_t buffer;
143
144 npe[i-1].swap(buffer);
145
146 npe2[ i ].add(npe2[i-1]);
147
148 JNPE_t2 buffer2;
149
150 npe2[i-1].swap(buffer2);
151
152 }
153 }
static const JPDFType_t pdf_t[NUMBER_OF_PDFS]
PDF types.
JPHYSICS::JPDFTable< JFunction1D_t, JMapList_t2 > JPDF_t2
JLANG::JSharedPointer< JMEstimator > estimator
M-Estimator function.
JPHYSICS::JPDFTable< JFunction1D_t, JPDFMaplist_t > JPDF_t
JPHYSICS::JNPETable< double, double, JNPEMaplist_t > JNPE_t
JPHYSICS::JNPETable< double, double, JNPEMapList_t2 > JNPE_t2

Member Function Documentation

◆ operator()() [1/2]

double JFIT::JRegressor< JShowerEH, JSimplex >::operator() ( const JShowerEH & 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 163 of file JShowerBjorkenYRegressor.hh.

164 {
165 using namespace JPP;
166 using namespace std;
167
168 JPosition3D D(pmt.getPosition());
169 JDirection3D U(pmt.getDirection());
170
171 D.sub(shower.getPosition());
172
173 double ct = U.getDot(D) / D.getLength();
174
175 JVersor3D shower_dir(shower.getDirection());
176
177 const double z = D.getDot(shower_dir);
178 const double x = D.getX() - z * shower.getDX();
179 const double y = D.getY() - z * shower.getDY();
180 const double cosDelta = z/D.getLength(); // Delta = angle between shower direction and PMT position
181
182 U.rotate(JRotation3Z(-atan2(y,x))); // rotate PMT axis to x-z plane
183
184 const double theta = U.getTheta();
185 const double phi = fabs(U.getPhi());
186
187 double H0 = getH0(pmt.getR()); // background
188 double H1 = getH1(D.getLength(), ct, cosDelta, theta, phi,
189 shower.getEem(), shower.getEh(), shower.getBy()); // signal
190
191 if (H1 >= Vmax_npe) {
192 H1 *= Vmax_npe / H1;
193 }
194
195 H1 += H0; // now H1 is signal + background
196
197 const bool hit = pmt.getN() != 0;
198 const double u = getChi2(H1, hit); // -log(lik)
199
200 return estimator->getRho(u);
201 }
double getChi2(const double P)
Get chi2 corresponding to given probability.
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()

double JFIT::JRegressor< JShowerEH, 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 209 of file JShowerBjorkenYRegressor.hh.

210 {
211 return get_value(JNPE_t::result_type(R_Hz * 1e-9 * T_ns.getLength()));
212 }
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
DPMT distance from shower [m]
ctangle between shower direction and PMT position
cosDeltaangle between shower direction and PMT position
thetaPMT zenith angle [deg]
phiPMT azimuth angle [deg]
EemEM shower energy [GeV]
EhH shower energy [GeV]
YBjorken Y
Returns
hypothesis value

Definition at line 227 of file JShowerBjorkenYRegressor.hh.

235 {
236
237 double h1 = 0;
238
239 for (int i = 0; i != (NUMBER_OF_PDFS-1); ++i) {
240
241 if (!npe[i].empty() && D <= npe[i].getXmax() && !npe2[i].empty() && D <= npe2[i].getXmax()) {
242
243 try {
244
245 JNPE_t::result_type P_em;
246 JNPE_t2::result_type P_h;
247
248 P_em = fabs(Eem) * npe[i](std::max(D, npe[i].getXmin()), cosDelta, theta, phi);
249
250 P_h = fabs(Eh) * npe2[i](std::max(D, npe2[i].getXmin()), ct);
251
252 double y1 = get_value(P_em) + get_value(P_h);
253
254 if(y1 > 0.0){
255 h1 += y1;
256 }
257
258 }
259 catch(JLANG::JException& error) {
260 ERROR(error << std::endl);
261 }
262 }
263 }
264
265 return h1;
266 }

◆ operator()() [2/2]

result_type JFIT::JAbstractRegressor< JShowerEH , JSimplex >::operator() ( const JShowerEH & 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< JShowerEH, JSimplex >::T_ns
static

Time window with respect to Cherenkov hypothesis [ns].

Default values.

Definition at line 268 of file JShowerBjorkenYRegressor.hh.

◆ Vmax_npe

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

Maximal integral of PDF [npe].

Definition at line 269 of file JShowerBjorkenYRegressor.hh.

◆ NUMBER_OF_PDFS

const int JFIT::JRegressor< JShowerEH, JSimplex >::NUMBER_OF_PDFS = 4
static

Definition at line 271 of file JShowerBjorkenYRegressor.hh.

◆ pdf_t

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

PDF types.

Definition at line 273 of file JShowerBjorkenYRegressor.hh.

◆ npe

PDF.

Definition at line 275 of file JShowerBjorkenYRegressor.hh.

◆ npe2

PDF.

Definition at line 276 of file JShowerBjorkenYRegressor.hh.

◆ estimator

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

M-Estimator function.

Definition at line 278 of file JShowerBjorkenYRegressor.hh.


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