Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
FitUtil.h
Go to the documentation of this file.
1// @(#)root/mathcore:$Id$
2// Author: L. Moneta Tue Nov 28 10:52:47 2006
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
7 * *
8 * *
9 **********************************************************************/
10
11// Header file for class FitUtil
12
13#ifndef ROOT_Fit_FitUtil
14#define ROOT_Fit_FitUtil
15
17#include "Math/IParamFunction.h"
18
19#include "Fit/BinData.h"
20#include "Fit/UnBinData.h"
22
23#include "Math/Integrator.h"
25
26#include "TError.h"
27#include <vector>
28
29// using parameter cache is not thread safe but needed for normalizing the functions
30#define USE_PARAMCACHE
31
32//#define DEBUG_FITUTIL
33
34namespace ROOT {
35
36namespace Fit {
37
38/**
39 namespace defining utility free functions using in Fit for evaluating the various fit method
40 functions (chi2, likelihood, etc..) given the data and the model function
41
42 @ingroup FitMain
43*/
44namespace FitUtil {
45
48
49 template <class T>
51
52 template <class T>
54
55 // internal class defining
56 template <class T>
58 public:
59 LikelihoodAux(T logv = {}, T w = {}, T w2 = {}) : logvalue(logv), weight(w), weight2(w2) {}
60
62 {
63 return LikelihoodAux<T>(logvalue + l.logvalue, weight + l.weight, weight2 + l.weight2);
64 }
65
67 {
68 logvalue += l.logvalue;
69 weight += l.weight;
70 weight2 += l.weight2;
71 return *this;
72 }
73
77 };
78
79 template <>
81 public:
82 LikelihoodAux(double logv = 0.0, double w = 0.0, double w2 = 0.0) : logvalue(logv), weight(w), weight2(w2){};
83
85 {
86 return LikelihoodAux<double>(logvalue + l.logvalue, weight + l.weight, weight2 + l.weight2);
87 }
88
90 {
91 logvalue += l.logvalue;
92 weight += l.weight;
93 weight2 += l.weight2;
94 return *this;
95 }
96
97 double logvalue;
98 double weight;
99 double weight2;
100 };
101
102 // internal class to evaluate the function or the integral
103 // and cached internal integration details
104 // if useIntegral is false no allocation is done
105 // and this is a dummy class
106 // class is templated on any parametric functor implementing operator()(x,p) and NDim()
107 // contains a constant pointer to the function
108
109 template <class ParamFunc = ROOT::Math::IParamMultiFunctionTempl<double>>
111
112 public:
113 IntegralEvaluator(const ParamFunc &func, const double *p, bool useIntegral = true,
115 : fDim(0), fParams(nullptr), fFunc(nullptr), fIg1Dim(nullptr), fIgNDim(nullptr), fFunc1Dim(nullptr), fFuncNDim(nullptr)
116 {
117 if (useIntegral) {
118 SetFunction(func, p, igType);
119 }
120 }
121
122 void SetFunction(const ParamFunc &func, const double *p = nullptr,
124 {
125 // set the integrand function and create required wrapper
126 // to perform integral in (x) of a generic f(x,p)
127 fParams = p;
128 fDim = func.NDim();
129 // copy the function object to be able to modify the parameters
130 // fFunc = dynamic_cast<ROOT::Math::IParamMultiFunction *>( func.Clone() );
131 fFunc = &func;
132 assert(fFunc != nullptr);
133 // set parameters in function
134 // fFunc->SetParameters(p);
135 if (fDim == 1) {
136 fFunc1Dim =
138 *this, &IntegralEvaluator::F1);
140 // fIg1Dim->SetFunction( static_cast<const ROOT::Math::IMultiGenFunction & >(*fFunc),false);
141 fIg1Dim->SetFunction(static_cast<const ROOT::Math::IGenFunction &>(*fFunc1Dim));
142 } else if (fDim > 1) {
143 fFuncNDim =
145 const>(*this, &IntegralEvaluator::FN, fDim);
148 } else
149 assert(fDim > 0);
150 }
151
152 void SetParameters(const double *p)
153 {
154 // copy just the pointer
155 fParams = p;
156 }
157
159 {
160 if (fIg1Dim)
161 delete fIg1Dim;
162 if (fIgNDim)
163 delete fIgNDim;
164 if (fFunc1Dim)
165 delete fFunc1Dim;
166 if (fFuncNDim)
167 delete fFuncNDim;
168 // if (fFunc) delete fFunc;
169 }
170
171 // evaluation of integrand function (one-dim)
172 double F1(double x) const
173 {
174 double xx = x;
175 return ExecFunc(fFunc, &xx, fParams);
176 }
177 // evaluation of integrand function (multi-dim)
178 double FN(const double *x) const { return ExecFunc(fFunc, x, fParams); }
179
180 double Integral(const double *x1, const double *x2)
181 {
182 // return unnormalized integral
183 return (fIg1Dim) ? fIg1Dim->Integral(*x1, *x2) : fIgNDim->Integral(x1, x2);
184 }
185
186 double operator()(const double *x1, const double *x2)
187 {
188 // return normalized integral, divided by bin volume (dx1*dx...*dxn)
189 if (fIg1Dim) {
190 double dV = *x2 - *x1;
191 return fIg1Dim->Integral(*x1, *x2) / dV;
192 } else if (fIgNDim) {
193 double dV = 1;
194 for (unsigned int i = 0; i < fDim; ++i)
195 dV *= (x2[i] - x1[i]);
196 return fIgNDim->Integral(x1, x2) / dV;
197 // std::cout << " do integral btw x " << x1[0] << " " << x2[0] << " y " << x1[1] << " "
198 // << x2[1] << " dV = " << dV << " result = " << result << std::endl; return result;
199 } else
200 assert(1.); // should never be here
201 return 0;
202 }
203
204 private:
205 template <class T>
206 inline double ExecFunc(T *f, const double *x, const double *p) const
207 {
208 return (*f)(x, p);
209 }
210
211#ifdef R__HAS_STD_EXPERIMENTAL_SIMD
212
213#if __clang_major__ > 16
214#pragma clang diagnostic push
215#pragma clang diagnostic ignored "-Wvla-cxx-extension"
216#endif
217
218 inline double ExecFunc(const IModelFunctionTempl<ROOT::Double_v> *f, const double *x, const double *p) const
219 {
220 ROOT::Double_v xx[fDim];
221 for (unsigned int i = 0; i < fDim; ++i) {
222 xx[i][0] = x[i];
223 for (std::size_t j = 1; j < ROOT::Double_v::size(); ++j) {
224 xx[i][j] = 0.0;
225 }
226 }
227 auto res = (*f)(xx, p);
228 return res[0];
229 }
230
231#if __clang_major__ > 16
232#pragma clang diagnostic pop
233#endif
234
235#endif
236
237 // objects of this class are not meant to be copied / assigned
240
241 unsigned int fDim;
242 const double *fParams;
243 // ROOT::Math::IParamMultiFunction * fFunc; // copy of function in order to be able to change parameters
244 // const ParamFunc * fFunc; // reference to a generic parametric function
245 const ParamFunc *fFunc;
250 };
251
252 /** Chi2 Functions */
253
254 /**
255 evaluate the Chi2 given a model function and the data at the point x.
256 return also nPoints as the effective number of used points in the Chi2 evaluation
257 */
258 double EvaluateChi2(const IModelFunction &func, const BinData &data, const double *p, unsigned int &nPoints,
260
261 /**
262 evaluate the effective Chi2 given a model function and the data at the point x.
263 The effective chi2 uses the errors on the coordinates : W = 1/(sigma_y**2 + ( sigma_x_i * df/dx_i )**2 )
264 return also nPoints as the effective number of used points in the Chi2 evaluation
265 */
266 double EvaluateChi2Effective(const IModelFunction &func, const BinData &data, const double *x, unsigned int &nPoints);
267
268 /**
269 evaluate the Chi2 gradient given a model function and the data at the point p.
270 return also nPoints as the effective number of used points in the Chi2 evaluation
271 */
272 void EvaluateChi2Gradient(const IModelFunction &func, const BinData &data, const double *p, double *grad,
273 unsigned int &nPoints,
275 unsigned nChunks = 0);
276
277 /**
278 evaluate the LogL given a model function and the data at the point x.
279 return also nPoints as the effective number of used points in the LogL evaluation
280 */
281 double EvaluateLogL(const IModelFunction &func, const UnBinData &data, const double *p, int iWeight, bool extended,
282 unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks = 0);
283
284 /**
285 evaluate the LogL gradient given a model function and the data at the point p.
286 return also nPoints as the effective number of used points in the LogL evaluation
287 */
288 void EvaluateLogLGradient(const IModelFunction &func, const UnBinData &data, const double *p, double *grad,
289 unsigned int &nPoints,
291 unsigned nChunks = 0);
292
293 // #ifdef R__HAS_STD_EXPERIMENTAL_SIMD
294 // template <class NotCompileIfScalarBackend = std::enable_if<!(std::is_same<double, ROOT::Double_v>::value)>>
295 // void EvaluateLogLGradient(const IModelFunctionTempl<ROOT::Double_v> &, const UnBinData &, const double *, double
296 // *, unsigned int & ) {}
297 // #endif
298
299 /**
300 evaluate the Poisson LogL given a model function and the data at the point p.
301 return also nPoints as the effective number of used points in the LogL evaluation
302 By default is extended, pass extend to false if want to be not extended (MultiNomial)
303 */
304 double EvaluatePoissonLogL(const IModelFunction &func, const BinData &data, const double *p, int iWeight,
306 unsigned nChunks = 0);
307
308 /**
309 evaluate the Poisson LogL given a model function and the data at the point p.
310 return also nPoints as the effective number of used points in the LogL evaluation
311 */
312 void EvaluatePoissonLogLGradient(const IModelFunction &func, const BinData &data, const double *p, double *grad,
313 unsigned int &nPoints,
315 unsigned nChunks = 0);
316
317 // methods required by dedicate minimizer like Fumili
318
319 /**
320 evaluate the residual contribution to the Chi2 given a model function and the BinPoint data
321 and if the pointer g is not null evaluate also the gradient of the residual.
322 If the function provides parameter derivatives they are used otherwise a simple derivative calculation
323 is used
324 */
325 double EvaluateChi2Residual(const IModelFunction &func, const BinData &data, const double *p, unsigned int ipoint,
326 double *g = nullptr, double * h = nullptr, bool hasGrad = false, bool fullHessian = false);
327
328 /**
329 evaluate the pdf contribution to the LogL given a model function and the BinPoint data.
330 If the pointer g is not null evaluate also the gradient of the pdf.
331 If the function provides parameter derivatives they are used otherwise a simple derivative calculation
332 is used
333 */
334 double
335 EvaluatePdf(const IModelFunction &func, const UnBinData &data, const double *p, unsigned int ipoint, double *g = nullptr, double * h = nullptr, bool hasGrad = false, bool fullHessian = false);
336
337
338 /**
339 evaluate the pdf contribution to the Poisson LogL given a model function and the BinPoint data.
340 If the pointer g is not null evaluate also the gradient of the Poisson pdf.
341 If the function provides parameter derivatives they are used otherwise a simple derivative calculation
342 is used
343 */
344 double EvaluatePoissonBinPdf(const IModelFunction & func, const BinData & data, const double * x, unsigned int ipoint, double * g = nullptr, double * h = nullptr, bool hasGrad = false, bool fullHessian = false);
345
346 unsigned setAutomaticChunking(unsigned nEvents);
347
348 template <class T>
349 struct Evaluate {};
350
351#ifdef R__HAS_STD_EXPERIMENTAL_SIMD
352 template <>
353 struct Evaluate<Double_v> {
354 static double EvalChi2(const IModelFunctionTempl<Double_v> &func, const BinData &data, const double *p,
355 unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks = 0);
356
357 static double EvalLogL(const IModelFunctionTempl<Double_v> &func, const UnBinData &data, const double *const p,
358 int iWeight, bool extended, unsigned int &nPoints,
360
361 static double EvalPoissonLogL(const IModelFunctionTempl<Double_v> &func, const BinData &data, const double *p,
363 unsigned nChunks = 0);
364
365 static double
366 EvalChi2Effective(const IModelFunctionTempl<Double_v> &, const BinData &, const double *, unsigned int &)
367 {
368 Error("FitUtil::Evaluate<T>::EvalChi2Effective", "The vectorized evaluation of the Chi2 with coordinate errors is still not supported");
369 return -1.;
370 }
371
372 static void EvalChi2Gradient(const IModelFunctionTempl<Double_v> &f, const BinData &data, const double *p,
373 double *grad, unsigned int &nPoints,
375 unsigned nChunks = 0);
376
377 static double EvalChi2Residual(const IModelFunctionTempl<Double_v> &, const BinData &, const double *,
378 unsigned int, double *, double *, bool, bool)
379 {
380 Error("FitUtil::Evaluate<T>::EvalChi2Residual", "The vectorized evaluation of the Chi2 with the ith residual is still not supported");
381 return -1.;
382 }
383
384 /// evaluate the pdf (Poisson) contribution to the logl (return actually log of pdf)
385 /// and its gradient
386 static double EvalPoissonBinPdf(const IModelFunctionTempl<Double_v> &, const BinData &, const double *,
387 unsigned int, double *, double *, bool, bool)
388 {
389 Error("FitUtil::Evaluate<T>::EvaluatePoissonBinPdf", "The vectorized evaluation of the BinnedLikelihood fit evaluated point by point is still not supported");
390 return -1.;
391 }
392
393 static double EvalPdf(const IModelFunctionTempl<Double_v> &, const UnBinData &, const double *, unsigned int,
394 double *, double *, bool, bool)
395 {
396 Error("FitUtil::Evaluate<T>::EvalPdf", "The vectorized evaluation of the LogLikelihood fit evaluated point by point is still not supported");
397 return -1.;
398 }
399
400 static void
401 EvalPoissonLogLGradient(const IModelFunctionTempl<Double_v> &f, const BinData &data, const double *p,
402 double *grad, unsigned int &,
404 unsigned nChunks = 0);
405
406 static void EvalLogLGradient(const IModelFunctionTempl<Double_v> &f, const UnBinData &data, const double *p,
407 double *grad, unsigned int &,
409 unsigned nChunks = 0);
410 };
411#endif // R__HAS_STD_EXPERIMENTAL_SIMD
412
413 template <>
414 struct Evaluate<double> {
415
416 static double EvalChi2(const IModelFunction &func, const BinData &data, const double *p, unsigned int &nPoints,
418 {
419 // evaluate the chi2 given a function reference, the data and returns the value and also in nPoints
420 // the actual number of used points
421 // normal chi2 using only error on values (from fitting histogram)
422 // optionally the integral of function in the bin is used
423
424
425 //Info("EvalChi2","Using non-vectorized implementation %d",(int) data.Opt().fIntegral);
426
428 }
429
430 static double EvalLogL(const IModelFunctionTempl<double> &func, const UnBinData &data, const double *p,
431 int iWeight, bool extended, unsigned int &nPoints,
433 {
435 }
436
437 static double EvalPoissonLogL(const IModelFunctionTempl<double> &func, const BinData &data, const double *p,
438 int iWeight, bool extended, unsigned int &nPoints,
440 {
442 }
443
444 static double EvalChi2Effective(const IModelFunctionTempl<double> &func, const BinData & data, const double * p, unsigned int &nPoints)
445 {
447 }
448 static void EvalChi2Gradient(const IModelFunctionTempl<double> &func, const BinData &data, const double *p,
449 double *g, unsigned int &nPoints,
451 unsigned nChunks = 0)
452 {
454 }
455
456 static double EvalChi2Residual(const IModelFunctionTempl<double> &func, const BinData & data, const double * p, unsigned int i, double *g, double * h,
457 bool hasGrad, bool fullHessian)
458 {
460 }
461
462 /// evaluate the pdf (Poisson) contribution to the logl (return actually log of pdf)
463 /// and its gradient
464 static double EvalPoissonBinPdf(const IModelFunctionTempl<double> &func, const BinData & data, const double *p, unsigned int i, double *g, double * h, bool hasGrad, bool fullHessian) {
466 }
467
468 static double EvalPdf(const IModelFunctionTempl<double> &func, const UnBinData & data, const double *p, unsigned int i, double *g, double * h, bool hasGrad, bool fullHessian) {
469 return FitUtil::EvaluatePdf(func, data, p, i, g, h, hasGrad, fullHessian);
470 }
471
472 static void
480
481 static void EvalLogLGradient(const IModelFunctionTempl<double> &func, const UnBinData &data, const double *p,
482 double *g, unsigned int &nPoints,
484 unsigned nChunks = 0)
485 {
487 }
488 };
489
490 } // end namespace FitUtil
491
492 } // end namespace Fit
493
494 } // end namespace ROOT
495
496#endif /* ROOT_Fit_FitUtil */
#define f(i)
Definition RSha256.hxx:104
#define g(i)
Definition RSha256.hxx:105
#define h(i)
Definition RSha256.hxx:106
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
Definition BinData.h:52
double Integral(const double *x1, const double *x2)
Definition FitUtil.h:180
ROOT::Math::IGenFunction * fFunc1Dim
Definition FitUtil.h:248
ROOT::Math::IntegratorMultiDim * fIgNDim
Definition FitUtil.h:247
void SetFunction(const ParamFunc &func, const double *p=nullptr, ROOT::Math::IntegrationOneDim::Type igType=ROOT::Math::IntegrationOneDim::kDEFAULT)
Definition FitUtil.h:122
IntegralEvaluator(const IntegralEvaluator &rhs)=delete
IntegralEvaluator(const ParamFunc &func, const double *p, bool useIntegral=true, ROOT::Math::IntegrationOneDim::Type igType=ROOT::Math::IntegrationOneDim::kDEFAULT)
Definition FitUtil.h:113
IntegralEvaluator & operator=(const IntegralEvaluator &rhs)=delete
double F1(double x) const
Definition FitUtil.h:172
ROOT::Math::IntegratorOneDim * fIg1Dim
Definition FitUtil.h:246
double FN(const double *x) const
Definition FitUtil.h:178
ROOT::Math::IMultiGenFunction * fFuncNDim
Definition FitUtil.h:249
void SetParameters(const double *p)
Definition FitUtil.h:152
double ExecFunc(T *f, const double *x, const double *p) const
Definition FitUtil.h:206
double operator()(const double *x1, const double *x2)
Definition FitUtil.h:186
LikelihoodAux(double logv=0.0, double w=0.0, double w2=0.0)
Definition FitUtil.h:82
LikelihoodAux & operator+=(const LikelihoodAux &l)
Definition FitUtil.h:89
LikelihoodAux operator+(const LikelihoodAux &l) const
Definition FitUtil.h:84
LikelihoodAux operator+(const LikelihoodAux &l) const
Definition FitUtil.h:61
LikelihoodAux(T logv={}, T w={}, T w2={})
Definition FitUtil.h:59
LikelihoodAux & operator+=(const LikelihoodAux &l)
Definition FitUtil.h:66
Class describing the un-binned data sets (just x coordinates values) of any dimensions.
Definition UnBinData.h:46
Documentation for the abstract class IBaseFunctionMultiDim.
Definition IFunction.h:63
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Definition IFunction.h:157
Interface (abstract class) for parametric gradient multi-dimensional functions providing in addition ...
User class for performing multidimensional integration.
double Integral(const double *xmin, const double *xmax)
evaluate the integral with the previously given function between xmin[] and xmax[]
void SetFunction(Function &f, unsigned int dim)
set integration function using a generic function implementing the operator()(double *x) The dimensio...
User Class for performing numerical integration of a function in one dimension.
Definition Integrator.h:94
void SetFunction(Function &f)
method to set the a generic integration function
Definition Integrator.h:488
double Integral(Function &f, double a, double b)
evaluate the Integral of a function f over the defined interval (a,b)
Definition Integrator.h:495
Template class to wrap any member function of a class taking a double and returning a double in a 1D ...
Type
enumeration specifying the integration types.
@ kDEFAULT
default type specified in the static options
Double_t x[n]
Definition legend1.C:17
ROOT::Math::IParamMultiGradFunction IGradModelFunction
Definition FitUtil.h:47
ROOT::Math::IParamMultiFunction IModelFunction
Definition FitUtil.h:46
double EvaluatePoissonBinPdf(const IModelFunction &func, const BinData &data, const double *x, unsigned int ipoint, double *g=nullptr, double *h=nullptr, bool hasGrad=false, bool fullHessian=false)
evaluate the pdf contribution to the Poisson LogL given a model function and the BinPoint data.
Definition FitUtil.cxx:1301
void EvaluatePoissonLogLGradient(const IModelFunction &func, const BinData &data, const double *p, double *grad, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
evaluate the Poisson LogL given a model function and the data at the point p.
double EvaluateChi2Residual(const IModelFunction &func, const BinData &data, const double *p, unsigned int ipoint, double *g=nullptr, double *h=nullptr, bool hasGrad=false, bool fullHessian=false)
evaluate the residual contribution to the Chi2 given a model function and the BinPoint data and if th...
Definition FitUtil.cxx:549
double EvaluatePoissonLogL(const IModelFunction &func, const BinData &data, const double *p, int iWeight, bool extended, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)
evaluate the Poisson LogL given a model function and the data at the point p.
double EvaluateChi2Effective(const IModelFunction &func, const BinData &data, const double *x, unsigned int &nPoints)
evaluate the effective Chi2 given a model function and the data at the point x.
Definition FitUtil.cxx:428
void EvaluateLogLGradient(const IModelFunction &func, const UnBinData &data, const double *p, double *grad, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
evaluate the LogL gradient given a model function and the data at the point p.
double EvaluatePdf(const IModelFunction &func, const UnBinData &data, const double *p, unsigned int ipoint, double *g=nullptr, double *h=nullptr, bool hasGrad=false, bool fullHessian=false)
evaluate the pdf contribution to the LogL given a model function and the BinPoint data.
Definition FitUtil.cxx:895
unsigned setAutomaticChunking(unsigned nEvents)
Definition FitUtil.cxx:1845
double EvaluateLogL(const IModelFunction &func, const UnBinData &data, const double *p, int iWeight, bool extended, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)
evaluate the LogL given a model function and the data at the point x.
double EvaluateChi2(const IModelFunction &func, const BinData &data, const double *p, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)
Chi2 Functions.
Definition FitUtil.cxx:230
void EvaluateChi2Gradient(const IModelFunction &func, const BinData &data, const double *p, double *grad, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
evaluate the Chi2 gradient given a model function and the data at the point p.
static double EvalLogL(const IModelFunctionTempl< double > &func, const UnBinData &data, const double *p, int iWeight, bool extended, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)
Definition FitUtil.h:430
static double EvalChi2(const IModelFunction &func, const BinData &data, const double *p, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)
Definition FitUtil.h:416
static double EvalPoissonBinPdf(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, unsigned int i, double *g, double *h, bool hasGrad, bool fullHessian)
evaluate the pdf (Poisson) contribution to the logl (return actually log of pdf) and its gradient
Definition FitUtil.h:464
static double EvalChi2Residual(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, unsigned int i, double *g, double *h, bool hasGrad, bool fullHessian)
Definition FitUtil.h:456
static double EvalPdf(const IModelFunctionTempl< double > &func, const UnBinData &data, const double *p, unsigned int i, double *g, double *h, bool hasGrad, bool fullHessian)
Definition FitUtil.h:468
static double EvalPoissonLogL(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, int iWeight, bool extended, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)
Definition FitUtil.h:437
static double EvalChi2Effective(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, unsigned int &nPoints)
Definition FitUtil.h:444
static void EvalChi2Gradient(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, double *g, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
Definition FitUtil.h:448
static void EvalLogLGradient(const IModelFunctionTempl< double > &func, const UnBinData &data, const double *p, double *g, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
Definition FitUtil.h:481
static void EvalPoissonLogLGradient(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, double *g, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
Definition FitUtil.h:473
TLine l
Definition textangle.C:4