Jpp
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
JFIT::JRegressor< JLine3Z, JGandalf > Struct Template Reference

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

#include <JLine3ZRegressor.hh>

Inheritance diagram for JFIT::JRegressor< JLine3Z, JGandalf >:
JFIT::JAbstractRegressor< JLine3Z, JGandalf > JFIT::JGandalf< JLine3Z > JEEP::JMessage< JGandalf< JLine3Z > >

Public Types

typedef JTOOLS::JSplineFunction1S_t JFunction1D_t
 
typedef JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMap, JTOOLS::JPolint0FunctionalGridMap, JTOOLS::JPolint0FunctionalGridMap >::maplist JPDFMaplist_t
 
typedef JPHYSICS::JPDFTable< JFunction1D_t, JPDFMaplist_tJPDF_t
 time dependent PDF More...
 
typedef JTOOLS::JMAPLIST< JTOOLS::JPolint1FunctionalMapH, JTOOLS::JPolint1FunctionalGridMap, JTOOLS::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
 
typedef JPHYSICS::JNPETable< double, double, JNPEMaplist_tJNPE_t
 time integrated PDF More...
 
typedef JGandalf< JLine3Zminimiser_type
 
typedef JRegressor< JLine3Z, JGandalfregressor_type
 
typedef minimiser_type::result_type result_type
 
typedef JLine3Z ::parameter_type parameter_type
 Data type of fit parameter. More...
 

Public Member Functions

 JRegressor ()
 Default constructor. More...
 
 JRegressor (const std::string &fileDescriptor, const double TTS, const int numberOfPoints=25, const double epsilon=1.0e-10)
 Constructor. More...
 
template<class JHit_t >
result_type operator() (const JLine3Z &track, const JHit_t &hit) const
 Fit function. More...
 
result_type operator() (const JLine3Z &track, const JPMTW0 &pmt) const
 Fit function. More...
 
JPDF_t::result_type getH0 (const double R_Hz, const double t1) const
 Get background hypothesis value for time differentiated PDF. More...
 
JPDF_t::result_type getH1 (const double E, const double R, const double theta, const double phi, const double t1) const
 Get signal hypothesis value for time differentiated PDF. More...
 
JNPE_t::result_type getH0 (const double R_Hz) const
 Get background hypothesis value for time integrated PDF. More...
 
JNPE_t::result_type getH1 (const double E, const double R, const double theta, const double phi) const
 Get signal hypothesis value for time integrated PDF. More...
 
void compress (const JRange< typename JFunction1D_t::abscissa_type > &R_compress)
 Compresses PDFs to abscissa range specified by R_compress. More...
 
double getRmax () const
 Get maximal road width of PDF. More...
 
result_type operator() (const JLine3Z &value, T __begin, T __end)
 Global fit. More...
 
result_type operator() (const JLine3Z &value, T1 __begin1, T1 __end1, T2 __begin2, T2 __end2)
 Global fit. More...
 
result_type operator() (const JFunction_t &fit, T1 __begin1, T1 __end1, T2 __begin2, T2 __end2)
 Multi-dimensional fit of two data sets. More...
 
result_type operator() (const JFunction_t &fit, T __begin, T __end)
 Multi-dimensional fit of one data set. More...
 

Public Attributes

JPDF_t pdf [NUMBER_OF_PDFS]
 PDF. More...
 
JNPE_t npe [NUMBER_OF_PDFS]
 PDF. More...
 
double E_GeV
 Energy of muon at vertex [GeV]. More...
 
JLANG::JSharedPointer< JMEstimatorestimator
 M-Estimator function. More...
 
double lambda
 
JLine3Z value
 
JLine3Z error
 
std::vector< parameter_typeparameters
 
int numberOfIterations
 
JMATH::JMatrixNS H
 

Static Public Attributes

static JTimeRange T_ns
 Time window with respect to Cherenkov hypothesis [ns]. More...
 
static double Vmax_npe = std::numeric_limits<double>::max()
 Maximal integral of PDF [npe]. More...
 
static const int NUMBER_OF_PDFS = 4
 
static const JPDFType_t pdf_t [NUMBER_OF_PDFS]
 PDF types. More...
 
static int MAXIMUM_ITERATIONS
 maximal number of iterations More...
 
static double EPSILON
 maximal distance to minimum More...
 
static double LAMBDA_MIN
 minimal value control parameter More...
 
static double LAMBDA_MAX
 maximal value control parameter More...
 
static double LAMBDA_UP
 multiplication factor control parameter More...
 
static double LAMBDA_DOWN
 multiplication factor control parameter More...
 
static double PIVOT
 minimal value diagonal element of matrix More...
 
static int debug
 debug level (default is off). More...
 

Private Member Functions

void reset ()
 Reset. More...
 
void evaluate (const JFunction_t &fit, T __begin, T __end)
 Evaluate fit for given data set. More...
 

Private Attributes

result_type successor
 
JLine3Z previous
 
std::vector< double > h
 

Detailed Description

template<>
struct JFIT::JRegressor< JLine3Z, JGandalf >

Regressor function object for JLine3Z fit using JGandalf minimiser.

