66 GFunc(
const TF1 *
function ,
double y): fFunction(
function), fY0(y) {}
69 return fFunction->
Eval(x) - fY0;
77 GInverseFunc(
const TF1 *
function): fFunction(
function) {}
81 return - fFunction->
Eval(x);
85 class GInverseFuncNdim {
88 GInverseFuncNdim(
TF1 *
function): fFunction(
function) {}
108 fFunc->InitArgs(fX, fPar);
109 if (par) fFunc->SetParameters(par);
115 TF1_EvalWrapper *f =
new TF1_EvalWrapper(*
this);
116 f->fFunc->InitArgs(f->fX, f->fPar);
124 Double_t fval = fFunc->EvalPar(fX, 0);
125 if (fAbsVal && fval < 0)
return -fval;
132 return fX[0] *
TMath::Abs(fFunc->EvalPar(fX, 0));
405 fXmin(0), fXmax(0), fNpar(0), fNdim(0),
fType(
EFType::kFormula)
438 if (
TString(formula, 5) ==
"CONV(" && formula[strlen(formula) - 1] ==
')') {
440 int delimPosition = -1;
442 for (
unsigned int i = 5; i < strlen(formula) - 1; i++) {
443 if (formula[i] ==
'(')
445 else if (formula[i] ==
')')
447 else if (formula[i] ==
',' && parenCount == 0) {
448 if (delimPosition == -1)
451 Error(
"TF1",
"CONV takes 2 arguments. Too many arguments found in : %s", formula);
454 if (delimPosition == -1)
455 Error(
"TF1",
"CONV takes 2 arguments. Only one argument found in : %s", formula);
459 TString formula2 =
TString(
TString(formula)(delimPosition + 1, strlen(formula) - 1 - (delimPosition + 1)));
464 TF1 *function1 = (
TF1 *)(
gROOT->GetListOfFunctions()->FindObject(formula1));
465 if (function1 ==
nullptr)
466 function1 =
new TF1((
const char *)formula1, (
const char *)formula1, xmin, xmax);
467 TF1 *function2 = (
TF1 *)(
gROOT->GetListOfFunctions()->FindObject(formula2));
468 if (function2 ==
nullptr)
469 function2 =
new TF1((
const char *)formula2, (
const char *)formula2, xmin, xmax);
479 fType = EFType::kCompositionFcn;
480 fComposition = std::unique_ptr<TF1AbsComposition>(conv);
484 for (
int i = 0; i <
fNpar; i++)
487 int f1Npar = function1->
GetNpar();
488 int f2Npar = function2->
GetNpar();
490 for (
int i = 0; i < f1Npar; i++)
494 if (conv->
GetNpar() == f1Npar + f2Npar - 1) {
499 for (
int i = 0; i < f2Npar; i++)
506 for (
int i = 0; i < f2Npar; i++)
511 }
else if (
TString(formula, 5) ==
"NSUM(" && formula[strlen(formula) - 1] ==
')') {
513 char delimiter =
',';
529 for (
int i = 0; i < formDense.
Length(); ++i) {
530 if (formDense[i] ==
'(')
532 else if (formDense[i] ==
')')
534 else if (formDense[i] == delimiter && parenCount == 0) {
536 DefineNSUMTerm(newFuncs, coeffNames, fullFormula, formDense, termStart, i, xmin, xmax);
544 if (xmin == 0 && xmax == 1.)
Info(
"TF1",
"Created TF1NormSum object using the default [0,1] range");
546 fNpar = normSum->GetNpar();
549 fType = EFType::kCompositionFcn;
550 fComposition = std::unique_ptr<TF1AbsComposition>(normSum);
556 for (
int i = 0; i <
fNpar; i++) {
557 if (coeffNames->
At(i) !=
nullptr) {
578 if (
fNdim > 1 && xmin < xmax) {
579 Error(
"TF1",
"function: %s/%s has dimension %d instead of 1", name, formula,
fNdim);
594 if (opt ==
nullptr)
return false;
597 if (option.
Contains(
"VEC"))
return true;
629 Info(
"TF1",
"TF1 has name * - it is not well defined");
632 Error(
"TF1",
"requires a proper function name!");
640 Error(
"TF1",
"No function found with the signature %s(Double_t*,Double_t*)", name);
704 if (doAdd &&
gROOT) {
710 gROOT->GetListOfFunctions()->Remove(f1old);
715 gROOT->GetListOfFunctions()->Add(
this);
746 if (!
gROOT)
return false;
752 assert(
gROOT->GetListOfFunctions()->FindObject(
this) !=
nullptr);
759 gROOT->GetListOfFunctions()->Add(
this);
761 }
else if (prevStatus) {
767 Warning(
"AddToGlobalList",
"Function is supposed to be in the global list but it is not present");
770 gROOT->GetListOfFunctions()->Remove(
this);
783 TString originalTerm = formula(termStart, termEnd-termStart);
785 if (coeffLength != -1)
786 termStart += coeffLength + 1;
791 TString originalFunc = formula(termStart, termEnd-termStart);
792 TString cleanedFunc =
TString(formula(termStart, termEnd-termStart))
797 if (!
gROOT->GetListOfFunctions()->FindObject(cleanedFunc))
798 newFuncs->
Add(
new TF1(cleanedFunc, originalFunc, xmin, xmax));
801 if (fullFormula.
Length() != 0)
805 if (coeffLength != -1 && originalTerm[0] !=
'[')
806 fullFormula.
Append(originalTerm(0, coeffLength+1));
809 if (coeffLength != -1 && originalTerm[0] ==
'[')
812 coeffNames->
Add(
nullptr);
814 fullFormula.
Append(cleanedFunc);
822 int firstAsterisk = term.
First(
'*');
823 if (firstAsterisk == -1)
826 if (
TString(term(0,firstAsterisk)).IsFloat())
827 return firstAsterisk;
829 if (term[0] ==
'[' && term[firstAsterisk-1] ==
']' 830 &&
TString(term(1,firstAsterisk-2)).IsAlnum())
831 return firstAsterisk;
859 if (
gROOT)
gROOT->GetListOfFunctions()->Remove(
this);
875 ((
TF1 &)f1).Copy(*
this);
908 delete((
TF1 &)obj).fHistogram;
909 delete((
TF1 &)obj).fMethodCall;
933 ((
TF1 &)obj).fHistogram = 0;
934 ((
TF1 &)obj).fMethodCall = 0;
937 ((
TF1 &)obj).fFormula = 0;
946 ((
TF1 &)obj).fMethodCall =
m;
950 if (formulaToCopy)
delete formulaToCopy;
953 ((
TF1 &)obj).fFormula = formulaToCopy;
957 if (paramsToCopy) *paramsToCopy = *
fParams;
964 ((
TF1 &)obj).fComposition = std::unique_ptr<TF1AbsComposition>(comp);
1007 Warning(
"Derivative",
"Function dimension is larger than one");
1014 double h = eps * std::abs(xmax - xmin);
1015 if (h <= 0) h = 0.001;
1072 Warning(
"Derivative2",
"Function dimension is larger than one");
1079 double h = eps * std::abs(xmax - xmin);
1080 if (h <= 0) h = 0.001;
1137 Warning(
"Derivative3",
"Function dimension is larger than one");
1144 double h = eps * std::abs(xmax - xmin);
1145 if (h <= 0) h = 0.001;
1187 Int_t distance = 9999;
1190 if (distance <= 1)
return distance;
1197 xx[0] =
gPad->PadtoX(x);
1198 if (xx[0] <
fXmin || xx[0] >
fXmax)
return distance;
1232 gPad->IncrementPaletteColor(1, opt);
1256 TF1 *newf1 = (
TF1 *)this->IsA()->New();
1284 if (padsav) padsav->
cd();
1309 if (padsav) padsav->
cd();
1343 return ((
TF1 *)
this)->EvalPar(xx, pp);
1369 if (
fType == EFType::kFormula) {
1378 if (
fType == EFType::kPtrScalarFreeFcn ||
fType == EFType::kTemplScalar) {
1391 if (
fType == EFType::kInterpreted) {
1401 #ifdef R__HAS_VECCORE 1402 if (
fType == EFType::kTemplVec) {
1404 if (params) result = EvalParVec(x, params);
1418 if (
fType == EFType::kCompositionFcn) {
1420 Error(
"EvalPar",
"Composition function not found");
1422 result = (*fComposition)(
x, params);
1439 if (!
gPad->GetView()) {
1451 if (ipar < 0 || ipar >
GetNpar() - 1)
return;
1463 ::Warning(
"TF1::GetCurrent",
"This function is obsolete and is working only for the current painted functions");
1477 const_cast<TF1 *
>(
this)->
fHistogram = const_cast<TF1 *>(
this)->CreateHistogram();
1508 if (!logx &&
gPad != 0) logx =
gPad->GetLogx();
1511 GInverseFunc
g(
this);
1516 bm.
Minimize(maxiter, epsilon, epsilon);
1549 if (!logx &&
gPad != 0) logx =
gPad->GetLogx();
1552 GInverseFunc
g(
this);
1557 bm.
Minimize(maxiter, epsilon, epsilon);
1590 if (!logx &&
gPad != 0) logx =
gPad->GetLogx();
1597 bm.
Minimize(maxiter, epsilon, epsilon);
1616 Error(
"GetMinimumNDim",
"Function of dimension 0 - return Eval(x)");
1617 return (const_cast<TF1 &>(*
this))(
x);
1626 Error(
"GetMinimumNDim",
"Error creating minimizer %s", minimName);
1637 GInverseFuncNdim invFunc(const_cast<TF1 *>(
this));
1644 std::vector<double> rmin(ndim);
1645 std::vector<double> rmax(ndim);
1647 for (
int i = 0; i < ndim; ++i) {
1648 const char *xname = 0;
1649 double stepSize = 0.1;
1651 if (rmax[i] > rmin[i])
1652 stepSize = (rmax[i] - rmin[i]) / 100;
1653 else if (std::abs(x[i]) > 1.)
1654 stepSize = 0.1 * x[i];
1660 }
else if (i == 1) {
1670 if (rmin[i] < rmax[i]) {
1680 Error(
"GetMinimumNDim",
"Error minimizing function %s",
GetName());
1682 if (min->
X()) std::copy(min->
X(), min->
X() + ndim,
x);
1686 return (findmax) ? -fmin : fmin;
1722 bm.
Minimize(maxiter, epsilon, epsilon);
1757 if (!logx &&
gPad != 0) logx =
gPad->GetLogx();
1765 brf.
Solve(maxiter, epsilon, epsilon);
1792 for (
Int_t i = 0; i < ntot; i++) {
1793 ((
TF1 *)
this)->GetParLimits(i, al, bl);
1794 if (al * bl != 0 && al >= bl) nfree--;
1807 static char info[64];
1819 if (ipar < 0 || ipar >
GetNpar() - 1)
return 0;
1833 if (ipar < 0 || ipar > n - 1)
return;
1844 if (
fNDF <= 0)
return 0;
1888 const Double_t dx = (xMax - xMin) / npx;
1896 Int_t intNegative = 0;
1898 for (i = 0; i < npx; i++) {
1904 integral[i + 1] = integral[i] + integ;
1907 if (intNegative > 0)
1908 Warning(
"GetQuantiles",
"function:%s has %d negative values: abs assumed",
1910 if (integral[npx] == 0) {
1911 Error(
"GetQuantiles",
"Integral of function is zero");
1916 for (i = 1; i <= npx; i++) integral[i] /= total;
1920 for (i = 0; i < npx; i++) {
1922 const Double_t r2 = integral[i + 1] - integral[i];
1924 gamma[i] = (2 * r2 - 4 * r1) / (dx * dx);
1925 beta[i] = r2 / dx - gamma[i] * dx;
1932 for (i = 0; i < nprobSum; i++) {
1946 const Double_t rr = r - integral[bin];
1949 const Double_t fac = -2.*gamma[bin] * rr / beta[bin] / beta[bin];
1950 if (fac != 0 && fac <= 1)
1951 xx = (-beta[bin] +
TMath::Sqrt(beta[bin] * beta[bin] + 2 * gamma[bin] * rr)) / gamma[bin];
1952 else if (beta[bin] != 0.)
1953 xx = rr / beta[bin];
1954 q[i] = alpha[bin] + xx;
1957 if (integral[bin + 1] == r) q[i] += dx;
1992 Int_t intNegative = 0;
1998 if (xmin > 0 && xmax / xmin >
fNpx) {
2007 for (i = 0; i <
fNpx; i++) {
2008 xx[i] = xmin + i * dx;
2011 for (i = 0; i <
fNpx; i++) {
2015 integ =
Integral(xx[i], xx[i + 1], 0.0);
2023 if (intNegative > 0) {
2024 Warning(
"GetRandom",
"function:%s has %d negative values: abs assumed",
GetName(), intNegative);
2028 Error(
"GetRandom",
"Integral of function is zero");
2032 for (i = 1; i <=
fNpx; i++) {
2039 for (i = 0; i <
fNpx; i++) {
2044 r3 = 2 * r2 - 4 * r1;
2063 yy = rr /
fBeta[bin];
2104 Int_t intNegative = 0;
2106 for (i = 0; i <
fNpx; i++) {
2114 if (intNegative > 0) {
2115 Warning(
"GetRandom",
"function:%s has %d negative values: abs assumed",
GetName(), intNegative);
2118 Error(
"GetRandom",
"Integral of function is zero");
2122 for (i = 1; i <=
fNpx; i++) {
2129 for (i = 0; i <
fNpx; i++) {
2130 x0 =
fXmin + i * dx;
2133 r3 = 2 * r2 - 4 * r1;
2146 if (nbinmax >
fNpx) nbinmax =
fNpx;
2161 xx = rr /
fBeta[bin];
2163 }
while (x < xmin || x > xmax);
2176 for (
int i = 0; i < ndim; ++i) {
2180 }
else if (i == 1) {
2183 }
else if (i == 2) {
2235 if (
fSave.size() == 0)
return 0;
2237 int fNsave =
fSave.size();
2243 xmin =
fSave[fNsave - 3];
2244 xmax =
fSave[fNsave - 2];
2245 if (
fSave[fNsave - 1] == xmax) {
2254 ylow =
fSave[bin - bin1];
2255 yup =
fSave[bin - bin1 + 1];
2259 ylow =
fSave[bin - bin1 - 1];
2260 yup =
fSave[bin - bin1];
2263 y = ((xup * ylow - xlow * yup) + x * (yup - ylow)) / dx;
2267 Int_t np = fNsave - 3;
2270 dx = (xmax -
xmin) / np;
2271 if (x < xmin || x > xmax)
return 0;
2274 if (dx <= 0)
return 0;
2277 xlow = xmin + bin * dx;
2280 yup =
fSave[bin + 1];
2281 y = ((xup * ylow - xlow * yup) + x * (yup - ylow)) / dx;
2336 return GradientParTempl<Double_t>(ipar,
x, eps);
2355 GradientParTempl<Double_t>(
x, grad, eps);
2366 if (params) args[1] = (
Long_t)params;
2380 if (!
gROOT->GetListOfFunctions()->FindObject(
"gaus")) {
2381 f1 =
new TF1(
"gaus",
"gaus", -1, 1);
2383 f1 =
new TF1(
"gausn",
"gausn", -1, 1);
2385 f1 =
new TF1(
"landau",
"landau", -1, 1);
2387 f1 =
new TF1(
"landaun",
"landaun", -1, 1);
2389 f1 =
new TF1(
"expo",
"expo", -1, 1);
2391 for (
Int_t i = 0; i < 10; i++) {
2392 f1 =
new TF1(
Form(
"pol%d", i),
Form(
"pol%d", i), -1, 1);
2421 Warning(
"analytical integral not available for %s - with number %d compute numerical integral",
GetName(),
GetNumber());
2518 error = iod.
Error();
2530 error = iod.
Error();
2535 Warning(
"IntegralOneDim",
"Error found in integrating function %s in [%f,%f] using %s. Result = %f +/- %f - status = %d",
GetName(), a, b, igName.c_str(), result, error, status);
2536 TString msg(
"\t\tFunction Parameters = {");
2537 for (
int ipar = 0; ipar <
GetNpar(); ++ipar) {
2542 Info(
"IntegralOneDim",
"%s", msg.Data());
2600 x1[0] =
a, x2[0] =
b;
2677 Int_t nfnevl, ifail;
2681 Warning(
"IntegralMultiple",
"failed code=%d, ", ifail);
2740 nfnevl = aimd.
NEval();
2746 relerr = (result != 0) ? imd.
Error() / std::abs(result) : imd.
Error();
2776 if (
fType == EFType::kFormula) {
2777 printf(
"Formula based function: %s \n",
GetName());
2780 }
else if (
fType > 0) {
2781 if (
fType == EFType::kInterpreted)
2782 printf(
"Interpreted based function: %s(double *x, double *p). Ndim = %d, Npar = %d \n",
GetName(),
GetNdim(),
2784 else if (
fType == EFType::kCompositionFcn) {
2787 printf(
"fComposition not found!\n");
2790 printf(
"Compiled based function: %s based on a functor object. Ndim = %d, Npar = %d\n",
GetName(),
2793 printf(
"Function based on a list of points from a compiled based function: %s. Ndim = %d, Npar = %d, Npx " 2797 Warning(
"Print",
"Function %s is based on a list of points but list is empty",
GetName());
2805 printf(
"List of Parameters: \n");
2806 for (
int i = 0; i <
fNpar; ++i)
2809 if (!
fSave.empty()) {
2811 printf(
"List of Saved points (N=%d): \n",
int(
fSave.size()));
2812 for (
auto &x :
fSave)
2813 printf(
"( %10f ) ", x);
2819 printf(
"Contained histogram\n");
2835 strlcpy(option,choptin,32);
2849 pmin =
gPad->PadtoX(
gPad->GetUxmin());
2850 pmax =
gPad->PadtoX(
gPad->GetUxmax());
2853 if (xmax < pmin)
return;
2854 if (xmin > pmax)
return;
2855 if (xmin < pmin) xmin = pmin;
2856 if (xmax > pmax) xmax = pmax;
2862 char *l1 = strstr(option,
"PFC");
2863 char *l2 = strstr(option,
"PLC");
2864 char *l3 = strstr(option,
"PMC");
2865 if (l1 || l2 || l3) {
2875 if (minimum <= 0 && gPad && gPad->GetLogy()) minimum = -1111;
2878 if (minimum == -1111) {
2885 if (minimum == -1111) {
2887 if (optSAME &&
gPad) hmin =
gPad->GetUymin();
2892 if (optSAME &&
gPad) hmax =
gPad->GetUymax();
2894 hmin -= 0.05 * (hmax - hmin);
2895 if (hmin < 0) hmin = 0;
2896 if (hmin <= 0 && gPad && gPad->GetLogy()) hmin = hminpos;
2903 if (maximum == -1111) {
2941 char *semicol = (
char *)strstr(
GetTitle(),
";");
2943 Int_t nxt = strlen(semicol);
2944 char *ctemp =
new char[nxt];
2945 strlcpy(ctemp, semicol + 1, nxt);
2946 semicol = (
char *)strstr(ctemp,
";");
2949 ytitle = semicol + 1;
2976 if (xmin > 0 &&
gPad &&
gPad->GetLogx()) {
2981 for (i = 0; i <=
fNpx; i++) {
2982 xbins[i] =
gPad->PadtoX(xlogmin + i * dlogx);
3002 for (i = 1; i <=
fNpx; i++) {
3032 if (ipar < 0 || ipar >
GetNpar() - 1)
return;
3050 int fNsave = bin2 - bin1 + 4;
3052 fSave.resize(fNsave);
3056 for (
Int_t i = bin1; i <= bin2; i++) {
3066 int fNsave =
fNpx + 3;
3071 fSave.resize(fNsave);
3076 xmin =
fXmin + 0.5 * dx;
3077 xmax =
fXmax - 0.5 * dx;
3082 xv[0] = xmin + dx * i;
3099 if (strstr(option,
"cc")) {
3100 out <<
"double " <<
GetName() <<
"(double xv) {" << std::endl;
3102 out <<
" double x[" <<
fNpx <<
"] = {" << std::endl;
3105 for (i = 0; i <
fNpx; i++) {
3106 out <<
fXmin + dx *i ;
3107 if (i < fNpx - 1) out <<
", ";
3115 out <<
" };" << std::endl;
3116 out <<
" double y[" << fNpx <<
"] = {" << std::endl;
3119 for (i = 0; i <
fNpx; i++) {
3121 if (i < fNpx - 1) out <<
", ";
3129 out <<
" };" << std::endl;
3130 out <<
" if (xv<x[0]) return y[0];" << std::endl;
3131 out <<
" if (xv>x[" << fNpx - 1 <<
"]) return y[" << fNpx - 1 <<
"];" << std::endl;
3132 out <<
" int i, j=0;" << std::endl;
3133 out <<
" for (i=1; i<" << fNpx <<
"; i++) { if (xv < x[i]) break; j++; }" << std::endl;
3134 out <<
" return y[j] + (y[j + 1] - y[j]) / (x[j + 1] - x[j]) * (xv - x[j]);" << std::endl;
3135 out <<
"}" << std::endl;
3139 out <<
" " << std::endl;
3142 static Int_t f1Number = 0;
3144 const char *
l = strstr(option,
"#");
3146 sscanf(&l[1],
"%d", &f1Number);
3152 const char *addToGlobList =
fParent ?
", TF1::EAddToList::kNo" :
", TF1::EAddToList::kDefault";
3155 out <<
" TF1 *" << f1Name.
Data() <<
" = new TF1(" << quote <<
GetName() << quote <<
"," << quote <<
GetTitle() << quote <<
"," <<
fXmin <<
"," <<
fXmax << addToGlobList <<
");" << std::endl;
3157 out <<
" " << f1Name.
Data() <<
"->SetNpx(" <<
fNpx <<
");" << std::endl;
3160 out <<
" TF1 *" << f1Name.
Data() <<
" = new TF1(" << quote <<
"*" <<
GetName() << quote <<
"," <<
fXmin <<
"," <<
fXmax <<
"," <<
GetNpar() <<
");" << std::endl;
3161 out <<
" //The original function : " <<
GetTitle() <<
" had originally been created by:" << std::endl;
3163 out <<
", 1" << addToGlobList <<
");" << std::endl;
3164 out <<
" " << f1Name.
Data() <<
"->SetRange(" <<
fXmin <<
"," <<
fXmax <<
");" << std::endl;
3165 out <<
" " << f1Name.
Data() <<
"->SetName(" << quote <<
GetName() << quote <<
");" << std::endl;
3166 out <<
" " << f1Name.
Data() <<
"->SetTitle(" << quote <<
GetTitle() << quote <<
");" << std::endl;
3168 out <<
" " << f1Name.
Data() <<
"->SetNpx(" <<
fNpx <<
");" << std::endl;
3174 for (i = 0; i <=
fNpx; i++) {
3175 xv[0] =
fXmin + dx * i;
3177 out <<
" " << f1Name.
Data() <<
"->SetSavedPoint(" << i <<
"," << save <<
");" << std::endl;
3179 out <<
" " << f1Name.
Data() <<
"->SetSavedPoint(" <<
fNpx + 1 <<
"," <<
fXmin <<
");" << std::endl;
3180 out <<
" " << f1Name.
Data() <<
"->SetSavedPoint(" <<
fNpx + 2 <<
"," <<
fXmax <<
");" << std::endl;
3184 out <<
" " << f1Name.
Data() <<
"->SetBit(TF1::kNotDraw);" << std::endl;
3189 out <<
" " << f1Name.
Data() <<
"->SetFillColor(ci);" << std::endl;
3191 out <<
" " << f1Name.
Data() <<
"->SetFillColor(" <<
GetFillColor() <<
");" << std::endl;
3194 out <<
" " << f1Name.
Data() <<
"->SetFillStyle(" <<
GetFillStyle() <<
");" << std::endl;
3199 out <<
" " << f1Name.
Data() <<
"->SetMarkerColor(ci);" << std::endl;
3201 out <<
" " << f1Name.
Data() <<
"->SetMarkerColor(" <<
GetMarkerColor() <<
");" << std::endl;
3204 out <<
" " << f1Name.
Data() <<
"->SetMarkerStyle(" <<
GetMarkerStyle() <<
");" << std::endl;
3207 out <<
" " << f1Name.
Data() <<
"->SetMarkerSize(" <<
GetMarkerSize() <<
");" << std::endl;
3212 out <<
" " << f1Name.
Data() <<
"->SetLineColor(ci);" << std::endl;
3214 out <<
" " << f1Name.
Data() <<
"->SetLineColor(" <<
GetLineColor() <<
");" << std::endl;
3217 out <<
" " << f1Name.
Data() <<
"->SetLineWidth(" <<
GetLineWidth() <<
");" << std::endl;
3220 out <<
" " << f1Name.
Data() <<
"->SetLineStyle(" <<
GetLineStyle() <<
");" << std::endl;
3223 out <<
" " << f1Name.
Data() <<
"->SetChisquare(" <<
GetChisquare() <<
");" << std::endl;
3224 out <<
" " << f1Name.
Data() <<
"->SetNDF(" <<
GetNDF() <<
");" << std::endl;
3231 for (i = 0; i <
GetNpar(); i++) {
3232 out <<
" " << f1Name.
Data() <<
"->SetParameter(" << i <<
"," <<
GetParameter(i) <<
");" << std::endl;
3233 out <<
" " << f1Name.
Data() <<
"->SetParError(" << i <<
"," <<
GetParError(i) <<
");" << std::endl;
3235 out <<
" " << f1Name.
Data() <<
"->SetParLimits(" << i <<
"," << parmin <<
"," << parmax <<
");" << std::endl;
3237 if (!strstr(option,
"nodraw")) {
3238 out <<
" " << f1Name.
Data() <<
"->Draw(" 3239 << quote << option << quote <<
");" << std::endl;
3265 Warning(
"SetFitResult",
"Empty Fit result - nothing is set in TF1");
3268 if (indpar == 0 && npar != (
int) result.
NPar()) {
3269 Error(
"SetFitResult",
"Invalid Fit result passed - number of parameter is %d , different than TF1::GetNpar() = %d", npar, result.
NPar());
3272 if (result.
Chi2() > 0)
3281 for (
Int_t i = 0; i < npar; ++i) {
3282 Int_t ipar = (indpar != 0) ? indpar[i] : i;
3283 if (ipar < 0)
continue;
3286 if (ipar < (
int) result.
Errors().size())
3341 const Int_t minPx = 4;
3342 Int_t maxPx = 10000000;
3343 if (
GetNdim() > 1) maxPx = 10000;
3344 if (npx >= minPx && npx <= maxPx) {
3347 if (npx < minPx)
fNpx = minPx;
3348 if (npx > maxPx)
fNpx = maxPx;
3349 Warning(
"SetNpx",
"Number of points must be >=%d && <= %d, fNpx set to %d", minPx, maxPx,
fNpx);
3359 if (ipar < 0 || ipar >=
GetNpar())
return;
3368 void TF1::SetParNames(
const char *name0,
const char *name1,
const char *name2,
const char *name3,
const char *name4,
3369 const char *name5,
const char *name6,
const char *name7,
const char *name8,
const char *name9,
const char *name10)
3372 fFormula->
SetParNames(name0, name1, name2, name3, name4, name5, name6, name7, name8, name9, name10);
3374 fParams->
SetParNames(name0, name1, name2, name3, name4, name5, name6, name7, name8, name9, name10);
3381 if (ipar < 0 || ipar >
GetNpar() - 1)
return;
3392 if (!errors)
return;
3407 if (ipar < 0 || ipar > npar - 1)
return;
3408 if (
int(
fParMin.size()) != npar) {
3411 if (
int(
fParMax.size()) != npar) {
3441 if (
fSave.size() == 0) {
3444 if (point < 0 || point >=
int(
fSave.size()))
return;
3445 fSave[point] = value;
3468 void TF1::Streamer(
TBuffer &b)
3482 gROOT->GetListOfFunctions()->Add(
this);
3494 if (fold.
fType == 0) {
3535 for (
int ibit = 0; ibit < 24; ++ibit)
3540 fOldLine.
Copy(*
this);
3542 fOldFill.
Copy(*
this);
3544 fOldMarker.
Copy(*
this);
3557 if (
fType == EFType::kCompositionFcn)
3634 TF1_EvalWrapper func(
this, params,
kTRUE, n);
3643 Error(
"Moment",
"Integral zero over range");
3668 TF1_EvalWrapper func(
this, params,
kTRUE, n);
3677 Error(
"Moment",
"Integral zero over range");
3775 for (
unsigned int i = 0; i < fParNames.size(); ++i) {
3776 if (fParNames[i] == std::string(name))
return i;
3788 unsigned int npar = fParameters.size();
3789 if (npar > 0) fParameters[0] = p0;
3790 if (npar > 1) fParameters[1] =
p1;
3791 if (npar > 2) fParameters[2] =
p2;
3792 if (npar > 3) fParameters[3] =
p3;
3793 if (npar > 4) fParameters[4] = p4;
3794 if (npar > 5) fParameters[5] = p5;
3795 if (npar > 6) fParameters[6] = p6;
3796 if (npar > 7) fParameters[7] = p7;
3797 if (npar > 8) fParameters[8] = p8;
3798 if (npar > 9) fParameters[9] = p9;
3799 if (npar > 10) fParameters[10] = p10;
3806 const char *name4,
const char *name5,
const char *name6,
const char *name7,
3807 const char *name8,
const char *name9,
const char *name10)
3809 unsigned int npar = fParNames.size();
3810 if (npar > 0) fParNames[0] = name0;
3811 if (npar > 1) fParNames[1] = name1;
3812 if (npar > 2) fParNames[2] = name2;
3813 if (npar > 3) fParNames[3] = name3;
3814 if (npar > 4) fParNames[4] = name4;
3815 if (npar > 5) fParNames[5] = name5;
3816 if (npar > 6) fParNames[6] = name6;
3817 if (npar > 7) fParNames[7] = name7;
3818 if (npar > 8) fParNames[8] = name8;
3819 if (npar > 9) fParNames[9] = name9;
3820 if (npar > 10) fParNames[10] = name10;
static double DefaultAbsTolerance()
virtual const char * GetName() const
Returns name of object.
virtual void Print(Option_t *option="") const
Print some global quantities for this histogram.
virtual Double_t GetMaximumStored() const
virtual Int_t GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum)
Compute Quantiles for density distribution of this function.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual Double_t GetMaximum(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the maximum value of the function.
double Derivative3(double x)
Returns the third derivative of the function at point x, computed by Richardson's extrapolation metho...
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
virtual void SaveAttributes(std::ostream &out, const char *name, const char *subname)
Save axis attributes as C++ statement(s) on output stream out.
virtual void Paint(Option_t *option="")
Control routine to paint any kind of histograms.
virtual void SetParameters(const Double_t *params)
virtual Double_t GetRandom()
Return a random number following this function shape.
Bool_t fNormalized
Pointer to MethodCall in case of interpreted function.
double IntegralUp(double a)
Returns Integral of function on an upper semi-infinite interval.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Param Functor class for Multidimensional functions.
double Error() const
Return the estimate of the absolute Error of the last Integral calculation.
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
virtual void SetNpx(Int_t npx=100)
Set the number of points used to draw the function.
virtual void ReleaseParameter(Int_t ipar)
Release parameter number ipar If used in a fit, the parameter can vary freely.
virtual void SetMaximum(Double_t maximum=-1111)
bool Solve(int maxIter=100, double absTol=1E-8, double relTol=1E-10)
Returns the X value corresponding to the function value fy for (xmin<x<xmax).
virtual Double_t GetMinimumX(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the X value corresponding to the minimum value of the function on the (xmin, xmax) interval.
static double p3(double t, double a, double b, double c, double d)
virtual void SetParName(Int_t ipar, const char *name)
Set name of parameter number ipar.
virtual void Copy(TObject &f1) const
Copy this F1 to a new F1.
virtual void SetLimits(Double_t xmin, Double_t xmax)
const char * GetParName(Int_t ipar) const
Namespace for new ROOT classes and functions.
int Status() const
return the Error Status of the last Integral calculation
double Error(unsigned int i) const
parameter error by index
virtual void SetParNames(const char *name0="p0", const char *name1="p1", const char *name2="p2", const char *name3="p3", const char *name4="p4", const char *name5="p5", const char *name6="p6", const char *name7="p7", const char *name8="p8", const char *name9="p9", const char *name10="p10")
Set up to 10 parameter names.
Collectable string class.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual TF1 * DrawCopy(Option_t *option="") const
Draw a copy of this function with its current attributes.
virtual void SetParameters(const Double_t *params)=0
static std::atomic< Bool_t > fgAbsValue
virtual Int_t GetNumberFreeParameters() const
Return the number of free parameters.
const std::vector< double > & Errors() const
parameter errors (return st::vector)
void SetLogScan(bool on)
Set a log grid scan (default is equidistant bins) will work only if xlow > 0.
unsigned int NPar() const
total number of parameters (abbreviation)
virtual Double_t GetMinimumStored() const
TString & ReplaceAll(const TString &s1, const TString &s2)
R__EXTERN TStyle * gStyle
const Double_t * GetArray() const
int Status() const
return status of integration
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void DoInitialize(EAddToList addToGlobList)
Common initialization of the TF1.
virtual Double_t IntegralFast(Int_t num, Double_t *x, Double_t *w, Double_t a, Double_t b, Double_t *params=0, Double_t epsilon=1e-12)
Gauss-Legendre integral, see CalcGaussLegendreSamplingPoints.
static TF1 * GetCurrent()
Static function returning the current function being processed.
static void SaveColor(std::ostream &out, Int_t ci)
Save a color with index > 228 as a C++ statement(s) on output stream out.
TObject * fParent
Array gamma.
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
void ToUpper()
Change string to upper case.
Buffer base class used for serializing objects.
virtual void Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax)
Save values of function in array fSave.
virtual Double_t IntegralMultiple(Int_t n, const Double_t *a, const Double_t *b, Int_t maxpts, Double_t epsrel, Double_t epsabs, Double_t &relerr, Int_t &nfnevl, Int_t &ifail)
This function computes, to an attempted specified accuracy, the value of the integral.
virtual void SetMinimum(Double_t minimum=-1111)
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
double Integral(const double *xmin, const double *xmax)
evaluate the integral with the previously given function between xmin[] and xmax[] ...
unsigned int Ndf() const
Number of degree of freedom.
static ROOT::Math::Minimizer * CreateMinimizer(const std::string &minimizerType="", const std::string &algoType="")
static method to create the corrisponding Minimizer given the string Supported Minimizers types are: ...
Class to Wrap a ROOT Function class (like TF1) in a IParamFunction interface of one dimensions to be ...
TAxis * GetXaxis() const
Get x axis of the function.
virtual void SetNumberFitPoints(Int_t npfits)
static Bool_t DefaultAddToGlobalList(Bool_t on=kTRUE)
Static method to add/avoid to add automatically functions to the global list (gROOT->GetListOfFunctio...
static Double_t DerivativeError()
Static function returning the error of the last call to the of Derivative's functions.
void ToLower()
Change string to lower-case.
virtual Double_t GetMaximumX(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the X value corresponding to the maximum value of the function.
R__EXTERN TVirtualMutex * gROOTMutex
void Copy(TAttMarker &attmarker) const
Copy this marker attributes to a new TAttMarker.
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
double Parameter(unsigned int i) const
parameter value by index
virtual Double_t Derivative2(Double_t x, Double_t *params=0, Double_t epsilon=0.001) const
Returns the second derivative of the function at point x, computed by Richardson's extrapolation meth...
double MinFcnValue() const
Return value of the objective function (chi2 or likelihood) used in the fit.
double Integral(double a, double b)
Returns Integral of function between a and b.
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum value along Y for this function In case the function is already drawn, set also the minimum in the helper histogram.
double Derivative2(double x)
Returns the second derivative of the function at point x, computed by Richardson's extrapolation meth...
TObject * At(Int_t idx) const
virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
IntegralOneDim or analytical integral.
User class for performing function integration.
virtual TObject * DrawIntegral(Option_t *option="al")
Draw integral of this function.
TRObject operator()(const T1 &t1) const
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
bit set when zooming on Y axis
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual Double_t Derivative3(Double_t x, Double_t *params=0, Double_t epsilon=0.001) const
Returns the third derivative of the function at point x, computed by Richardson's extrapolation metho...
virtual Width_t GetLineWidth() const
Return the line width.
Double_t Prob(Double_t chi2, Int_t ndf)
Width_t GetFuncWidth() const
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
virtual bool SetLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double lower, double upper)
set a new upper/lower limited variable (override if minimizer supports them ) otherwise as default se...
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
double IntegralLow(double b)
Returns Integral of function on a lower semi-infinite interval.
double beta(double x, double y)
Calculates the beta function.
static void SetCurrent(TF1 *f1)
Static function setting the current function.
if object in a list can be deleted
virtual Double_t Derivative(Double_t x, Double_t *params=0, Double_t epsilon=0.001) const
Returns the first derivative of the function at point x, computed by Richardson's extrapolation metho...
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual void RecursiveRemove(TObject *obj)
Recursively remove this object from a list.
TF1AbsComposition * fComposition_ptr
Pointer to composition (NSUM or CONV)
virtual Double_t GetProb() const
Return the fit probability.
virtual Style_t GetMarkerStyle() const
Return the marker style.
Template class to wrap any C++ callable object which takes one argument i.e.
void SetParamPtrs(void *paramArr, Int_t nparam=-1)
ParamArr is an array containing the function argument values.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a function.
virtual Style_t GetLineStyle() const
Return the line style.
virtual Int_t GetNDF() const
Return the number of degrees of freedom in the fit the fNDF parameter has been previously computed du...
TAxis * GetYaxis() const
Get y axis of the function.
virtual Double_t Moment(Double_t n, Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001)
Return nth moment of function between a and b.
virtual void SetRelTolerance(double eps)
Set the desired relative Error.
Class wrapping convolution of two functions.
void SetParameters(const double *p)
set parameter values need to call also SetParameters in TF1 in ace some other operations (re-normaliz...
TFormula * fFormula
Functor object to wrap any C++ callable object.
static const double x2[5]
Fill Area Attributes class.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
The TNamed class is the base class for all named ROOT classes.
virtual void DrawF1(Double_t xmin, Double_t xmax, Option_t *option="")
Draw function between xmin and xmax.
Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2, Minuit, GSL, etc..) Plug-in's exist in ROOT to be able to instantiate the derived classes like ROOT::Math::GSLMinimizer or ROOT::Math::Minuit2Minimizer via the plug-in manager.
Double_t Log10(Double_t x)
virtual double MinValue() const =0
return minimum function value
static double p2(double t, double a, double b, double c)
int NEval() const
return number of function evaluations in calculating the integral
static double DefaultRelTolerance()
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
TF1()
TF1 default constructor.
virtual bool Minimize()=0
method to perform the minimization
void SetParameters(const Double_t *params)
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
TString & Append(const char *cs)
double Derivative1(double x)
Returns the first derivative of the function at point x, computed by Richardson's extrapolation metho...
virtual Size_t GetMarkerSize() const
Return the marker size.
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
static IntegrationOneDim::Type DefaultIntegratorType()
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual Int_t GetNdim() const
you should not use this method at all Int_t Int_t Double_t bm
virtual const double * X() const =0
return pointer to X values at the minimum
Method or function calling interface.
User class for performing function minimization.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Double_t Infinity()
Returns an infinity as defined by the IEEE standard.
int TermCoeffLength(TString &term)
double Error() const
return the estimate of the absolute Error of the last Integral calculation
std::vector< Double_t > fIntegral
double Integral(const double *xmin, const double *xmax)
evaluate the integral with the previously given function between xmin[] and xmax[] ...
int Status() const
return the status of the last integration - 0 in case of success
virtual Double_t Rndm()
Machine independent random number generator.
virtual Double_t GradientPar(Int_t ipar, const Double_t *x, Double_t eps=0.01)
Compute the gradient (derivative) wrt a parameter ipar.
double IntegralLow(const IGenFunction &f, double b)
evaluate the Integral of a function f over the over the semi-infinite interval (-inf,b)
virtual const char * GetParName(Int_t ipar) const
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
double Integral(Function &f, double a, double b)
evaluate the Integral of a function f over the defined interval (a,b)
double Root() const
Returns root value.
Using a TBrowser one can browse all ROOT objects.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual void SetChisquare(Double_t chi2)
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set limits for parameter ipar.
double IntegralUp(const IGenFunction &f, double a)
evaluate the Integral of a function f over the semi-infinite interval (a,+inf)
TF1::EAddToList GetGlobalListOption(Option_t *opt)
static Bool_t fgRejectPoint
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)=0
set the function to minimize
TH1 * fHistogram
Parent object hooking this function (if one)
unsigned int NFreeParameters() const
get total number of free parameters
virtual Double_t GetMinimum(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the minimum value of the function on the (xmin, xmax) interval.
const char * GetTitle() const
Returns title of object.
virtual Bool_t IsValid() const
Return kTRUE if the function is valid.
Class to manage histogram axis.
static const std::string & DefaultMinimizerType()
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
void SetLogScan(bool on)
Set a log grid scan (default is equidistant bins) will work only if xlow > 0.
double IntegralError(TF1 *func, Int_t ndim, const double *a, const double *b, const double *params, const double *covmat, double epsilon)
virtual void SetParError(Int_t ipar, Double_t error)
Set error for parameter number ipar.
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Redefines TObject::GetObjectInfo.
void SetFunction(const ROOT::Math::IGenFunction &f, double xlow, double xup)
Sets function to be minimized.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
std::unique_ptr< TF1AbsComposition > fComposition
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
User class for performing function integration.
virtual void FixParameter(Int_t ipar, Double_t value)
Fix the value of a parameter The specified value will be used in a fit operation. ...
int Status() const
return the Error Status of the last Integral calculation
User Class for performing numerical integration of a function in one dimension.
static void RejectPoint(Bool_t reject=kTRUE)
Static function to set the global flag to reject points the fgRejectPoint global flag is tested by al...
void GetParameters(TFitEditor::FuncParams_t &pars, TF1 *func)
Stores the parameters of the given function into pars.
Class adding two functions: c1*f1+c2*f2.
static void InitStandardFunctions()
Create the basic function objects.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
static double p1(double t, double a, double b)
virtual void Update()
Called by functions such as SetRange, SetNpx, SetParameters to force the deletion of the associated h...
virtual ~TF1()
TF1 default destructor.
virtual Double_t GetXmin() const
R__EXTERN TRandom * gRandom
virtual TH1 * DoCreateHistogram(Double_t xmin, Double_t xmax, Bool_t recreate=kFALSE)
Create histogram with bin content equal to function value computed at the bin center This histogram w...
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
static IntegrationMultiDim::Type DefaultIntegratorType()
constexpr Double_t E()
Base of natural log: .
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
void DefineNSUMTerm(TObjArray *newFuncs, TObjArray *coeffNames, TString &fullFormula, TString &formula, int termStart, int termEnd, Double_t xmin, Double_t xmax)
Helper functions for NSUM parsing.
void InitWithPrototype(TClass *cl, const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Initialize the method invocation environment.
static void CalcGaussLegendreSamplingPoints(Int_t num, Double_t *x, Double_t *w, Double_t eps=3.0e-11)
Type safe interface (static method) The number of sampling points are taken from the TGraph...
Class for finding the root of a one dimensional function using the Brent algorithm.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum value along Y for this function In case the function is already drawn, set also the maximum in the helper histogram.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
bool GetVectorizedOption(Option_t *opt)
virtual void SetTitle(const char *title="")
Set function title if title has the form "fffffff;xxxx;yyyy", it is assumed that the function title i...
static unsigned int total
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
static const std::string & DefaultMinimizerAlgo()
Double_t GetChisquare() const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
void SetMaxFunctionCalls(unsigned int maxfcn)
set maximum of function calls
class containg the result of the fit and all the related information (fitted parameter values...
double Error() const
return integration error
static const double x1[5]
void SetFunction(const IGenFunction &)
Set integration function (flag control if function must be copied inside).
std::vector< Double_t > fSave
void SetTolerance(double tol)
set the tolerance
static double DefaultAbsTolerance()
std::vector< Double_t > fParErrors
void SetParName(Int_t iparam, const char *name)
TF1FunctorPointer * fFunctor
Int_t GetParNumber(const char *name) const
Returns the parameter number given a name not very efficient but list of parameters is typically smal...
Double_t AnalyticalIntegral(TF1 *f, Double_t a, Double_t b)
std::vector< Double_t > fGamma
Array beta. is approximated by x = alpha +beta*r *gamma*r**2.
virtual Double_t GetX(Double_t y, Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the X value corresponding to the function value fy for (xmin<x<xmax).
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Double_t GetXmax() const
virtual double FValMinimum() const
Return function value at current estimate of the minimum.
void Streamer(TBuffer &b, Int_t version, UInt_t start, UInt_t count, const TClass *onfile_class=0)
Stream a class object.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
static std::string GetName(IntegrationOneDim::Type)
static function to get a string from the enumeration
#define R__LOCKGUARD(mutex)
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
std::vector< Double_t > fAlpha
Integral of function binned on fNpx bins.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Template class to wrap any C++ callable object implementing operator() (const double * x) in a multi-...
Array of doubles (64 bits per element).
Namespace for new Math classes and functions.
virtual void InitArgs(const Double_t *x, const Double_t *params)
Initialize parameters addresses.
std::vector< Double_t > fBeta
Array alpha. for each bin in x the deconvolution r of fIntegral.
void SetParNames(const char *name0="p0", const char *name1="p1", const char *name2="p2", const char *name3="p3", const char *name4="p4", const char *name5="p5", const char *name6="p6", const char *name7="p7", const char *name8="p8", const char *name9="p9", const char *name10="p10")
Set parameter names.
virtual Double_t GetSave(const Double_t *x)
Get value corresponding to X in array of fSave values.
bool IsEmpty() const
True if a fit result does not exist (even invalid) with parameter values.
virtual double XMinimum() const
Return current estimate of the position of the minimum.
Mother of all ROOT objects.
you should not use this method at all Int_t Int_t z
TMethodCall * fMethodCall
Pointer to histogram used for visualisation.
virtual Int_t GetNpar() const
virtual Double_t IntegralOneDim(Double_t a, Double_t b, Double_t epsrel, Double_t epsabs, Double_t &err)
Return Integral of function between a and b using the given parameter values and relative and absolut...
virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const
Return limits for parameter ipar.
virtual bool SetVariable(unsigned int ivar, const std::string &name, double val, double step)=0
set a new free variable
virtual void Copy(TObject &named) const
Copy this to obj.
User class for performing multidimensional integration.
static Bool_t RejectedPoint()
See TF1::RejectPoint above.
Style_t GetFuncStyle() const
virtual Double_t GetMinMaxNDim(Double_t *x, Bool_t findmax, Double_t epsilon=0, Int_t maxiter=0) const
Find the minimum of a function of whatever dimension.
virtual void SetParErrors(const Double_t *errors)
Set errors for all active parameters when calling this function, the array errors must have at least ...
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
virtual Double_t GetParameter(Int_t ipar) const
virtual void GetRange(Double_t *xmin, Double_t *xmax) const
Return range of a generic N-D function.
void SetNpx(int npx)
Set the number of point used to bracket root using a grid.
virtual Bool_t AddToGlobalList(Bool_t on=kTRUE)
Add to global list of functions (gROOT->GetListOfFunctions() ) return previous status (true if the fu...
Short_t Max(Short_t a, Short_t b)
virtual void SetSavedPoint(Int_t point, Double_t value)
Restore value of function saved at point.
A Graph is a graphics object made of two arrays X and Y with npoints each.
virtual void SetFitResult(const ROOT::Fit::FitResult &result, const Int_t *indpar=0)
Set the result from the fit parameter values, errors, chi2, etc...
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
const Double_t * GetParameters() const
static std::atomic< Bool_t > fgAddToGlobList
virtual void Print(Option_t *option="") const
Print TNamed name and title.
Color_t GetFuncColor() const
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
static void AbsValue(Bool_t reject=kTRUE)
Static function: set the fgAbsValue flag.
virtual void SetNDF(Int_t ndf)
Set the number of degrees of freedom ndf should be the number of points used in a fit - the number of...
virtual Double_t * GetParameters() const
virtual Double_t IntegralError(Double_t a, Double_t b, const Double_t *params=0, const Double_t *covmat=0, Double_t epsilon=1.E-2)
Return Error on Integral of a parametric function between a and b due to the parameter uncertainties...
virtual TH1 * GetHistogram() const
Return a pointer to the histogram used to visualise the function.
TF1 & operator=(const TF1 &rhs)
Operator =.
virtual void SetParameter(Int_t param, Double_t value)
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
virtual bool Minimize(int maxIter, double absTol=1.E-8, double relTol=1.E-10)
Find minimum position iterating until convergence specified by the absolute and relative tolerance or...
bool SetFunction(const ROOT::Math::IGenFunction &f, double xlow, double xup)
Sets the function for the rest of the algorithms.
void SetNpx(int npx)
Set the number of point used to bracket root using a grid.
virtual Color_t GetMarkerColor() const
Return the marker color.
ParamFunctorTempl< double > ParamFunctor
Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Functor1D class for one-dimensional functions.
virtual Style_t GetFillStyle() const
Return the fill area style.
Double_t Sqrt(Double_t x)
std::vector< Double_t > fParMax
virtual Double_t CentralMoment(Double_t n, Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001)
Return nth central moment of function between a and b (i.e the n-th moment around the mean value) ...
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Evaluate function with given coordinates and parameters.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
static double DefaultRelTolerance()
virtual void Browse(TBrowser *b)
Browse.
double RelError() const
return relative error
virtual Int_t GetNumber() const
double Error() const
Returns the estimate of the absolute Error of the last derivative calculation.
std::vector< Double_t > fParMin
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
static Double_t gErrorTF1
double Chi2() const
Chi2 fit value in case of likelihood must be computed ?
User class for calculating the derivatives of a function.
Class for adaptive quadrature integration in multi-dimensions using rectangular regions.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
virtual Int_t GetParNumber(const char *name) const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual const char * GetTitle() const
Returns title of object.
void GetWeightVectors(double *x, double *w) const
Returns the arrays x and w containing the abscissa and weight of the Gauss-Legendre n-point quadratur...
TAxis * GetZaxis() const
Get z axis of the function. (In case this object is a TF2 or TF3)
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
static unsigned int DefaultNCalls()
virtual void Paint(Option_t *option="")
Paint this function with its current attributes.
const char * Data() const
virtual TObject * DrawDerivative(Option_t *option="al")
Draw derivative of this function.