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,
268 unsigned nChunks = 0);
269
270 /**
271 evaluate the Chi2 gradient given a model function and the data at the point p.
272 return also nPoints as the effective number of used points in the Chi2 evaluation
273 */
274 void EvaluateChi2Gradient(const IModelFunction &func, const BinData &data, const double *p, double *grad,
275 unsigned int &nPoints,
277 unsigned nChunks = 0);
278
279 /**
280 evaluate the LogL given a model function and the data at the point x.
281 return also nPoints as the effective number of used points in the LogL evaluation
282 */
283 double EvaluateLogL(const IModelFunction &func, const UnBinData &data, const double *p, int iWeight, bool extended,
284 unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks = 0);
285
286 /**
287 evaluate the LogL gradient given a model function and the data at the point p.
288 return also nPoints as the effective number of used points in the LogL evaluation
289 */
290 void EvaluateLogLGradient(const IModelFunction &func, const UnBinData &data, const double *p, double *grad,
291 unsigned int &nPoints,
293 unsigned nChunks = 0);
294
295 // #ifdef R__HAS_STD_EXPERIMENTAL_SIMD
296 // template <class NotCompileIfScalarBackend = std::enable_if<!(std::is_same<double, ROOT::Double_v>::value)>>
297 // void EvaluateLogLGradient(const IModelFunctionTempl<ROOT::Double_v> &, const UnBinData &, const double *, double
298 // *, unsigned int & ) {}
299 // #endif
300
301 /**
302 evaluate the Poisson LogL given a model function and the data at the point p.
303 return also nPoints as the effective number of used points in the LogL evaluation
304 By default is extended, pass extend to false if want to be not extended (MultiNomial)
305 */
306 double EvaluatePoissonLogL(const IModelFunction &func, const BinData &data, const double *p, int iWeight,
308 unsigned nChunks = 0);
309
310 /**
311 evaluate the Poisson LogL given a model function and the data at the point p.
312 return also nPoints as the effective number of used points in the LogL evaluation
313 */
314 void EvaluatePoissonLogLGradient(const IModelFunction &func, const BinData &data, const double *p, double *grad,
315 unsigned int &nPoints,
317 unsigned nChunks = 0);
318
319 // methods required by dedicate minimizer like Fumili
320
321 /**
322 evaluate the residual contribution to the Chi2 given a model function and the BinPoint data
323 and if the pointer g is not null evaluate also the gradient of the residual.
324 If the function provides parameter derivatives they are used otherwise a simple derivative calculation
325 is used
326 */
327 double EvaluateChi2Residual(const IModelFunction &func, const BinData &data, const double *p, unsigned int ipoint,
328 double *g = nullptr, double * h = nullptr, bool hasGrad = false, bool fullHessian = false);
329
330 /**
331 evaluate the pdf contribution to the LogL given a model function and the BinPoint data.
332 If the pointer g is not null evaluate also the gradient of the pdf.
333 If the function provides parameter derivatives they are used otherwise a simple derivative calculation
334 is used
335 */
336 double
337 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);
338
339
340 /**
341 evaluate the pdf contribution to the Poisson LogL given a model function and the BinPoint data.
342 If the pointer g is not null evaluate also the gradient of the Poisson pdf.
343 If the function provides parameter derivatives they are used otherwise a simple derivative calculation
344 is used
345 */
346 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);
347
348 unsigned setAutomaticChunking(unsigned nEvents);
349
350 template <class T>
351 struct Evaluate {};
352
353#ifdef R__HAS_STD_EXPERIMENTAL_SIMD
354 template <>
355 struct Evaluate<Double_v> {
356 static double EvalChi2(const IModelFunctionTempl<Double_v> &func, const BinData &data, const double *p,
357 unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks = 0);
358
359 static double EvalLogL(const IModelFunctionTempl<Double_v> &func, const UnBinData &data, const double *const p,
360 int iWeight, bool extended, unsigned int &nPoints,
362
363 static double EvalPoissonLogL(const IModelFunctionTempl<Double_v> &func, const BinData &data, const double *p,
365 unsigned nChunks = 0);
366
367 static double
368 EvalChi2Effective(const IModelFunctionTempl<Double_v> &, const BinData &, const double *, unsigned int &,
370 {
371 Error("FitUtil::Evaluate<T>::EvalChi2Effective", "The vectorized evaluation of the Chi2 with coordinate errors is still not supported");
372 return -1.;
373 }
374
375 static void EvalChi2Gradient(const IModelFunctionTempl<Double_v> &f, const BinData &data, const double *p,
376 double *grad, unsigned int &nPoints,
378 unsigned nChunks = 0);
379
380 static double EvalChi2Residual(const IModelFunctionTempl<Double_v> &, const BinData &, const double *,
381 unsigned int, double *, double *, bool, bool)
382 {
383 Error("FitUtil::Evaluate<T>::EvalChi2Residual", "The vectorized evaluation of the Chi2 with the ith residual is still not supported");
384 return -1.;
385 }
386
387 /// evaluate the pdf (Poisson) contribution to the logl (return actually log of pdf)
388 /// and its gradient
389 static double EvalPoissonBinPdf(const IModelFunctionTempl<Double_v> &, const BinData &, const double *,
390 unsigned int, double *, double *, bool, bool)
391 {
392 Error("FitUtil::Evaluate<T>::EvaluatePoissonBinPdf", "The vectorized evaluation of the BinnedLikelihood fit evaluated point by point is still not supported");
393 return -1.;
394 }
395
396 static double EvalPdf(const IModelFunctionTempl<Double_v> &, const UnBinData &, const double *, unsigned int,
397 double *, double *, bool, bool)
398 {
399 Error("FitUtil::Evaluate<T>::EvalPdf", "The vectorized evaluation of the LogLikelihood fit evaluated point by point is still not supported");
400 return -1.;
401 }
402
403 static void
404 EvalPoissonLogLGradient(const IModelFunctionTempl<Double_v> &f, const BinData &data, const double *p,
405 double *grad, unsigned int &,
407 unsigned nChunks = 0);
408
409 static void EvalLogLGradient(const IModelFunctionTempl<Double_v> &f, const UnBinData &data, const double *p,
410 double *grad, unsigned int &,
412 unsigned nChunks = 0);
413 };
414#endif // R__HAS_STD_EXPERIMENTAL_SIMD
415
416 template <>
417 struct Evaluate<double> {
418
419 static double EvalChi2(const IModelFunction &func, const BinData &data, const double *p, unsigned int &nPoints,
421 {
422 // evaluate the chi2 given a function reference, the data and returns the value and also in nPoints
423 // the actual number of used points
424 // normal chi2 using only error on values (from fitting histogram)
425 // optionally the integral of function in the bin is used
426
427
428 //Info("EvalChi2","Using non-vectorized implementation %d",(int) data.Opt().fIntegral);
429
431 }
432
433 static double EvalLogL(const IModelFunctionTempl<double> &func, const UnBinData &data, const double *p,
434 int iWeight, bool extended, unsigned int &nPoints,
436 {
438 }
439
440 static double EvalPoissonLogL(const IModelFunctionTempl<double> &func, const BinData &data, const double *p,
441 int iWeight, bool extended, unsigned int &nPoints,
443 {
445 }
446
452 static void EvalChi2Gradient(const IModelFunctionTempl<double> &func, const BinData &data, const double *p,
453 double *g, unsigned int &nPoints,
455 unsigned nChunks = 0)
456 {
458 }
459
460 static double EvalChi2Residual(const IModelFunctionTempl<double> &func, const BinData & data, const double * p, unsigned int i, double *g, double * h,
461 bool hasGrad, bool fullHessian)
462 {
464 }
465
466 /// evaluate the pdf (Poisson) contribution to the logl (return actually log of pdf)
467 /// and its gradient
468 static double EvalPoissonBinPdf(const IModelFunctionTempl<double> &func, const BinData & data, const double *p, unsigned int i, double *g, double * h, bool hasGrad, bool fullHessian) {
470 }
471
472 static double EvalPdf(const IModelFunctionTempl<double> &func, const UnBinData & data, const double *p, unsigned int i, double *g, double * h, bool hasGrad, bool fullHessian) {
473 return FitUtil::EvaluatePdf(func, data, p, i, g, h, hasGrad, fullHessian);
474 }
475
476 static void
484
485 static void EvalLogLGradient(const IModelFunctionTempl<double> &func, const UnBinData &data, const double *p,
486 double *g, unsigned int &nPoints,
488 unsigned nChunks = 0)
489 {
491 }
492 };
493
494 } // end namespace FitUtil
495
496 } // end namespace Fit
497
498 } // end namespace ROOT
499
500#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:1331
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:579
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, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
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:925
unsigned setAutomaticChunking(unsigned nEvents)
Definition FitUtil.cxx:1875
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:433
static double EvalChi2(const IModelFunction &func, const BinData &data, const double *p, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)
Definition FitUtil.h:419
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:468
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:460
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:472
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:440
static double EvalChi2Effective(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
Definition FitUtil.h:447
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:452
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:485
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:477
TLine l
Definition textangle.C:4