Definition at line 111 of file JLine3ZRegressor.hh.

Member Typedef Documentation

◆ JFunction1D_t

Definition at line 116 of file JLine3ZRegressor.hh.

◆ JPDFMaplist_t

Definition at line 119 of file JLine3ZRegressor.hh.

◆ JPDF_t

time dependent PDF

Definition at line 120 of file JLine3ZRegressor.hh.

◆ JNPEMaplist_t

Definition at line 124 of file JLine3ZRegressor.hh.

◆ JNPE_t

time integrated PDF

Definition at line 125 of file JLine3ZRegressor.hh.

◆ minimiser_type

Definition at line 78 of file JRegressor.hh.

◆ regressor_type

Definition at line 79 of file JRegressor.hh.

◆ result_type

typedef minimiser_type::result_type JFIT::JAbstractRegressor< JLine3Z , JGandalf >::result_type
inherited

Definition at line 80 of file JRegressor.hh.

◆ parameter_type

Data type of fit parameter.

Definition at line 56 of file JGandalf.hh.

Constructor & Destructor Documentation

◆ JRegressor() [1/2]

Default constructor.

Definition at line 130 of file JLine3ZRegressor.hh.

131  {};

◆ JRegressor() [2/2]

JFIT::JRegressor< JLine3Z, JGandalf >::JRegressor ( const std::string &  fileDescriptor,
const double  TTS,
const int  numberOfPoints = 25,
const double  epsilon = 1.0e-10 
)
inline

Constructor.

The PDF file descriptor should contain the wild card character JPHYSICS::WILD_CARD which will be replaced by the corresponding PDF types listed in JRegressor<JLine3Z, JGandalf>::pdf_t.

The TTS corresponds to the additional time smearing applied to the PDFs.

Parameters
fileDescriptorPDF file descriptor
TTSTTS [ns]
numberOfPointsnumber of points for Gauss-Hermite integration of TTS
epsilonprecision for Gauss-Hermite integration of TTS

Definition at line 147 of file JLine3ZRegressor.hh.

150  :
151  E_GeV(0.0),
153  {
154  using namespace std;
155  using namespace JPP;
156 
157  const JPDF_t::JSupervisor supervisor(new JPDF_t::JDefaultResult(JMATH::zero));
158 
159  for (int i = 0; i != NUMBER_OF_PDFS; ++i) {
160 
161  try {
162 
163  const string file_name = getFilename(fileDescriptor, pdf_t[i]);
164 
165  NOTICE("loading PDF from file " << file_name << "... " << flush);
166 
167  pdf[i].load(file_name.c_str());
168 
169  NOTICE("OK" << endl);
170 
171  pdf[i].setExceptionHandler(supervisor);
172 
173  if (TTS > 0.0) {
174  pdf[i].blur(TTS, numberOfPoints, epsilon);
175  } else if (TTS < 0.0) {
176  ERROR("Illegal value of TTS [ns]: " << TTS << endl);
177  }
178  }
179  catch(const JException& error) {
180  FATAL(error.what() << endl);
181  }
182  }
183 
184  // Add PDFs
185 
186  for (int i = 1; i < NUMBER_OF_PDFS; i += 2) {
187 
188  pdf[ i ].add(pdf[i-1]);
189  pdf[i-1].clear();
190 
191  npe[ i ] = JNPE_t(pdf[i]);
192  }
193  }

Member Function Documentation

◆ operator()() [1/6]

template<class JHit_t >
result_type JFIT::JRegressor< JLine3Z, JGandalf >::operator() ( const JLine3Z track,
const JHit_t hit 
) const
inline

Fit function.

This method is used to determine the chi2 and gradient of given hit with respect to trajectory of muon.

The template argument JHit_t refers to a data structure which should have the following member methods:

  • double getX(); // [m]
  • double getY(); // [m]
  • double getZ(); // [m]
  • double getDX(); // [u]
  • double getDY(); // [u]
  • double getDZ(); // [u]
  • double getT(); // [ns]
Parameters
tracktrack
hithit
Returns
chi2 and gradient

Definition at line 214 of file JLine3ZRegressor.hh.

