53 template<
class GradFunc = IGradModelFunction>
127 for (
unsigned int k = 0; k <
fN; ++k) {
136 for (
unsigned int k = 0; k <
fN; ++k) {
146 g[k] = 0.5 * ( f2 -
f1 )/
h;
162 mutable std::vector<double>
fVec;
169 if (
rval > - std::numeric_limits<double>::max() &&
rval < std::numeric_limits<double>::max() )
173 return -std::numeric_limits<double>::max();
176 return + std::numeric_limits<double>::max();
183 if (
rval > - std::numeric_limits<double>::max() &&
rval < std::numeric_limits<double>::max() )
187 rval = -std::numeric_limits<double>::max();
192 rval = + std::numeric_limits<double>::max();
201 template <
class GFunc>
203 const double *
x1,
const double *
x2,
const double *
p,
double *
g) {
210 for (
unsigned int k = 0; k <
npar; ++k ) {
211 pfunc.SetDerivComponent(k);
234 unsigned int n =
data.Size();
249 bool isWeighted =
fitOpt.fExpErrors && !
fitOpt.fErrors1 &&
data.IsWeighted();
251 std::cout <<
"\n\nFit data size = " <<
n << std::endl;
252 std::cout <<
"evaluate chi2 using function " << &func <<
" " <<
p << std::endl;
253 std::cout <<
"use empty bins " <<
fitOpt.fUseEmpty << std::endl;
255 std::cout <<
"use binvolume " <<
useBinVolume << std::endl;
256 std::cout <<
"use Exp Errors " <<
useExpErrors << std::endl;
257 std::cout <<
"use all error=1 " <<
fitOpt.fErrors1 << std::endl;
258 if (isWeighted) std::cout <<
"Weighted data set - sumw = " <<
data.SumOfContent() <<
" sumw2 = " <<
data.SumOfError2() << std::endl;
271 double maxResValue = std::numeric_limits<double>::max() /
n;
284 const auto x1 =
data.GetCoordComponent(i, 0);
285 const auto y =
data.Value(i);
290 const double *
x =
nullptr;
291 std::vector<double>
xc;
292 double binVolume = 1.0;
294 unsigned int ndim =
data.NDim();
296 for (
unsigned int j = 0;
j < ndim; ++
j) {
297 double xx = *
data.GetCoordComponent(i,
j);
298 double x2 =
data.GetBinUpEdgeComponent(i,
j);
299 binVolume *= std::abs(
x2 -
xx);
305 }
else if(
data.NDim() > 1) {
310 for (
unsigned int j = 1;
j <
data.NDim(); ++
j)
311 xc[
j] = *
data.GetCoordComponent(i,
j);
329 std::vector<double>
x2(
data.NDim());
330 data.GetBinUpEdgeCoordinates(i,
x2.data());
358 std::cout <<
x[0] <<
" " <<
y <<
" " << 1./
invError <<
" params : ";
359 for (
unsigned int ipar = 0; ipar < func.
NPar(); ++ipar)
360 std::cout <<
p[ipar] <<
"\t";
361 std::cout <<
"\tfval = " <<
fval <<
" bin volume " << binVolume <<
" ref " <<
wrefVolume << std::endl;
367 double resval = tmp * tmp;
390 Warning(
"FitUtil::EvaluateChi2",
"Multithread execution policy requires IMT, which is disabled. Changing "
391 "to ROOT::EExecutionPolicy::kSequential.");
398 for (
unsigned int i=0; i<
n; ++i) {
411 Error(
"FitUtil::EvaluateChi2",
"Execution policy unknown. Available choices:\n ROOT::EExecutionPolicy::kSequential (default)\n ROOT::EExecutionPolicy::kMultiThread (requires IMT)\n");
430 unsigned int n =
data.Size();
433 std::cout <<
"\n\nFit data size = " <<
n << std::endl;
434 std::cout <<
"evaluate effective chi2 using function " << &func <<
" " <<
p << std::endl;
445 unsigned int ndim = func.
NDim();
450 double maxResValue = std::numeric_limits<double>::max() /
n;
454 for (
unsigned int i = 0; i <
n; ++ i) {
458 const double *
x =
data.GetPoint(i,
y);
460 double fval = func(
x,
p );
466 const double *
ex =
nullptr;
467 if (!
data.HaveAsymErrors() )
480 while (
j < ndim &&
ex[
j] == 0.) {
j++; }
500 std::cout <<
"error for coord " <<
icoord <<
" = " <<
ex[
icoord] <<
" deriv " <<
deriv << std::endl;
505 double w2 = (
e2 > 0) ? 1.0/
e2 : 0;
509 std::cout <<
x[0] <<
" " <<
y <<
" ex " <<
ex[0] <<
" ey " <<
ey <<
" params : ";
510 for (
unsigned int ipar = 0; ipar < func.
NPar(); ++ipar)
511 std::cout <<
p[ipar] <<
"\t";
512 std::cout <<
"\tfval = " <<
fval <<
"\tresval = " <<
resval << std::endl;
530 std::cout <<
"chi2 = " <<
chi2 <<
" n = " <<
nPoints << std::endl;
547 MATH_ERROR_MSG(
"FitUtil::EvaluateChi2Residual",
"Error on the coordinates are not used in calculating Chi2 residual");
561 unsigned int ndim =
data.NDim();
562 double binVolume = 1.0;
563 const double *
x2 =
nullptr;
566 std::vector<double>
xc;
571 for (
unsigned int j = 0;
j < ndim; ++
j) {
572 binVolume *= std::abs(
x2[
j]-
x1[
j] );
623 return std::numeric_limits<double>::quiet_NaN();
649 for (
unsigned int k = 0; k <
npar; ++k) {
653 for (
unsigned int l = 0;
l <= k;
l++) {
654 unsigned int idx =
l + k * (k + 1) / 2;
663 h[idx] += 2. *
g[k]*
g[
l];
683 if (
data.HaveCoordErrors()) {
685 "Error on the coordinates are not used in calculating Chi2 gradient");
689 const IGradModelFunction *
fg =
dynamic_cast<const IGradModelFunction *
>(&
f);
692 const IGradModelFunction &func = *
fg;
695 std::cout <<
"\n\nFit data size = " <<
nPoints << std::endl;
696 std::cout <<
"evaluate chi2 using function gradient " << &func <<
" " <<
p << std::endl;
715 unsigned int npar = func.NPar();
725 const auto x1 =
data.GetCoordComponent(i, 0);
726 const auto y =
data.Value(i);
733 const double *
x =
nullptr;
734 std::vector<double>
xc;
736 unsigned int ndim =
data.NDim();
737 double binVolume = 1;
740 for (
unsigned int j = 0;
j < ndim; ++
j) {
741 double x1_j = *
data.GetCoordComponent(i,
j);
742 double x2_j =
data.GetBinUpEdgeComponent(i,
j);
751 }
else if (ndim > 1) {
754 for (
unsigned int j = 1;
j < ndim; ++
j)
755 xc[
j] = *
data.GetCoordComponent(i,
j);
765 std::vector<double>
x2(
data.NDim());
766 data.GetBinUpEdgeCoordinates(i,
x2.data());
776 std::cout <<
x[0] <<
" " <<
y <<
" " << 1. /
invError <<
" params : ";
777 for (
unsigned int ipar = 0; ipar <
npar; ++ipar)
778 std::cout <<
p[ipar] <<
"\t";
779 std::cout <<
"\tfval = " <<
fval << std::endl;
788 unsigned int ipar = 0;
789 for (; ipar <
npar; ++ipar) {
826 std::vector<double>
g(
npar);
831 Warning(
"FitUtil::EvaluateChi2Gradient",
"Multithread execution policy requires IMT, which is disabled. Changing "
832 "to ROOT::EExecutionPolicy::kSequential.");
856 Error(
"FitUtil::EvaluateChi2Gradient",
857 "Execution policy unknown. Available choices:\n 0: Serial (default)\n 1: MultiThread (requires IMT)\n");
875 "Error - too many points rejected for overflow in gradient calculation");
879 std::copy(
g.begin(),
g.end(), grad);
898 const double *
x =
data.Coords(i);
899 double fval = func (
x,
p );
902 if (
g ==
nullptr)
return logPdf;
910 gfunc->ParameterGradient(
x ,
p,
g );
919 for (
unsigned int ipar = 0; ipar < func.
NPar(); ++ipar) {
924 std::cout <<
x[i] <<
"\t";
925 std::cout <<
"\tpar = [ " << func.
NPar() <<
" ] = ";
926 for (
unsigned int ipar = 0; ipar < func.
NPar(); ++ipar)
927 std::cout <<
p[ipar] <<
"\t";
928 std::cout <<
"\tfval = " <<
fval;
929 std::cout <<
"\tgrad = [ ";
930 for (
unsigned int ipar = 0; ipar < func.
NPar(); ++ipar)
931 std::cout <<
g[ipar] <<
"\t";
932 std::cout <<
" ] " << std::endl;
945 unsigned int n =
data.Size();
962 if (
data.NDim() == 1) {
963 const double *
x =
data.GetCoordComponent(0,0);
967 std::vector<double>
x(
data.NDim());
968 for (
unsigned int j = 0;
j <
data.NDim(); ++
j)
969 x[
j] = *
data.GetCoordComponent(0,
j);
978 std::vector<double>
xmin(
data.NDim());
979 std::vector<double>
xmax(
data.NDim());
982 if (
data.Range().Size() > 0) {
992 if (func(
xmin.data(),
p) != 0 || func(
xmax.data(),
p) != 0) {
994 "A range has not been set and the function is not zero at +/- inf");
1008 if (
data.NDim() > 1) {
1009 std::vector<double>
x(
data.NDim());
1010 for (
unsigned int j = 0;
j <
data.NDim(); ++
j)
1011 x[
j] = *
data.GetCoordComponent(i,
j);
1012#ifdef USE_PARAMCACHE
1013 fval = func(
x.data());
1015 fval = func(
x.data(),
p);
1020 const auto x =
data.GetCoordComponent(i, 0);
1021#ifdef USE_PARAMCACHE
1034 double weight =
data.Weight(i);
1041 W2 = weight * weight;
1056 auto redFunction = [](
const std::vector<LikelihoodAux<double>> &
objs){
1058 for (
auto &
l :
objs ) {
1068 Warning(
"FitUtil::EvaluateLogL",
"Multithread execution policy requires IMT, which is disabled. Changing "
1069 "to ROOT::EExecutionPolicy::kSequential.");
1078 for (
unsigned int i=0; i<
n; ++i) {
1097 Error(
"FitUtil::EvaluateLogL",
"Execution policy unknown. Available choices:\n ROOT::EExecutionPolicy::kSequential (default)\n ROOT::EExecutionPolicy::kMultiThread (requires IMT)\n");
1102 double extendedTerm = 0;
1108 std::vector<double>
xmin(
data.NDim());
1109 std::vector<double>
xmax(
data.NDim());
1112 if (
data.Range().Size() > 0 ) {
1122 if (func(
xmin.data(),
p) != 0 || func(
xmax.data(),
p) != 0) {
1123 MATH_ERROR_MSG(
"FitUtil::EvaluateLogLikelihood",
"A range has not been set and the function is not zero at +/- inf");
1132 extendedTerm = -
nuTot;
1145 logl += extendedTerm;
1150 std::cout <<
"Evaluated log L for parameters (";
1151 for (
unsigned int ip = 0;
ip < func.NPar(); ++
ip)
1152 std::cout <<
" " <<
p[
ip];
1153 std::cout <<
") fval = " << -
logl << std::endl;
1169 unsigned int npar = func.NPar();
1175 std::cout <<
"\n===> Evaluate Gradient for parameters ";
1177 std::cout <<
" " <<
p[
ip];
1181 const double kdmax1 = std::sqrt(std::numeric_limits<double>::max());
1189 const double *
x =
nullptr;
1190 std::vector<double>
xc;
1191 if (
data.NDim() > 1) {
1193 for (
unsigned int j = 0;
j <
data.NDim(); ++
j)
1194 xc[
j] = *
data.GetCoordComponent(i,
j);
1197 x =
data.GetCoordComponent(i, 0);
1200 double fval = func(
x,
p);
1206 if (i < 5 || (i >
data.Size()-5) ) {
1207 if (
data.NDim() > 1) std::cout << i <<
" x " <<
x[0] <<
" y " <<
x[1] <<
" func " <<
fval
1209 else std::cout << i <<
" x " <<
x[0] <<
" gradient " <<
gradFunc[0] <<
" " <<
gradFunc[1] <<
" " <<
gradFunc[3] << std::endl;
1243 std::vector<double>
g(
npar);
1248 Warning(
"FitUtil::EvaluateLogLGradient",
"Multithread execution policy requires IMT, which is disabled. Changing "
1249 "to ROOT::EExecutionPolicy::kSequential.");
1269 Error(
"FitUtil::EvaluateLogLGradient",
"Execution policy unknown. Available choices:\n "
1270 "ROOT::EExecutionPolicy::kSequential (default)\n "
1271 "ROOT::EExecutionPolicy::kMultiThread (requires IMT)\n");
1280 std::copy(
g.begin(),
g.end(), grad);
1284 std::cout <<
"FitUtil.cxx : Final gradient ";
1285 for (
unsigned int param = 0; param <
npar; param++) {
1286 std::cout <<
" " << grad[param];
1299 const double *
x1 =
data.GetPoint(i,
y);
1306 const double *
x2 =
nullptr;
1308 double binVolume = 1;
1309 std::vector<double>
xc;
1311 unsigned int ndim =
data.NDim();
1313 for (
unsigned int j = 0;
j < ndim; ++
j) {
1314 double x2j =
data.GetBinUpEdgeComponent(i,
j);
1315 binVolume *= std::abs(
x2j-
x1[
j] );
1319 binVolume /=
data.RefVolume();
1330 std::vector<double>
vx2(
data.NDim());
1331 data.GetBinUpEdgeCoordinates(i,
vx2.data());
1353 return std::numeric_limits<double>::quiet_NaN();
1359 gfunc->ParameterGradient(
x ,
p,
g );
1361 if (!
gfunc->HasParameterHessian())
1362 return std::numeric_limits<double>::quiet_NaN();
1365 return std::numeric_limits<double>::quiet_NaN();
1385 double coeffGrad = (
fval > 0) ? (1. -
y/
fval) : ( (
y > 0) ? std::sqrt( std::numeric_limits<double>::max() ) : 1. );
1386 double coeffHess = (
fval > 0) ?
y/(
fval*
fval) : ( (
y > 0) ? std::sqrt( std::numeric_limits<double>::max() ) : 0. );
1391 for (
unsigned int k = 0; k <
npar; ++k) {
1394 for (
unsigned int l = k;
l <
npar; ++
l) {
1395 unsigned int idx = k +
l * (
l + 1) / 2;
1414 std::cout <<
"x = " <<
x[0] <<
" y " <<
y <<
" fval " <<
fval <<
" logPdf = " <<
nlogPdf <<
" gradient : ";
1415 for (
unsigned int ipar = 0; ipar <
npar; ++ipar)
1416 std::cout <<
g[ipar] <<
"\t";
1418 std::cout <<
"\thessian : ";
1419 for (
unsigned int ipar = 0; ipar <
npar; ++ipar) {
1422 std::cout <<
h[ipar +
jpar * (
jpar + 1) / 2] <<
"\t";
1427 std::cout << std::endl;
1455 unsigned int n =
data.Size();
1457#ifdef USE_PARAMCACHE
1458 (
const_cast<IModelFunction &
>(func)).SetParameters(
p);
1478 std::cout <<
"Evaluate PoissonLogL for params = [ ";
1479 for (
unsigned int j = 0;
j < func.NPar(); ++
j) std::cout <<
p[
j] <<
" , ";
1480 std::cout <<
"] - data size = " <<
n <<
" useBinIntegral " <<
useBinIntegral <<
" useBinVolume "
1490#ifdef USE_PARAMCACHE
1497 auto x1 =
data.GetCoordComponent(i, 0);
1498 auto y = *
data.ValuePtr(i);
1500 const double *
x =
nullptr;
1501 std::vector<double>
xc;
1503 double binVolume = 1.0;
1506 unsigned int ndim =
data.NDim();
1508 for (
unsigned int j = 0;
j < ndim; ++
j) {
1509 double xx = *
data.GetCoordComponent(i,
j);
1510 double x2 =
data.GetBinUpEdgeComponent(i,
j);
1511 binVolume *= std::abs(
x2 -
xx);
1517 }
else if (
data.NDim() > 1) {
1520 for (
unsigned int j = 1;
j <
data.NDim(); ++
j) {
1521 xc[
j] = *
data.GetCoordComponent(i,
j);
1529#ifdef USE_PARAMCACHE
1537 std::vector<double>
x2(
data.NDim());
1538 data.GetBinUpEdgeCoordinates(i,
x2.data());
1548 std::cout <<
"evt " << i <<
" x = [ ";
1549 for (
unsigned int j = 0;
j < func.NDim(); ++
j) std::cout <<
x[
j] <<
" , ";
1552 std::cout <<
"x2 = [ ";
1553 for (
unsigned int j = 0;
j < func.NDim(); ++
j) std::cout <<
data.GetBinUpEdgeComponent(i,
j) <<
" , ";
1556 std::cout <<
" y = " <<
y <<
" fval = " <<
fval << std::endl;
1574 double weight = 1.0;
1576 double error =
data.Error(i);
1577 weight = (error * error) /
y;
1582 weight =
data.SumOfError2()/
data.SumOfContent();
1602 std::cout <<
" nll = " <<
nloglike << std::endl;
1617 Warning(
"FitUtil::EvaluatePoissonLogL",
"Multithread execution policy requires IMT, which is disabled. Changing "
1618 "to ROOT::EExecutionPolicy::kSequential.");
1625 for (
unsigned int i = 0; i <
n; ++i) {
1638 Error(
"FitUtil::EvaluatePoissonLogL",
1639 "Execution policy unknown. Available choices:\n ROOT::EExecutionPolicy::kSequential (default)\n ROOT::EExecutionPolicy::kMultiThread (requires IMT)\n");
1643 std::cout <<
"Loglikelihood = " << res << std::endl;
1659#ifdef USE_PARAMCACHE
1679 unsigned int npar = func.NPar();
1687 const auto x1 =
data.GetCoordComponent(i, 0);
1688 const auto y =
data.Value(i);
1695 const double *
x =
nullptr;
1696 std::vector<double>
xc;
1698 unsigned ndim =
data.NDim();
1699 double binVolume = 1.0;
1704 for (
unsigned int j = 0;
j < ndim; ++
j) {
1705 double x1_j = *
data.GetCoordComponent(i,
j);
1706 double x2_j =
data.GetBinUpEdgeComponent(i,
j);
1707 binVolume *= std::abs(
x2_j -
x1_j);
1715 }
else if (ndim > 1) {
1718 for (
unsigned int j = 1;
j < ndim; ++
j)
1719 xc[
j] = *
data.GetCoordComponent(i,
j);
1731 std::vector<double>
x2(
data.NDim());
1732 data.GetBinUpEdgeCoordinates(i,
x2.data());
1742 if (i < 5 || (i >
data.Size()-5) ) {
1743 if (
data.NDim() > 1) std::cout << i <<
" x " <<
x[0] <<
" y " <<
x[1] <<
" func " <<
fval
1745 else std::cout << i <<
" x " <<
x[0] <<
" gradient " <<
gradFunc[0] <<
" " <<
gradFunc[1] <<
" " <<
gradFunc[3] << std::endl;
1751 for (
unsigned int ipar = 0; ipar <
npar; ++ipar) {
1761 const double kdmax1 = std::sqrt(std::numeric_limits<double>::max());
1788 std::vector<double>
g(
npar);
1793 Warning(
"FitUtil::EvaluatePoissonLogLGradient",
1794 "Multithread execution policy requires IMT, which is disabled. Changing "
1795 "to ROOT::EExecutionPolicy::kSequential.");
1820 Error(
"FitUtil::EvaluatePoissonLogLGradient",
1821 "Execution policy unknown. Available choices:\n 0: Serial (default)\n 1: MultiThread (requires IMT)\n");
1830 std::copy(
g.begin(),
g.end(), grad);
1833 std::cout <<
"***** Final gradient : ";
1834 for (
unsigned int ii = 0;
ii<
npar; ++
ii) std::cout << grad[
ii] <<
" ";
1843 if (nEvents/
ncpu < 1000)
return ncpu;
1844 return nEvents/1000;
#define MATH_ERROR_MSG(loc, str)
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.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
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 GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
R__EXTERN TVirtualMutex * gROOTMutex
#define R__LOCKGUARD(mutex)
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
SimpleGradientCalculator(int gdim, const IModelFunction &func, double eps=2.E-8, int istrat=1)
const IModelFunction & fFunc
std::vector< double > fVec
double ParameterDerivative(const double *x, const double *p, int ipar) const
void Gradient(const double *x, const double *p, double f0, double *g)
unsigned int NDim() const
void ParameterGradient(const double *x, const double *p, double f0, double *g)
unsigned int NPar() const
double DoParameterDerivative(const double *x, const double *p, double f0, int k) const
Class describing the un-binned data sets (just x coordinates values) of any dimensions.
virtual unsigned int NDim() const =0
Retrieve the dimension of the function.
virtual void SetParameters(const double *p)=0
Set the parameter values.
virtual unsigned int NPar() const =0
Return the number of Parameters.
Interface (abstract class) for parametric gradient multi-dimensional functions providing in addition ...
OneDimMultiFunctionAdapter class to wrap a multidimensional function in one dimensional one.
User class for calculating the derivatives of a function.
const_iterator begin() const
const_iterator end() const
A pseudo container class which is a generator of indices.
This class provides a simple interface to execute the same task multiple times in parallel threads,...
Type
enumeration specifying the integration types.
@ kGAUSS
simple Gauss integration method with fixed rule
@ kDEFAULT
default type specified in the static options
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
ROOT::Math::IParamMultiGradFunction IGradModelFunction
void CalculateGradientIntegral(const GFunc &gfunc, const double *x1, const double *x2, const double *p, double *g)
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.
double CorrectValue(double rval)
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...
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.
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.
bool CheckInfNaNValue(double &rval)
unsigned setAutomaticChunking(unsigned nEvents)
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.
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.
T EvalLog(T x)
safe evaluation of log(x) with a protections against negative or zero argument to the log smooth line...
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
UInt_t GetThreadPoolSize()
Returns the size of ROOT's thread pool.
DataOptions : simple structure holding the options on how the data are filled.
double operator()(const double *x, const double *p) const
void SetDerivComponent(unsigned int ipar)
unsigned int NDim() const
ParamDerivFunc(const GradFunc &f)