215  {
216  using namespace JPP;
217 
218  JPosition3D D(hit.getX(), hit.getY(), hit.getZ());
219  JDirection3D U(hit.getDX(), hit.getDY(), hit.getDZ());
220 
221  D.sub(track.getPosition());
222 
223  const double z = D.getDot(track.getDirection());
224  const double x = D.getX() - z * track.getDX();
225  const double y = D.getY() - z * track.getDY();
226  const double R = sqrt(D.getLengthSquared() - z*z);
227 
228  const double t1 = track.getT() + (z + R * getTanThetaC()) * getInverseSpeedOfLight();
229 
230  U.rotate(JRotation3Z(-atan2(y,x))); // rotate PMT axis to x-z plane
231 
232  const double theta = U.getTheta();
233  const double phi = fabs(U.getPhi());
234 
235  const double E = gWater.getE(E_GeV, z);
236  const double dt = T_ns.constrain(hit.getT() - t1);
237 
238  JPDF_t::result_type H0 = getH0(hit.getR(), dt);
239  JPDF_t::result_type H1 = getH1(E, R, theta, phi, dt);
240 
241  if (H1.V >= Vmax_npe) {
242  H1 *= Vmax_npe / H1.V;
243  }
244 
245  H1 += H0; // signal + background
246 
248 
249  result.chi2 = H1.getChi2() - H0.getChi2(); // Likelihood ratio
250 
251  const double wc = 1.0 - getTanThetaC() * z / R; // d(ct1)/d(z)
252 
253  result.gradient = JLine3Z(JLine1Z(JPosition3D(-getTanThetaC() * D.getX() / R, // d(ct1)/d(x)
254  -getTanThetaC() * D.getY() / R, // d(ct1)/d(y)
255  0.0),
256  getSpeedOfLight()), // d(ct1)/d(t)
257  JVersor3Z(wc * (D.getX() - D.getZ()*track.getDX()/track.getDZ()), // d(ct1)/d(dx)
258  wc * (D.getY() - D.getZ()*track.getDY()/track.getDZ()))); // d(ct1)/d(dy)
259 
260  result.gradient.mul(getInverseSpeedOfLight() * (H1.getDerivativeOfChi2() -
261  H0.getDerivativeOfChi2())); // x d(chi2)/d(ct1)
262 
263  return result;
264  }

◆ operator()() [2/6]

result_type JFIT::JRegressor< JLine3Z, JGandalf >::operator() ( const JLine3Z track,
const JPMTW0 pmt 
) const
inline

Fit function.

This method is used to determine the chi2 and gradient of given PMT with respect to trajectory of muon.

Parameters
tracktrack
pmtpmt
Returns
chi2 and gradient

Definition at line 275 of file JLine3ZRegressor.hh.

276  {
277  using namespace JGEOMETRY3D;
278  using namespace JPHYSICS;
279 
280  JPosition3D D(pmt.getPosition());
281  JDirection3D U(pmt.getDirection());
282 
283  D.sub(track.getPosition());
284 
285  const double z = D.getDot(track.getDirection());
286  const double x = D.getX() - z * track.getDX();
287  const double y = D.getY() - z * track.getDY();
288  const double R = sqrt(D.getLengthSquared() - z*z);
289 
290  U.rotate(JRotation3Z(-atan2(y,x))); // rotate PMT axis to x-z plane
291 
292  const double theta = U.getTheta();
293  const double phi = fabs(U.getPhi());
294 
295  const double E = gWater.getE(E_GeV, z);
296 
297  JNPE_t::result_type H0 = getH0(pmt.getR());
298  JNPE_t::result_type H1 = getH1(E, R, theta, phi);
299 
300  if (H1.f >= Vmax_npe) {
301  H1 *= Vmax_npe / H1.f;
302  }
303 
304  H1 += H0;
305 
306  const bool hit = pmt.getN() != 0;
307  const double u = H1.getChi2(hit);
308 
310 
311  result.chi2 = estimator->getRho(u);
312 
313  result.gradient = JLine3Z(JLine1Z(JPosition3D(-D.getX() / R, // d(R)/d(x)
314  -D.getY() / R, // d(R)/d(y)
315  0.0),
316  0.0),
317  JVersor3Z(-z * D.getX() / R, // d(R)/d(dx)
318  -z * D.getY() / R)); // d(R)/d(dy)
319 
320  result.gradient.mul(estimator->getPsi(u));
321  result.gradient.mul(H1.getDerivativeOfChi2(hit)); // x d(chi2)/d(R)
322 
323  return result;
324  }

◆ getH0() [1/2]

JPDF_t::result_type JFIT::JRegressor< JLine3Z, JGandalf >::getH0 ( const double  R_Hz,
const double  t1 
) const
inline

Get background hypothesis value for time differentiated PDF.

Parameters
R_Hzrate [Hz]
t1time [ns]
Returns
hypothesis value

Definition at line 334 of file JLine3ZRegressor.hh.

336  {
337  return JPDF_t::result_type(R_Hz * 1e-9, t1, T_ns);
338  }

◆ getH1() [1/2]

JPDF_t::result_type JFIT::JRegressor< JLine3Z, JGandalf >::getH1 ( const double  E,
const double  R,
const double  theta,
const double  phi,
const double  t1 
) const
inline

Get signal hypothesis value for time differentiated PDF.

Parameters
Emuon energy at minimum distance of approach [GeV]
Rminimum distance of approach [m]
thetaPMT zenith angle [rad]
phiPMT azimuth angle [rad]
t1arrival time relative to Cherenkov hypothesis [ns]
Returns
hypothesis value

Definition at line 351 of file JLine3ZRegressor.hh.

356  {
357  using namespace std;
358  using namespace JPP;
359 
360  JPDF_t::result_type h1 = zero;
361 
362  for (int i = 0; i != NUMBER_OF_PDFS; ++i) {
363 
364  if (!pdf[i].empty() && R <= pdf[i].getXmax()) {
365 
366  JPDF_t::result_type y1 = pdf[i](max(R, pdf[i].getXmin()), theta, phi, t1);
367 
368  // safety measures
369 
370  if (y1.f <= 0.0) {
371  y1.f = 0.0;
372  y1.fp = 0.0;
373  }
374 
375  if (y1.v <= 0.0) {
376  y1.v = 0.0;
377  }
378 
379  // energy dependence
380 
381  if (is_deltarays(pdf_t[i])) {
382  y1 *= getDeltaRaysFromMuon(E);
383  } else if (is_bremsstrahlung(pdf_t[i])) {
384  y1 *= E;
385  }
386 
387  h1 += y1;
388  }
389  }
390 
391  return h1;
392  }

◆ getH0() [2/2]

JNPE_t::result_type JFIT::JRegressor< JLine3Z, JGandalf >::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 401 of file JLine3ZRegressor.hh.

402  {
403  return JNPE_t::result_type(R_Hz * 1e-9 * T_ns.getLength(), 0.0);
404  }

◆ getH1() [2/2]

JNPE_t::result_type JFIT::JRegressor< JLine3Z, JGandalf >::getH1 ( const double  E,
const double  R,
const double  theta,
const double  phi 
) const
inline

Get signal hypothesis value for time integrated PDF.

Parameters
Emuon energy at minimum distance of approach [GeV]
Rminimum distance of approach [m]
thetaPMT zenith angle [rad]
phiPMT azimuth angle [rad]
Returns
hypothesis value

Definition at line 416 of file JLine3ZRegressor.hh.

420  {
421  using namespace std;
422  using namespace JPP;
423 
424  JNPE_t::result_type h1 = JMATH::zero;
425 
426  for (int i = 0; i != NUMBER_OF_PDFS; ++i) {
427 
428  if (!npe[i].empty() && R <= npe[i].getXmax()) {
429 
430  try {
431 
432  JNPE_t::result_type y1 = npe[i](max(R, npe[i].getXmin()), theta, phi);
433 
434  // safety measures
435 
436  if (y1.f > 0.0) {
437 
438  // energy dependence
439 
440  if (is_deltarays(pdf_t[i])) {
441  y1 *= getDeltaRaysFromMuon(E);
442  } else if (is_bremsstrahlung(pdf_t[i])) {
443  y1 *= E;
444  }
445 
446  h1 += y1;
447  }
448  }
449  catch(JException& error) {
450  ERROR(error << endl);
451  }
452  }
453  }
454 
455  return h1;
456  }

◆ compress()

void JFIT::JRegressor< JLine3Z, JGandalf >::compress ( const JRange< typename JFunction1D_t::abscissa_type > &  R_compress)
inline

Compresses PDFs to abscissa range specified by R_compress.

Parameters
R_compressCompression Range [abscissa_type of 0-th dim. in PDF table]

Definition at line 464 of file JLine3ZRegressor.hh.

465  {
466  using namespace std;
467 
468  NOTICE("Compressing PDFs to " << R_compress.getLowerLimit() << " " << R_compress.getUpperLimit() << endl);
469 
470  for (int i = 0; i != NUMBER_OF_PDFS; ++i) {
471  if (!pdf[i].empty() && R_compress.is_valid()) {
472  pdf[ i ].compress(R_compress);
473  }
474  }
475 
476  }

◆ getRmax()

double JFIT::JRegressor< JLine3Z, JGandalf >::getRmax ( ) const
inline

Get maximal road width of PDF.

Returns
road width [m]

Definition at line 484 of file JLine3ZRegressor.hh.

485  {
486  double xmax = 0.0;
487 
488  for (int i = 0; i != NUMBER_OF_PDFS; ++i) {
489  if (!pdf[i].empty() && pdf[i].getXmax() > xmax) {
490  xmax = pdf[i].getXmax();
491  }
492  }
493 
494  return xmax;
495  }

◆ operator()() [3/6]

result_type JFIT::JAbstractRegressor< JLine3Z , JGandalf >::operator() ( const JLine3Z value,
__begin,
__end 
)
inlineinherited

Global fit.

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

Definition at line 92 of file JRegressor.hh.

93  {
94  static_cast<minimiser_type&>(*this).value = value;
95 
96  return static_cast<minimiser_type&>(*this)(static_cast<regressor_type&>(*this), __begin, __end);
97  }

◆ operator()() [4/6]

result_type JFIT::JAbstractRegressor< JLine3Z , JGandalf >::operator() ( const JLine3Z value,
T1  __begin1,
T1  __end1,
T2  __begin2,
T2  __end2 
)
inlineinherited

Global fit.

Parameters
valuestart value
__begin1begin of first data set
__end1end of first data set
__begin2begin of second data set
__end2end of second data set
Returns
chi2

Definition at line 111 of file JRegressor.hh.

114  {
115  static_cast<minimiser_type&>(*this).value = value;
116 
117  return static_cast<minimiser_type&>(*this)(static_cast<regressor_type&>(*this), __begin1, __end1, __begin2, __end2);
118  }

◆ operator()() [5/6]

result_type JFIT::JGandalf< JLine3Z >::operator() ( const JFunction_t &  fit,
T1  __begin1,
T1  __end1,
T2  __begin2,
T2  __end2 
)
inlineinherited

Multi-dimensional fit of two data sets.

The fit function should return the equivalent of chi2 for the current value of the model and the given data point as well as the partial derivatives.

Parameters
fitfit function
__begin1begin of first data set
__end1end of first data set
__begin2begin of second data set
__end2end of second data set
Returns
chi2

Definition at line 122 of file JGandalf.hh.

125  {
126  using namespace std;
127 
128  const int N = parameters.size();
129 
130  H.resize(N);
131  h.resize(N);
132 
133  previous = value;
134  error = JModel_t();
135  lambda = LAMBDA_MIN;
136 
137  result_type precursor = result_type(numeric_limits<double>::max(), JModel_t());
138 
140 
141  DEBUG("step: " << numberOfIterations << endl);
142 
143  reset();
144 
145  evaluate(fit, __begin1, __end1);
146  evaluate(fit, __begin2, __end2);
147 
148  DEBUG("lambda: " << SCIENTIFIC(12,5) << lambda << endl);
149  DEBUG("chi2: " << FIXED (12,5) << successor.chi2 << endl);
150 
151  if (successor.chi2 < precursor.chi2) {
152 
153  if (numberOfIterations != 0) {
154 
155  if (fabs(precursor.chi2 - successor.chi2) < EPSILON*fabs(precursor.chi2)) {
156  return successor;
157  }
158 
159  if (lambda > LAMBDA_MIN) {
160  lambda /= LAMBDA_DOWN;
161  }
162  }
163 
164  precursor = successor;
165  previous = value;
166 
167  } else {
168 
169  value = previous;
170  lambda *= LAMBDA_UP;
171 
172  if (lambda > LAMBDA_MAX) {
173  return precursor; // no improvement found
174  }
175 
176  reset();
177 
178  evaluate(fit, __begin1, __end1);
179  evaluate(fit, __begin2, __end2);
180  }
181 
182  DEBUG("Hesse matrix:" << endl);
183  DEBUG(H << endl);
184 
185 
186  // force definite positiveness
187 
188  for (int i = 0; i != N; ++i) {
189 
190  if (H(i,i) < PIVOT) {
191  H(i,i) = PIVOT;
192  }
193 
194  h[i] = 1.0 / sqrt(H(i,i));
195  }
196 
197 
198  // normalisation
199 
200  for (int i = 0; i != N; ++i) {
201  for (int j = 0; j != i; ++j) {
202  H(j,i) *= h[i] * h[j];
203  H(i,j) = H(j,i);
204  }
205  }
206 
207  for (int i = 0; i != N; ++i) {
208  H(i,i) = 1.0 + lambda;
209  }
210 
211 
212  try {
213  H.invert();
214  }
215  catch (const JException& error) {
216  ERROR("JGandalf: " << error.what() << endl);
217  return precursor;
218  }
219 
220 
221  for (int i = 0; i != N; ++i) {
222  DEBUG("u[" << noshowpos << i << "] = " << showpos << FIXED(15,5) << value.*parameters[i]);
223 
224  for (int j = 0; j != N; ++j) {
225  value.*parameters[i] -= H(i,j) * successor.gradient.*parameters[j] * h[i] * h[j];
226  }
227 
228  DEBUG(' ' << FIXED(15,5) << value.*parameters[i] << noshowpos << endl);
229 
230  error.*parameters[i] = h[i];
231  }
232 
233  }
234 
235  return precursor;
236  }

◆ operator()() [6/6]

result_type JFIT::JGandalf< JLine3Z >::operator() ( const JFunction_t &  fit,
__begin,
__end 
)
inlineinherited

Multi-dimensional fit of one data set.

The fit function should return the equivalent of chi2 for the current value of the model and the given data point as well as the partial derivatives.

Parameters
fitfit function
__beginbegin of data
__endend of data
Returns
chi2

Definition at line 251 of file JGandalf.hh.

252  {
253  return (*this)(fit, __begin, __end, __end, __end);
254  }

◆ reset()

void JFIT::JGandalf< JLine3Z >::reset ( )
inlineprivateinherited

Reset.

Definition at line 276 of file JGandalf.hh.

277  {
278  successor = result_type();
279 
280  H.reset();
281  }

◆ evaluate()

void JFIT::JGandalf< JLine3Z >::evaluate ( const JFunction_t &  fit,
__begin,
__end 
)
inlineprivateinherited

Evaluate fit for given data set.

Parameters
fitfit function
__beginbegin of data
__endend of data

Definition at line 292 of file JGandalf.hh.

293  {
294  for (T hit = __begin; hit != __end; ++hit) {
295 
296  const result_type& result = fit(value, *hit);
297 
298  successor.chi2 += result.chi2;
299  successor.gradient += result.gradient;
300 
301  for (unsigned int i = 0; i != parameters.size(); ++i) {
302  for (unsigned int j = i; j != parameters.size(); ++j) {
303  H(i,j) += result.gradient.*parameters[i] * result.gradient.*parameters[j];
304  }
305  }
306  }
307  }

Member Data Documentation

◆ T_ns

Time window with respect to Cherenkov hypothesis [ns].

Default values.

Definition at line 498 of file JLine3ZRegressor.hh.

◆ Vmax_npe

double JFIT::JRegressor< JLine3Z, JGandalf >::Vmax_npe = std::numeric_limits<double>::max()
static

Maximal integral of PDF [npe].

Definition at line 499 of file JLine3ZRegressor.hh.

◆ NUMBER_OF_PDFS

const int JFIT::JRegressor< JLine3Z, JGandalf >::NUMBER_OF_PDFS = 4
static

Definition at line 501 of file JLine3ZRegressor.hh.

◆ pdf_t

const JPDFType_t JFIT::JRegressor< JLine3Z, JGandalf >::pdf_t
static

◆ pdf

PDF.

Definition at line 505 of file JLine3ZRegressor.hh.

◆ npe

PDF.

Definition at line 506 of file JLine3ZRegressor.hh.

◆ E_GeV

double JFIT::JRegressor< JLine3Z, JGandalf >::E_GeV

Energy of muon at vertex [GeV].

Definition at line 507 of file JLine3ZRegressor.hh.

◆ estimator

M-Estimator function.

Definition at line 509 of file JLine3ZRegressor.hh.

◆ MAXIMUM_ITERATIONS

int JFIT::JGandalf< JLine3Z >::MAXIMUM_ITERATIONS
staticinherited

maximal number of iterations

maximal number of iterations.

Definition at line 257 of file JGandalf.hh.

◆ EPSILON

double JFIT::JGandalf< JLine3Z >::EPSILON
staticinherited

maximal distance to minimum

maximal distance to minimum.

Definition at line 258 of file JGandalf.hh.

◆ LAMBDA_MIN

double JFIT::JGandalf< JLine3Z >::LAMBDA_MIN
staticinherited

minimal value control parameter

Definition at line 259 of file JGandalf.hh.

◆ LAMBDA_MAX

double JFIT::JGandalf< JLine3Z >::LAMBDA_MAX
staticinherited

maximal value control parameter

Definition at line 260 of file JGandalf.hh.

◆ LAMBDA_UP

double JFIT::JGandalf< JLine3Z >::LAMBDA_UP
staticinherited

multiplication factor control parameter

Definition at line 261 of file JGandalf.hh.

◆ LAMBDA_DOWN

double JFIT::JGandalf< JLine3Z >::LAMBDA_DOWN
staticinherited

multiplication factor control parameter

Definition at line 262 of file JGandalf.hh.

◆ PIVOT

double JFIT::JGandalf< JLine3Z >::PIVOT
staticinherited

minimal value diagonal element of matrix

Definition at line 263 of file JGandalf.hh.

◆ lambda

double JFIT::JGandalf< JLine3Z >::lambda
inherited

Definition at line 265 of file JGandalf.hh.

◆ value

JLine3Z JFIT::JGandalf< JLine3Z >::value
inherited

Definition at line 266 of file JGandalf.hh.

◆ error

JLine3Z JFIT::JGandalf< JLine3Z >::error
inherited

Definition at line 267 of file JGandalf.hh.

◆ parameters

std::vector<parameter_type> JFIT::JGandalf< JLine3Z >::parameters
inherited

Definition at line 268 of file JGandalf.hh.

◆ numberOfIterations

int JFIT::JGandalf< JLine3Z >::numberOfIterations
inherited

Definition at line 269 of file JGandalf.hh.

◆ H

Definition at line 270 of file JGandalf.hh.

◆ successor

result_type JFIT::JGandalf< JLine3Z >::successor
privateinherited

Definition at line 309 of file JGandalf.hh.

◆ previous

JLine3Z JFIT::JGandalf< JLine3Z >::previous
privateinherited

Definition at line 310 of file JGandalf.hh.

◆ h

std::vector<double> JFIT::JGandalf< JLine3Z >::h
privateinherited

Definition at line 311 of file JGandalf.hh.

◆ debug

int JEEP::JMessage< JGandalf< JLine3Z > >::debug
staticinherited

debug level (default is off).

Definition at line 45 of file JMessage.hh.


The documentation for this struct was generated from the following file:
JFIT::JGandalf< JLine3Z >::LAMBDA_MAX
static double LAMBDA_MAX
maximal value control parameter
Definition: JGandalf.hh:260
JPHYSICS::JPDFTable::compress
void compress(const JRange< typename function_type::abscissa_type > &Crange)
Compresses PDF to abscissa range specified by Crange.
Definition: JPDFTable.hh:194
JFIT::JRegressor< JLine3Z, JGandalf >::pdf_t
static const JPDFType_t pdf_t[NUMBER_OF_PDFS]
PDF types.
Definition: JLine3ZRegressor.hh:503
JPHYSICS::JPDFTable::blur
void blur(const double TTS, const int numberOfPoints=25, const double epsilon=1.0e-10, const double quantile=0.99)
Blur PDF.
Definition: JPDFTable.hh:110
FIXED
Auxiliary data structure for floating point format specification.
Definition: JPrint.hh:481
JFIT::JGandalf< JLine3Z >::numberOfIterations
int numberOfIterations
Definition: JGandalf.hh:269
JFIT::JLine3Z
Data structure for fit of straight line in positive z-direction.
Definition: JLine3Z.hh:35
JTOOLS::getSpeedOfLight
const double getSpeedOfLight()
Number of bytes in a gigabyte.
Definition: JConstants.hh:89
JFIT::JGandalf< JLine3Z >::LAMBDA_DOWN
static double LAMBDA_DOWN
multiplication factor control parameter
Definition: JGandalf.hh:262
JFIT::JGandalf< JLine3Z >::reset
void reset()
Reset.
Definition: JGandalf.hh:276
JFIT::JRegressor< JLine3Z, JGandalf >::JNPE_t
JPHYSICS::JNPETable< double, double, JNPEMaplist_t > JNPE_t
time integrated PDF
Definition: JLine3ZRegressor.hh:125
JFIT::JGandalf< JLine3Z >::evaluate
void evaluate(const JFunction_t &fit, T __begin, T __end)
Evaluate fit for given data set.
Definition: JGandalf.hh:292
JPHYSICS::gWater
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
Definition: JGeane.hh:328
JFIT::JRegressor< JLine3Z, JGandalf >::getH0
JPDF_t::result_type getH0(const double R_Hz, const double t1) const
Get background hypothesis value for time differentiated PDF.
Definition: JLine3ZRegressor.hh:334
numberOfPoints
int numberOfPoints
Definition: JResultPDF.cc:22
JGEOMETRY3D::JVersor3Z
Data structure for normalised vector in positive z-direction.
Definition: JVersor3Z.hh:37
JFIT::JGandalf< JLine3Z >::MAXIMUM_ITERATIONS
static int MAXIMUM_ITERATIONS
maximal number of iterations
Definition: JGandalf.hh:257
JFIT::JPMTW0::getR
double getR() const
Get rate.
Definition: JPMTW0.hh:56
JPHYSICS::is_deltarays
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays.
Definition: JPDFTypes.hh:172
JGEOMETRY3D::JDirection3D::getDirection
const JDirection3D & getDirection() const
Get direction.
Definition: JDirection3D.hh:106
JFIT::JRegressor< JLine3Z, JGandalf >::T_ns
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
Definition: JLine3ZRegressor.hh:498
JFIT::ERROR
Definition: JFitStatus.hh:18
JFIT::JGandalf< JLine3Z >::EPSILON
static double EPSILON
maximal distance to minimum
Definition: JGandalf.hh:258
JTOOLS::u
double u[N+1]
Definition: JPolint.hh:706
JFIT::JGandalf< JLine3Z >::h
std::vector< double > h
Definition: JGandalf.hh:311
JTOOLS::JRange::getLength
T getLength() const
Get length (difference between upper and lower limit).
Definition: JRange.hh:302
JGEOMETRY3D::JDirection3D::getDot
double getDot(const JAngle3D &angle) const
Get dot product.
Definition: JDirection3D.hh:333
JPHYSICS
Auxiliary classes and methods for calculation of PDF and muon energy loss.
Definition: JAbstractMedium.hh:9
JGEOMETRY3D::JDirection3D
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JFIT::JRegressor< JLine3Z, JGandalf >::Vmax_npe
static double Vmax_npe
Maximal integral of PDF [npe].
Definition: JLine3ZRegressor.hh:499
JFIT::JAbstractRegressor< JLine3Z, JGandalf >::result_type
minimiser_type::result_type result_type
Definition: JRegressor.hh:80
JTOOLS::JMultiFunction::setExceptionHandler
void setExceptionHandler(const supervisor_type &supervisor)
Set the supervisor for handling of exceptions.
Definition: JMultiFunction.hh:158
JTOOLS::j
int j
Definition: JPolint.hh:634
JFIT::JRegressor< JLine3Z, JGandalf >::getH1
JPDF_t::result_type getH1(const double E, const double R, const double theta, const double phi, const double t1) const
Get signal hypothesis value for time differentiated PDF.
Definition: JLine3ZRegressor.hh:351
JFIT::JGandalf< JLine3Z >::error
JLine3Z error
Definition: JGandalf.hh:267
JPHYSICS::getDeltaRaysFromMuon
double getDeltaRaysFromMuon(const double E)
Equivalent EM-shower energy due to delta-rays per unit muon track length.
Definition: JPDFToolkit.hh:81
NOTICE
#define NOTICE(A)
Definition: JMessage.hh:64
JPHYSICS::JGeaneWater::getE
virtual double getE(const double E, const double dx) const
Get energy of muon after specified distance.
Definition: JGeane.hh:260
JFIT::JRegressor< JLine3Z, JGandalf >::pdf
JPDF_t pdf[NUMBER_OF_PDFS]
PDF.
Definition: JLine3ZRegressor.hh:505
JFIT::JRegressor< JLine3Z, JGandalf >::E_GeV
double E_GeV
Energy of muon at vertex [GeV].
Definition: JLine3ZRegressor.hh:507
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JTOOLS::JRange::constrain
T constrain(argument_type x) const
Constrain value to range.
Definition: JRange.hh:340
JFIT::JGandalf< JLine3Z >::lambda
double lambda
Definition: JGandalf.hh:265
ERROR
#define ERROR(A)
Definition: JMessage.hh:66
JFIT::JRegressor< JLine3Z, JGandalf >::estimator
JLANG::JSharedPointer< JMEstimator > estimator
M-Estimator function.
Definition: JLine3ZRegressor.hh:509
JFIT::JPMTW0::getN
int getN() const
Get number of hits.
Definition: JPMTW0.hh:67
JFIT::JLine3Z::getDirection
JVersor3D getDirection(const JVector3D &pos) const
Get photon direction of Cherenkov light on PMT.
Definition: JLine3Z.hh:254
JFIT::JGandalf< JLine3Z >::PIVOT
static double PIVOT
minimal value diagonal element of matrix
Definition: JGandalf.hh:263
JFIT::JGandalf< JLine3Z >::LAMBDA_MIN
static double LAMBDA_MIN
minimal value control parameter
Definition: JGandalf.hh:259
JTOOLS::getInverseSpeedOfLight
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
JGEOMETRY3D::JPosition3D
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
JTOOLS::result
return result
Definition: JPolint.hh:695
JFIT::JLine3Z::getT
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition: JLine3Z.hh:233
JFIT::JGandalf< JLine3Z >::parameters
std::vector< parameter_type > parameters
Definition: JGandalf.hh:268
JPHYSICS::is_bremsstrahlung
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
Definition: JPDFTypes.hh:158
JTOOLS::JTransformableMultiFunction::add
void add(const JMultiFunction_t &input)
Add function.
Definition: JTransformableMultiFunction.hh:154
JEEP::getFilename
std::string getFilename(const std::string &file_name)
Get file name part, i.e.
Definition: JeepToolkit.hh:86
SCIENTIFIC
Auxiliary data structure for floating point format specification.
Definition: JPrint.hh:518
JFIT::JMEstimatorNormal
Normal M-estimator.
Definition: JMEstimator.hh:66
JPHYSICS::SCATTERED_LIGHT_FROM_EMSHOWERS
scattered light from EM showers
Definition: JPDFTypes.hh:33
JFIT::JLine1Z
Data structure for fit of straight line paralel to z-axis.
Definition: JLine1Z.hh:27
JFIT::JGandalf< JLine3Z >::value
JLine3Z value
Definition: JGandalf.hh:266
JGEOMETRY3D::JRotation3Z
Rotation around Z-axis.
Definition: JRotation3D.hh:85
JTOOLS::getTanThetaC
double getTanThetaC()
Get average tangent of Cherenkov angle of water.
Definition: JConstants.hh:133
JMATH::JMatrixND::reset
JMatrixND & reset()
Set matrix to the null matrix.
Definition: JMatrixND.hh:372
JGEOMETRY3D::JPosition3D::getPosition
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
JMATH::JMatrixNS::invert
void invert()
Invert matrix according LDU decomposition.
Definition: JMatrixNS.hh:80
DEBUG
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
std
Definition: jaanetDictionary.h:36
JFIT::JGandalf< JLine3Z >::previous
JLine3Z previous
Definition: JGandalf.hh:310
JGEOMETRY3D::JVersor3Z::getDY
double getDY() const
Get y direction.
Definition: JVersor3Z.hh:156
JFIT::JGandalf< JLine3Z >::LAMBDA_UP
static double LAMBDA_UP
multiplication factor control parameter
Definition: JGandalf.hh:261
JGEOMETRY3D
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition: JAngle3D.hh:18
JFIT::JRegressor< JLine3Z, JGandalf >::NUMBER_OF_PDFS
static const int NUMBER_OF_PDFS
Definition: JLine3ZRegressor.hh:501
JPHYSICS::DIRECT_LIGHT_FROM_MUON
direct light from muon
Definition: JPDFTypes.hh:29
JFIT::JGandalf< JLine3Z >::successor
result_type successor
Definition: JGandalf.hh:309
JMATH::zero
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:94
JMATH::JMatrixND::resize
void resize(const size_t size)
Resize matrix.
Definition: JMatrixND.hh:359
JGEOMETRY3D::JVersor3Z::getDZ
double getDZ() const
Get z direction.
Definition: JVersor3Z.hh:167
FATAL
#define FATAL(A)
Definition: JMessage.hh:67
JPHYSICS::DIRECT_LIGHT_FROM_EMSHOWERS
direct light from EM showers
Definition: JPDFTypes.hh:32
JIO::JObjectBinaryIO::load
void load(const char *file_name)
Load from input file.
Definition: JObjectBinaryIO.hh:29
JFIT::JRegressor< JLine3Z, JGandalf >::npe
JNPE_t npe[NUMBER_OF_PDFS]
PDF.
Definition: JLine3ZRegressor.hh:506
JFIT::JGandalf< JLine3Z >::H
JMATH::JMatrixNS H
Definition: JGandalf.hh:270
JGEOMETRY3D::JVersor3Z::getDX
double getDX() const
Get x direction.
Definition: JVersor3Z.hh:145
JPHYSICS::SCATTERED_LIGHT_FROM_MUON
scattered light from muon
Definition: JPDFTypes.hh:30