70struct TF1v5Convert :
public TF1 {
77 if (from.
fType == 0) {
96 fParams = std::make_unique<TF1Parameters>(fNpar);
105 fType = (EFType)from.
fType;
117 fParMin = std::vector<Double_t>(from.
fParMin, from.
fParMin + fNpar);
119 fParMax = std::vector<Double_t>(from.
fParMax, from.
fParMax + fNpar);
125 for (
int ibit = 0; ibit < 24; ++ibit)
130 from.TAttLine::Copy(*
this);
131 from.TAttFill::Copy(*
this);
132 from.TAttMarker::Copy(*
this);
140 auto **target = (TF1v5Convert **)to;
142 for (
int i = 0; i < nobjects; ++i) {
143 if (fromv5[i] && target[i])
144 target[i]->Convert(*fromv5[i]);
199 if (par)
fFunc->SetParameters(par);
206 f->fFunc->InitArgs(
f->fX,
f->fPar);
215 if (
fAbsVal && fval < 0)
return -fval;
491 fXmin(0), fXmax(0), fNpar(0), fNdim(0), fType(EFType::kFormula)
511 TNamed(
name, formula), fType(EFType::kFormula)
521 const auto formulaLength = formula ? strlen(formula) : 0;
523 if (formulaLength > 5 && strncmp(formula,
"CONV(", 5) == 0 && formula[formulaLength - 1] ==
')') {
525 int delimPosition = -1;
527 for (
unsigned int i = 5; i < formulaLength - 1; i++) {
528 if (formula[i] ==
'(')
530 else if (formula[i] ==
')')
532 else if (formula[i] ==
',' && parenCount == 0) {
533 if (delimPosition == -1)
536 Error(
"TF1",
"CONV takes 2 arguments. Too many arguments found in : %s", formula);
539 if (delimPosition == -1)
540 Error(
"TF1",
"CONV takes 2 arguments. Only one argument found in : %s", formula);
543 TString formula1 = TString(TString(formula)(5, delimPosition - 5));
544 TString formula2 = TString(TString(formula)(delimPosition + 1, formulaLength - 1 - (delimPosition + 1)));
549 TF1 *function1 = (TF1 *)(
gROOT->GetListOfFunctions()->FindObject(formula1));
552 TF1 *function2 = (TF1 *)(
gROOT->GetListOfFunctions()->FindObject(formula2));
558 TF1Convolution *conv =
new TF1Convolution(function1, function2,
xmin,
xmax);
564 fType = EFType::kCompositionFcn;
565 fComposition = std::unique_ptr<TF1AbsComposition>(conv);
567 fParams = std::make_unique<TF1Parameters>(fNpar);
569 for (
int i = 0; i < fNpar; i++)
572 int f1Npar = function1->
GetNpar();
573 int f2Npar = function2->
GetNpar();
575 for (
int i = 0; i < f1Npar; i++)
579 if (conv->
GetNpar() == f1Npar + f2Npar - 1) {
584 for (
int i = 0; i < f2Npar; i++)
586 this->SetParameter(f1Npar + i, function2->
GetParameter(i));
588 this->SetParameter(f1Npar + i - 1, function2->
GetParameter(i));
591 for (
int i = 0; i < f2Npar; i++)
592 this->SetParameter(i + f1Npar, function2->
GetParameter(i));
596 }
else if (formulaLength > 5 && strncmp(formula,
"NSUM(", 5) == 0 && formula[formulaLength - 1] ==
')') {
598 char delimiter =
',';
600 TString formDense = TString(formula)(5,formulaLength-5-1);
604 InitStandardFunctions();
611 TObjArray coeffNames;
614 for (
int i = 0; i < formDense.
Length(); ++i) {
615 if (formDense[i] ==
'(')
617 else if (formDense[i] ==
')')
619 else if (formDense[i] == delimiter && parenCount == 0) {
621 DefineNSUMTerm(&newFuncs, &coeffNames, fullFormula, formDense, termStart, i,
xmin,
xmax);
625 DefineNSUMTerm(&newFuncs, &coeffNames, fullFormula, formDense, termStart, formDense.
Length(),
xmin,
xmax);
627 TF1NormSum *normSum =
new TF1NormSum(fullFormula,
xmin,
xmax);
629 if (
xmin == 0 &&
xmax == 1.)
Info(
"TF1",
"Created TF1NormSum object using the default [0,1] range");
634 fType = EFType::kCompositionFcn;
635 fComposition = std::unique_ptr<TF1AbsComposition>(normSum);
637 fParams = std::make_unique<TF1Parameters>(fNpar);
641 for (
int i = 0; i < fNpar; i++) {
642 if (coeffNames.
At(i)) {
643 this->SetParName(i, coeffNames.
At(i)->
GetName());
650 fFormula = std::make_unique<TFormula>(
name, formula,
false, vectorize);
651 fNpar = fFormula->GetNpar();
653 fNdim = fFormula->GetNdim() == 0 ? 1 : fFormula->GetNdim();
656 fParErrors.resize(fNpar);
657 fParMin.resize(fNpar);
658 fParMax.resize(fNpar);
663 Error(
"TF1",
"function: %s/%s has dimension %d instead of 1",
name, formula, fNdim);
667 DoInitialize(addToGlobList);
680bool GetVectorizedOption(
Option_t * opt)
682 if (!opt)
return false;
685 if (option.Contains(
"VEC"))
return true;
698 TF1(
name, formula,
xmin,
xmax, GetGlobalListOption(opt), GetVectorizedOption(opt) )
718 if (fName.Data()[0] ==
'*') {
719 Info(
"TF1",
"TF1 has a name starting with a \'*\' - it is for saved TF1 objects in a .C file");
721 }
else if (fName.IsNull()) {
722 Error(
"TF1",
"requires a proper function name!");
726 fMethodCall = std::make_unique<TMethodCall>();
727 fMethodCall->InitWithPrototype(fName,
"Double_t*,Double_t*");
729 if (! fMethodCall->IsValid()) {
730 Error(
"TF1",
"No function found with the signature %s(Double_t*,Double_t*)", name);
808 if (doAdd &&
gROOT) {
814 gROOT->GetListOfFunctions()->Remove(f1old);
819 gROOT->GetListOfFunctions()->Add(
this);
850 if (!
gROOT)
return false;
856 assert(
gROOT->GetListOfFunctions()->FindObject(
this) !=
nullptr);
863 gROOT->GetListOfFunctions()->Add(
this);
865 }
else if (prevStatus) {
871 Warning(
"AddToGlobalList",
"Function is supposed to be in the global list but it is not present");
874 gROOT->GetListOfFunctions()->Remove(
this);
887 TString originalTerm = formula(termStart, termEnd-termStart);
889 if (coeffLength != -1)
890 termStart += coeffLength + 1;
895 TString originalFunc = formula(termStart, termEnd-termStart);
896 TString cleanedFunc = TString(formula(termStart, termEnd-termStart))
897 .ReplaceAll(
'+',
"<plus>")
898 .ReplaceAll(
'*',
"<times>");
901 if (!
gROOT->GetListOfFunctions()->FindObject(cleanedFunc))
905 if (fullFormula.
Length() != 0)
909 if (coeffLength != -1 && originalTerm[0] !=
'[')
910 fullFormula.
Append(originalTerm(0, coeffLength+1));
913 if (coeffLength != -1 && originalTerm[0] ==
'[')
914 coeffNames->
Add(
new TObjString(TString(originalTerm(1,coeffLength-2))));
916 coeffNames->
Add(
nullptr);
918 fullFormula.
Append(cleanedFunc);
926 int firstAsterisk = term.
First(
'*');
927 if (firstAsterisk == -1)
930 if (TString(term(0,firstAsterisk)).IsFloat())
931 return firstAsterisk;
933 if (term[0] ==
'[' && term[firstAsterisk-1] ==
']'
934 && TString(term(1,firstAsterisk-2)).IsAlnum())
935 return firstAsterisk;
946 rhs.TF1::Copy(*
this);
961 if (
gROOT)
gROOT->GetListOfFunctions()->Remove(
this);
973 fXmin(0), fXmax(0), fNpar(0), fNdim(0), fType(EFType::kFormula)
996 Draw(
b ?
b->GetDrawOption() :
"");
1052 TF1Parameters *paramsToCopy = (
fParams) ?
new TF1Parameters(*
fParams) :
nullptr;
1058 TF1AbsComposition *comp =
nullptr;
1060 comp = (TF1AbsComposition *)
fComposition->IsA()->New();
1123 Warning(
"Derivative",
"Function dimension is larger than one");
1126 ROOT::Math::RichardsonDerivator rd;
1131 if (
h <= 0)
h = 0.001;
1134 ROOT::Math::WrappedTF1 wtf(*(
const_cast<TF1 *
>(
this)));
1135 wtf.SetParameters(params);
1140 ROOT::Math::WrappedFunction<const TF1 & > wf(*
this);
1188 Warning(
"Derivative2",
"Function dimension is larger than one");
1191 ROOT::Math::RichardsonDerivator rd;
1196 if (
h <= 0)
h = 0.001;
1199 ROOT::Math::WrappedTF1 wtf(*(
const_cast<TF1 *
>(
this)));
1200 wtf.SetParameters(params);
1205 ROOT::Math::WrappedFunction<const TF1 & > wf(*
this);
1253 Warning(
"Derivative3",
"Function dimension is larger than one");
1256 ROOT::Math::RichardsonDerivator rd;
1261 if (
h <= 0)
h = 0.001;
1264 ROOT::Math::WrappedTF1 wtf(*(
const_cast<TF1 *
>(
this)));
1265 wtf.SetParameters(params);
1270 ROOT::Math::WrappedFunction<const TF1 & > wf(*
this);
1303 Int_t distance = 9999;
1305 distance =
fHistogram->DistancetoPrimitive(px, py);
1306 if (distance <= 1)
return distance;
1313 xx[0] =
gPad->PadtoX(
x);
1314 if (xx[0] <
fXmin || xx[0] >
fXmax)
return distance;
1342 TString opt = option;
1348 gPad->IncrementPaletteColor(1, opt);
1394 TVirtualPad::TContext ctxt(
gROOT->GetSelectedPad(),
true,
true);
1396 TGraph *
gr =
new TGraph(
this,
"d");
1416 TVirtualPad::TContext ctxt(
gROOT->GetSelectedPad(),
true,
true);
1418 TGraph *
gr =
new TGraph(
this,
"i");
1453 return ((
TF1 *)
this)->EvalPar(xx, pp);
1456#ifdef R__HAS_STD_EXPERIMENTAL_SIMD
1463 std::vector<ROOT::Double_v>
d(
fNdim);
1466 for (
auto i = 0; i <
fNdim; i++) {
1467 d[i] = ROOT::Double_v(data[i]);
1534#ifdef R__HAS_STD_EXPERIMENTAL_SIMD
1553 Error(
"EvalPar",
"Composition function not found");
1555 result = (*fComposition)(
x, params);
1576 return std::sqrt(variance);
1578 return std::sqrt(covMatrix->
Similarity(grad));
1592 if (!
gPad->GetView()) {
1609 if (ipar < 0 || ipar >
GetNpar() - 1)
return;
1621 ::Warning(
"TF1::GetCurrent",
"This function is obsolete and is working only for the current painted functions");
1640 const_cast<TF1 *
>(
this)->
fHistogram =
const_cast<TF1 *
>(
this)->CreateHistogram();
1671 if (!logx &&
gPad !=
nullptr) logx =
gPad->GetLogx();
1673 ROOT::Math::BrentMinimizer1D bm;
1674 GInverseFunc
g(
this);
1675 ROOT::Math::WrappedFunction<GInverseFunc> wf1(
g);
1679 bm.
Minimize(maxiter, epsilon, epsilon);
1712 if (!logx &&
gPad !=
nullptr) logx =
gPad->GetLogx();
1714 ROOT::Math::BrentMinimizer1D bm;
1715 GInverseFunc
g(
this);
1716 ROOT::Math::WrappedFunction<GInverseFunc> wf1(
g);
1720 bm.
Minimize(maxiter, epsilon, epsilon);
1753 if (!logx &&
gPad !=
nullptr) logx =
gPad->GetLogx();
1755 ROOT::Math::BrentMinimizer1D bm;
1756 ROOT::Math::WrappedFunction<const TF1 &> wf1(*
this);
1760 bm.
Minimize(maxiter, epsilon, epsilon);
1779 Error(
"GetMinimumNDim",
"Function of dimension 0 - return Eval(x)");
1780 return (
const_cast<TF1 &
>(*
this))(
x);
1788 if (min ==
nullptr) {
1789 Error(
"GetMinimumNDim",
"Error creating minimizer %s", minimName);
1798 ROOT::Math::WrappedMultiFunction<TF1 &> objFunc(
const_cast<TF1 &
>(*
this), ndim);
1800 GInverseFuncNdim invFunc(
const_cast<TF1 *
>(
this));
1801 ROOT::Math::WrappedMultiFunction<GInverseFuncNdim &> objFuncInv(invFunc, ndim);
1807 std::vector<double> rmin(ndim);
1808 std::vector<double> rmax(ndim);
1810 for (
int i = 0; i < ndim; ++i) {
1811 const char *xname =
nullptr;
1812 double stepSize = 0.1;
1814 if (rmax[i] > rmin[i])
1815 stepSize = (rmax[i] - rmin[i]) / 100;
1816 else if (std::abs(
x[i]) > 1.)
1817 stepSize = 0.1 *
x[i];
1823 }
else if (i == 1) {
1833 if (rmin[i] < rmax[i]) {
1843 Error(
"GetMinimumNDim",
"Error minimizing function %s",
GetName());
1845 if (min->
X()) std::copy(min->
X(), min->
X() + ndim,
x);
1849 return (findmax) ? -fmin : fmin;
1880 ROOT::Math::BrentMinimizer1D bm;
1881 ROOT::Math::WrappedFunction<const TF1 &> wf1(*
this);
1885 bm.
Minimize(maxiter, epsilon, epsilon);
1920 if (!logx &&
gPad !=
nullptr) logx =
gPad->GetLogx();
1923 ROOT::Math::WrappedFunction<GFunc> wf1(
g);
1924 ROOT::Math::BrentRootFinder brf;
1928 bool ret = brf.
Solve(maxiter, epsilon, epsilon);
1955 for (
Int_t i = 0; i < ntot; i++) {
1956 ((
TF1 *)
this)->GetParLimits(i, al, bl);
1957 if (al * bl != 0 && al >= bl) nfree--;
1970 static char info[64];
1982 if (ipar < 0 || ipar >
GetNpar() - 1)
return 0;
1996 if (ipar < 0 || ipar >
n - 1)
return;
2007 if (
fNDF <= 0)
return 0;
2050 const Double_t dx = (xMax - xMin) / npx;
2052 TArrayD integral(npx + 1);
2058 Int_t intNegative = 0;
2060 for (i = 0; i < npx; i++) {
2066 integral[i + 1] = integral[i] + integ;
2069 if (intNegative > 0)
2070 Warning(
"GetQuantiles",
"function:%s has %d negative values: abs assumed",
2072 if (integral[npx] == 0) {
2073 Error(
"GetQuantiles",
"Integral of function is zero");
2078 for (i = 1; i <= npx; i++) integral[i] /=
total;
2082 for (i = 0; i < npx; i++) {
2084 const Double_t r2 = integral[i + 1] - integral[i];
2086 gamma[i] = (2 * r2 - 4 * r1) / (dx * dx);
2094 for (i = 0; i <
n; i++) {
2112 if (fac != 0 && fac <= 1)
2113 xx = (-
beta[bin] +
TMath::Sqrt(beta[bin] * beta[bin] + 2 * gamma[bin] * rr)) / gamma[bin];
2114 else if (beta[bin] != 0.)
2115 xx = rr /
beta[bin];
2116 xp[i] = alpha[bin] + xx;
2119 if (integral[bin + 1] ==
r) xp[i] += dx;
2138 Int_t intNegative = 0;
2144 TString opt(option);
2154 Info(
"GetRandom",
"Use log scale for tabulating the integral in [%f,%f] with %d points",
fXmin,
fXmax,
fNpx);
2158 std::vector<Double_t> xx(
fNpx + 1);
2159 for (i = 0; i <
fNpx; i++) {
2160 xx[i] =
xmin + i * dx;
2163 for (i = 0; i <
fNpx; i++) {
2167 integ =
Integral(xx[i], xx[i + 1], 0.0);
2175 if (intNegative > 0) {
2176 Warning(
"GetRandom",
"function:%s has %d negative values: abs assumed",
GetName(), intNegative);
2179 Error(
"GetRandom",
"Integral of function is zero");
2183 for (i = 1; i <=
fNpx; i++) {
2190 for (i = 0; i <
fNpx; i++) {
2197 r3 = 2 * r2 - 4 * r1;
2258 yy = rr /
fBeta[bin];
2305 if (nbinmax >
fNpx) nbinmax =
fNpx;
2320 xx = rr /
fBeta[bin];
2335 for (
int i = 0; i < ndim; ++i) {
2339 }
else if (i == 1) {
2342 }
else if (i == 2) {
2394 if (
fSave.empty())
return 0;
2396 int nsave =
fSave.size();
2406 TAxis *xaxis =
h->GetXaxis();
2413 ylow =
fSave[bin - bin1];
2414 yup =
fSave[bin - bin1 + 1];
2418 ylow =
fSave[bin - bin1 - 1];
2419 yup =
fSave[bin - bin1];
2422 y = ((xup * ylow - xlow * yup) +
x * (yup - ylow)) / dx;
2426 Int_t np = nsave - 3;
2433 if (dx <= 0)
return 0;
2436 xlow =
xmin + bin * dx;
2439 yup =
fSave[bin + 1];
2440 y = ((xup * ylow - xlow * yup) +
x * (yup - ylow)) / dx;
2451 if (!
h)
return nullptr;
2452 return h->GetXaxis();
2462 if (!
h)
return nullptr;
2463 return h->GetYaxis();
2473 if (!
h)
return nullptr;
2474 return h->GetZaxis();
2520 std::fill(grad, grad +
fNpar, 0.);
2535 if (params) args[1] = (
Longptr_t)params;
2549 if (!
gROOT->GetListOfFunctions()->FindObject(
"gaus")) {
2550 f1 =
new TF1(
"gaus",
"gaus", -1, 1);
2552 f1 =
new TF1(
"gausn",
"gausn", -1, 1);
2554 f1 =
new TF1(
"landau",
"landau", -1, 1);
2556 f1 =
new TF1(
"landaun",
"landaun", -1, 1);
2558 f1 =
new TF1(
"expo",
"expo", -1, 1);
2560 for (
Int_t i = 0; i < 10; i++) {
2562 f1 =
new TF1(f1name.Data(), f1name.Data(), -1, 1);
2567 ROOT::Math::ChebyshevPol *pol =
new ROOT::Math::ChebyshevPol(i);
2592 Warning(
"analytical integral not available for %s - with number %d compute numerical integral",
GetName(),
GetNumber());
2673 TF1_EvalWrapper wf1(
this,
nullptr,
fgAbsValue);
2679 ROOT::Math::GaussIntegrator iod(epsabs, epsrel);
2680 iod.SetFunction(wf1);
2682 result = iod.Integral(
a,
b);
2684 result = iod.IntegralLow(
b);
2686 result = iod.IntegralUp(
a);
2688 result = iod.Integral();
2689 error = iod.Error();
2690 status = iod.Status();
2694 result = iod.Integral(
a,
b);
2696 result = iod.IntegralLow(
b);
2698 result = iod.IntegralUp(
a);
2700 result = iod.Integral();
2701 error = iod.Error();
2702 status = iod.Status();
2706 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);
2707 TString msg(
"\t\tFunction Parameters = {");
2708 for (
int ipar = 0; ipar <
GetNpar(); ++ipar) {
2710 if (ipar <
GetNpar() - 1) msg += TString(
",");
2711 else msg += TString(
"}");
2713 Info(
"IntegralOneDim",
"%s", msg.Data());
2761 x1[0] =
a, x2[0] =
b;
2831 ROOT::Math::WrappedTF1 wf1(*
this);
2833 wf1.SetParameters(params);
2834 ROOT::Math::GaussLegendreIntegrator gli(num, epsilon);
2835 gli.SetFunction(wf1);
2836 return gli.Integral(
a,
b);
2849 Int_t nfnevl, ifail;
2853 Warning(
"IntegralMultiple",
"failed code=%d, ", ifail);
2902 ROOT::Math::WrappedMultiFunction<TF1 &> wf1(*
this,
n);
2908 ROOT::Math::AdaptiveIntegratorMultiDim aimd(wf1, epsabs, epsrel, maxpts);
2910 result = aimd.Integral(
a,
b);
2911 relerr = aimd.RelError();
2912 nfnevl = aimd.NEval();
2913 ifail = aimd.Status();
2917 result = imd.Integral(
a,
b);
2918 relerr = (result != 0) ? imd.Error() / std::abs(result) : imd.
Error();
2920 ifail = imd.Status();
2949 printf(
"Formula based function: %s \n",
GetName());
2952 }
else if (
fType > 0) {
2954 printf(
"Interpreted based function: %s(double *x, double *p). Ndim = %d, Npar = %d \n",
GetName(),
GetNdim(),
2959 printf(
"fComposition not found!\n");
2962 printf(
"Compiled based function: %s based on a functor object. Ndim = %d, Npar = %d\n",
GetName(),
2965 printf(
"Function based on a list of points from a compiled based function: %s. Ndim = %d, Npar = %d, Npx "
2969 Warning(
"Print",
"Function %s is based on a list of points but list is empty",
GetName());
2972 TString opt(option);
2977 printf(
"List of Parameters: \n");
2978 for (
int i = 0; i <
fNpar; ++i)
2981 if (!
fSave.empty()) {
2983 printf(
"List of Saved points (N=%d): \n",
int(
fSave.size()));
2985 printf(
"( %10f ) ",
x);
2991 printf(
"Contained histogram\n");
3006 TString opt0 = option, opt = option, optSAME;
3009 if (opt.Contains(
"sames"))
3011 else if (opt.Contains(
"same"))
3013 if (optSAME.Length())
3014 opt.ReplaceAll(optSAME,
"");
3015 opt.ReplaceAll(
' ',
"");
3019 pmin =
gPad->PadtoX(
gPad->GetUxmin());
3020 pmax =
gPad->PadtoX(
gPad->GetUxmax());
3022 if (optSAME.Length()) {
3024 if (
xmax < pmin)
return;
3025 if (
xmin > pmax)
return;
3031 auto is_pfc = opt0.
Index(
"PFC");
3032 auto is_plc = opt0.
Index(
"PLC");
3033 auto is_pmc = opt0.
Index(
"PMC");
3044 if (minimum <= 0 && gPad && gPad->GetLogy()) minimum = -1111;
3047 if (minimum == -1111) {
3054 if (minimum == -1111) {
3056 if (optSAME.Length() &&
gPad) hmin =
gPad->GetUymin();
3061 if (optSAME.Length() &&
gPad) hmax =
gPad->GetUymax();
3063 hmin -= 0.05 * (hmax - hmin);
3064 if (hmin < 0) hmin = 0;
3065 if (hmin <= 0 && gPad && gPad->GetLogy()) hmin = hminpos;
3072 if (maximum == -1111) {
3083 if (opt.Length() == 0) {
3084 optSAME.Prepend(
"lf");
3102 TH1 *histogram =
nullptr;
3107 TString xtitle =
"";
3108 TString ytitle =
"";
3109 char *semicol = (
char *)strstr(
GetTitle(),
";");
3111 Int_t nxt = strlen(semicol);
3112 char *ctemp =
new char[nxt];
3113 strlcpy(ctemp, semicol + 1, nxt);
3114 semicol = (
char *)strstr(ctemp,
";");
3117 ytitle = semicol + 1;
3127 if (!
gPad->GetLogx() && test_logx) {
3132 if (
gPad->GetLogx() && !test_logx) {
3150 for (i = 0; i <=
fNpx; i++) {
3151 xbins[i] =
gPad->PadtoX(xlogmin + i * dlogx);
3171 for (i = 1; i <=
fNpx; i++) {
3203 if (ipar < 0 || ipar >
GetNpar() - 1)
return;
3224 int nsave = bin2 - bin1 + 4;
3225 fSave.resize(nsave);
3229 for (
Int_t i = bin1; i <= bin2; i++) {
3230 xv[0] =
h->GetXaxis()->GetBinCenter(i);
3253 fSave.resize(npx + 3);
3256 for (
Int_t i = 0; i <= npx; i++) {
3257 xv[0] =
xmin + dx * i;
3271 thread_local Int_t storeNumber = 0;
3273 const char *
l = strstr(option,
"#");
3274 Int_t number = ++storeNumber;
3276 sscanf(
l + 1,
"%d", &number);
3289 if (option && strstr(option,
"cc")) {
3290 out <<
"double " <<
GetName() <<
"(double xv) {\n";
3292 out <<
" double x[" <<
fNpx <<
"] = {\n";
3296 out <<
fXmin + dx * i;
3306 out <<
" double y[" <<
fNpx <<
"] = {\n";
3320 out <<
" if (xv<x[0]) return y[0];\n";
3321 out <<
" if (xv>x[" <<
fNpx - 1 <<
"]) return y[" <<
fNpx - 1 <<
"];\n";
3322 out <<
" int i, j=0;\n";
3323 out <<
" for (i=1; i<" <<
fNpx <<
"; i++) { if (xv < x[i]) break; j++; }\n";
3324 out <<
" return y[j] + (y[j + 1] - y[j]) / (x[j + 1] - x[j]) * (xv - x[j]);\n";
3331 const char *addToGlobList =
fParent ?
", TF1::EAddToList::kNo" :
", TF1::EAddToList::kDefault";
3335 out <<
" TF1 *" << f1Name <<
" = new TF1(\"" <<
GetName() <<
"\", \""
3336 << TString(
GetTitle()).ReplaceSpecialCppChars() <<
"\", " <<
fXmin <<
"," <<
fXmax << addToGlobList <<
");\n";
3338 out <<
" " << f1Name <<
"->SetNpx(" <<
fNpx <<
");\n";
3340 out <<
" TF1 *" << f1Name <<
" = new TF1(\"" <<
"*" <<
GetName() <<
"\", " <<
fXmin <<
"," <<
fXmax
3341 <<
"," <<
GetNpar() <<
");\n";
3342 out <<
" // The original function : " <<
GetTitle() <<
" had originally been created by:\n";
3344 <<
fXmin <<
"," <<
fXmax <<
"," <<
GetNpar() <<
", 1" << addToGlobList <<
");\n";
3345 out <<
" " << f1Name <<
"->SetRange(" <<
fXmin <<
"," <<
fXmax <<
");\n";
3348 out <<
" " << f1Name <<
"->SetNpx(" <<
fNpx <<
");\n";
3355 if (!
fSave.empty()) {
3357 out <<
" for (int n = 0; n < " <<
fSave.size() <<
"; n++)\n";
3358 out <<
" " << f1Name <<
"->SetSavedPoint(n, " << vect <<
"[n]);\n";
3366 out <<
" " << f1Name.
Data() <<
"->SetBit(TF1::kNotDraw);\n";
3373 out <<
" " << f1Name <<
"->SetChisquare(" <<
GetChisquare() <<
");\n";
3374 out <<
" " << f1Name <<
"->SetNDF(" <<
GetNDF() <<
");\n";
3379 out <<
" " << f1Name <<
"->SetParameter(" << i <<
", " <<
GetParameter(i) <<
");\n";
3380 out <<
" " << f1Name <<
"->SetParError(" << i <<
", " <<
GetParError(i) <<
");\n";
3382 out <<
" " << f1Name <<
"->SetParLimits(" << i <<
", " << parmin <<
", " << parmax <<
");\n";
3414 Warning(
"SetFitResult",
"Empty Fit result - nothing is set in TF1");
3417 if (indpar ==
nullptr && npar != (
int) result.
NPar()) {
3418 Error(
"SetFitResult",
"Invalid Fit result passed - number of parameter is %d , different than TF1::GetNpar() = %d", npar, result.
NPar());
3421 if (result.
Chi2() > 0)
3430 for (
Int_t i = 0; i < npar; ++i) {
3431 Int_t ipar = (indpar !=
nullptr) ? indpar[i] : i;
3432 if (ipar < 0)
continue;
3435 if (ipar < (
int) result.
Errors().size())
3490 const Int_t minPx = 4;
3491 Int_t maxPx = 10000000;
3492 if (
GetNdim() > 1) maxPx = 10000;
3493 if (npx >= minPx && npx <= maxPx) {
3496 if (npx < minPx)
fNpx = minPx;
3497 if (npx > maxPx)
fNpx = maxPx;
3498 Warning(
"SetNpx",
"Number of points must be >=%d && <= %d, fNpx set to %d", minPx, maxPx,
fNpx);
3508 if (ipar < 0 || ipar >=
GetNpar())
return;
3518void TF1::SetParNames(
const char *name0,
const char *name1,
const char *name2,
const char *name3,
const char *name4,
3519 const char *name5,
const char *name6,
const char *name7,
const char *name8,
const char *name9,
const char *name10)
3527 fFormula->SetParNames(name0, name1, name2, name3, name4, name5, name6, name7, name8, name9, name10);
3529 fParams->SetParNames(name0, name1, name2, name3, name4, name5, name6, name7, name8, name9, name10);
3536 if (ipar < 0 || ipar >
GetNpar() - 1)
return;
3547 if (!errors)
return;
3565 if (ipar < 0 || ipar > npar - 1)
return;
3566 if (
int(
fParMin.size()) != npar) {
3569 if (
int(
fParMax.size()) != npar) {
3599 if (
fSave.empty()) {
3602 if (point < 0 || point >=
int(
fSave.size()))
return;
3603 fSave[point] = value;
3628 if (
b.IsReading()) {
3640 gROOT->GetListOfFunctions()->Add(
this);
3644 ROOT::v5::TF1Data fold;
3648 ((TF1v5Convert *)
this)->Convert(fold);
3677 TString XAxisTitle =
fHistogram->GetXaxis()->GetTitle();
3678 TString YAxisTitle =
fHistogram->GetYaxis()->GetTitle();
3679 TAttAxis attx, atty;
3680 fHistogram->GetXaxis()->TAttAxis::Copy(attx);
3681 fHistogram->GetYaxis()->TAttAxis::Copy(atty);
3747 TF1_EvalWrapper func(
this, params,
kTRUE,
n);
3749 ROOT::Math::GaussIntegrator giod;
3756 Error(
"Moment",
"Integral zero over range");
3781 TF1_EvalWrapper func(
this, params,
kTRUE,
n);
3783 ROOT::Math::GaussIntegrator giod;
3790 Error(
"Moment",
"Integral zero over range");
3838 TGraph *
g =
new TGraph(num);
3870 ROOT::Math::GaussLegendreIntegrator gli(num, eps);
3871 gli.GetWeightVectors(
x, w);
3888 for (
unsigned int i = 0; i <
fParNames.size(); ++i) {
Double_t AnalyticalIntegral(TF1 *f, Double_t a, Double_t b)
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
short Version_t
Class version identifier (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
bool R__SetClonesArrayTF1Updater(TF1Updater_t func)
int R__RegisterTF1UpdaterTrigger
void(*)(Int_t nobjects, TObject **from, TObject **to) TF1Updater_t
static Double_t gErrorTF1
static void R__v5TF1Updater(Int_t nobjects, TObject **from, TObject **to)
void GetParameters(TFitEditor::FuncParams_t &pars, TF1 *func)
Stores the parameters of the given function into pars.
static unsigned int total
TMatrixTSym< Double_t > TMatrixDSym
if(err< fMinRelativeError)
externTVirtualMutex * gROOTMutex
TVectorT< Double_t > TVectorD
#define R__LOCKGUARD(mutex)
double operator()(double x) const
GFunc(const TF1 *function, double y)
GInverseFuncNdim(TF1 *function)
double operator()(const double *x) const
double operator()(double x) const
GInverseFunc(const TF1 *function)
class containing the result of the fit and all the related information (fitted parameter values,...
bool IsEmpty() const
True if a fit result does not exist (even invalid) with parameter values.
const std::vector< double > & Errors() const
parameter errors (return st::vector)
double Error(unsigned int i) const
parameter error by index
unsigned int Ndf() const
Number of degree of freedom.
double Chi2() const
Return the Chi2 value after fitting In case of unbinned fits (or not defined one, see the documentati...
double MinFcnValue() const
Return value of the objective function (chi2 or likelihood) used in the fit.
unsigned int NPar() const
total number of parameters (abbreviation)
unsigned int NFreeParameters() const
get total number of free parameters
double Parameter(unsigned int i) const
parameter value by index
void SetFunction(const ROOT::Math::IGenFunction &f, double xlow, double xup)
Sets function to be minimized.
bool Minimize(int maxIter, double absTol=1.E-8, double relTol=1.E-10) override
Find minimum position iterating until convergence specified by the absolute and relative tolerance or...
void SetNpx(int npx)
Set the number of point used to bracket root using a grid.
void SetLogScan(bool on)
Set a log grid scan (default is equidistant bins) will work only if xlow > 0.
double XMinimum() const override
Return current estimate of the position of the minimum.
double FValMinimum() const override
Return function value at current estimate of the minimum.
bool SetFunction(const ROOT::Math::IGenFunction &f, double xlow, double xup) override
Sets the function for the rest of the algorithms.
bool Solve(int maxIter=100, double absTol=1E-8, double relTol=1E-10) override
Returns the X value corresponding to the function value fy for (xmin<x<xmax).
double Root() const override
Returns root value.
void SetNpx(int npx)
Set the number of point used to bracket root using a grid.
void SetLogScan(bool on)
Set a log grid scan (default is equidistant bins) will work only if xlow > 0.
static ROOT::Math::Minimizer * CreateMinimizer(const std::string &minimizerType="", const std::string &algoType="")
static method to create the corresponding Minimizer given the string Supported Minimizers types are: ...
void SetRelTolerance(double eps) override
Set the desired relative Error.
double Integral(double a, double b) override
Returns Integral of function between a and b.
void SetFunction(const IGenFunction &) override
Set integration function (flag control if function must be copied inside).
static IntegrationMultiDim::Type DefaultIntegratorType()
static unsigned int DefaultNCalls()
static double DefaultRelTolerance()
static double DefaultAbsTolerance()
static double DefaultAbsTolerance()
static double DefaultRelTolerance()
static IntegrationOneDim::Type DefaultIntegratorType()
static std::string GetName(IntegrationOneDim::Type)
static function to get a string from the enumeration
static const std::string & DefaultMinimizerType()
static const std::string & DefaultMinimizerAlgo()
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 set...
virtual const double * X() const =0
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)=0
Set the function to minimize.
void SetTolerance(double tol)
Set the tolerance.
virtual bool Minimize()=0
Method to perform the minimization.
virtual bool SetVariable(unsigned int ivar, const std::string &name, double val, double step)=0
Set a new free variable.
void SetMaxFunctionCalls(unsigned int maxfcn)
Set maximum of function calls.
virtual double MinValue() const =0
double Derivative2(double x)
Returns the second derivative of the function at point x, computed by Richardson's extrapolation meth...
double Error() const
Returns the estimate of the absolute Error of the last derivative calculation.
double Derivative3(double x)
Returns the third derivative of the function at point x, computed by Richardson's extrapolation metho...
double Derivative1(double x)
Returns the first derivative of the function at point x, computed by Richardson's extrapolation metho...
void Copy(TAttAxis &attaxis) const
Copy of the object.
virtual Color_t GetFillColor() const
Return the fill area color.
void Copy(TAttFill &attfill) const
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
void Copy(TAttLine &attline) const
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
void Copy(TAttMarker &attmarker) const
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Class to manage histogram axis.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
void SaveAttributes(std::ostream &out, const char *name, const char *subname) override
Save axis attributes as C++ statement(s) on output stream out.
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
const char * GetParName(Int_t ipar) const
const char * GetParName(Int_t ipar) const
std::vector< double > GetParameters() const
Return array of parameters.
Int_t GetNpar() const
Return the number of (non constant) parameters including the coefficients: for 2 functions: c1,...
std::vector< std::string > fParNames
Int_t GetParNumber(const char *name) const
ROOT::Math::IGenFunction * Clone() const override
Clone a function.
Double_t EvalFirstMom(Double_t x)
Double_t DoEval(Double_t x) const override
implementation of the evaluation function. Must be implemented by derived classes
Double_t EvalNMom(Double_t x) const
TF1_EvalWrapper(TF1 *f, const Double_t *par, bool useAbsVal, Double_t n=1, Double_t x0=0)
virtual void SetParNames(const char *name0="", const char *name1="", const char *name2="", const char *name3="", const char *name4="", const char *name5="", const char *name6="", const char *name7="", const char *name8="", const char *name9="", const char *name10="")
std::unique_ptr< TF1FunctorPointer > fFunctor
! Functor object to wrap any C++ callable object
virtual Double_t GetXmax() const
static void RejectPoint(Bool_t reject=kTRUE)
EAddToList
Add to list behavior.
T GradientParTempl(Int_t ipar, const T *x, Double_t eps=0.01) const
virtual Double_t Derivative2(Double_t x, Double_t *params=nullptr, Double_t epsilon=0.001) const
virtual Int_t GetNumber() const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
std::vector< Double_t > fParErrors
Array of errors of the fNpar parameters.
Int_t fNdim
Function dimension.
virtual Double_t GetMinMaxNDim(Double_t *x, Bool_t findmax, Double_t epsilon=0, Int_t maxiter=0) const
virtual void SetNDF(Int_t ndf)
virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
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
virtual Double_t GetProb() const
Int_t fNpar
Number of parameters.
virtual Double_t IntegralFast(Int_t num, Double_t *x, Double_t *w, Double_t a, Double_t b, Double_t *params=nullptr, Double_t epsilon=1e-12)
static std::atomic< Bool_t > fgAddToGlobList
static void SetCurrent(TF1 *f1)
virtual void SetParError(Int_t ipar, Double_t error)
virtual void Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax)
virtual void SetChisquare(Double_t chi2)
Double_t fNormIntegral
Integral of the function before being normalized.
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
static Bool_t RejectedPoint()
virtual Double_t Derivative(Double_t x, Double_t *params=nullptr, Double_t epsilon=0.001) const
Double_t GetChisquare() const
Return the Chisquare after fitting. See ROOT::Fit::FitResult::Chi2().
void Print(Option_t *option="") const override
This method must be overridden when a class wants to print itself.
Double_t fXmin
Lower bounds for the range.
std::unique_ptr< TMethodCall > fMethodCall
! Pointer to MethodCall in case of interpreted function
virtual void InitArgs(const Double_t *x, const Double_t *params)
virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const
virtual Int_t GetNpar() const
std::vector< Double_t > fBeta
! Array beta. is approximated by x = alpha +beta*r *gamma*r**2
virtual void SetNpx(Int_t npx=100)
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
Double_t EvalUncertainty(Double_t x, const TMatrixDSym *covMatrix=nullptr) const
TString ProvideSaveName(Option_t *option)
virtual Double_t GetRandom(TRandom *rng=nullptr, Option_t *opt=nullptr)
Int_t fNDF
Number of degrees of freedom in the fit.
TH1 * fHistogram
! Pointer to histogram used for visualisation
std::unique_ptr< TF1AbsComposition > fComposition
Pointer to composition (NSUM or CONV).
Int_t fNpfits
Number of points used in the fit.
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
std::vector< Double_t > fAlpha
! Array alpha. for each bin in x the deconvolution r of fIntegral
void SetTitle(const char *title="") override
Set the title of the TNamed.
std::unique_ptr< TFormula > fFormula
Pointer to TFormula in case when user define formula.
virtual Int_t GetNumberFreeParameters() const
std::vector< Double_t > fParMin
Array of lower limits of the fNpar parameters.
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
Double_t fMaximum
Maximum value for plotting.
virtual Double_t * GetParameters() const
Double_t fMinimum
Minimum value for plotting.
int TermCoeffLength(TString &term)
static Bool_t fgRejectPoint
void Copy(TObject &f1) const override
Copy this to obj.
virtual Int_t GetQuantiles(Int_t n, Double_t *xp, const Double_t *p)
static void AbsValue(Bool_t reject=kTRUE)
void Streamer(TBuffer &) override
Stream an object of class TObject.
virtual Double_t Derivative3(Double_t x, Double_t *params=nullptr, Double_t epsilon=0.001) const
virtual void DrawF1(Double_t xmin, Double_t xmax, Option_t *option="")
virtual Double_t CentralMoment(Double_t n, Double_t a, Double_t b, const Double_t *params=nullptr, Double_t epsilon=0.000001)
virtual void SetNumberFitPoints(Int_t npfits)
double EvalParVec(const Double_t *data, const Double_t *params)
void Paint(Option_t *option="") override
This method must be overridden if a class wants to paint itself.
TF1 & operator=(const TF1 &rhs)
Double_t fChisquare
Function fit chisquare.
virtual Double_t GradientPar(Int_t ipar, const Double_t *x, Double_t eps=0.01) const
virtual void GetRange(Double_t *xmin, Double_t *xmax) const
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
virtual void SetRange(Double_t xmin, Double_t xmax)
Bool_t fNormalized
Normalization option (false by default).
void Draw(Option_t *option="") override
Default Draw method for all objects.
virtual Bool_t IsValid() const
virtual Double_t GetParError(Int_t ipar) const
virtual Double_t IntegralOneDim(Double_t a, Double_t b, Double_t epsrel, Double_t epsabs, Double_t &err)
virtual TObject * DrawIntegral(Option_t *option="al")
void Browse(TBrowser *b) override
Browse object. May be overridden for another default action.
virtual void SetMaximum(Double_t maximum=-1111)
virtual Double_t IntegralError(Double_t a, Double_t b, const Double_t *params=nullptr, const Double_t *covmat=nullptr, Double_t epsilon=1.E-2)
virtual const char * GetParName(Int_t ipar) const
static TF1 * GetCurrent()
TF1(EFType functionType, const char *name, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim, EAddToList addToGlobList, TF1Parameters *params=nullptr, TF1FunctorPointer *functor=nullptr)
General constructor for TF1. Most of the other constructors delegate on it.
Int_t fNpx
Number of points used for the graphical representation.
void DoInitialize(EAddToList addToGlobList)
char * GetObjectInfo(Int_t px, Int_t py) const override
Returns string containing info about the object at position (px,py).
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to an event at (px,py).
static std::atomic< Bool_t > fgAbsValue
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
virtual void ReleaseParameter(Int_t ipar)
std::vector< Double_t > fParMax
Array of upper limits of the fNpar parameters.
virtual Int_t GetNDF() const
static Double_t DerivativeError()
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
std::vector< Double_t > fSave
Array of fNsave function values.
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)
void DefineNSUMTerm(TObjArray *newFuncs, TObjArray *coeffNames, TString &fullFormula, TString &formula, int termStart, int termEnd, Double_t xmin, Double_t xmax)
std::vector< Double_t > fGamma
! Array gamma.
virtual TH1 * GetHistogram() const
static Bool_t DefaultAddToGlobalList(Bool_t on=kTRUE)
TObject * fParent
! Parent object hooking this function (if one)
Bool_t ComputeCdfTable(Option_t *opt)
virtual void SetParameters(const Double_t *params)
static void InitStandardFunctions()
virtual Double_t GetSave(const Double_t *x)
std::vector< Double_t > fIntegral
! Integral of function binned on fNpx bins
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=nullptr)
virtual TF1 * DrawCopy(Option_t *option="") const
virtual void SetMinimum(Double_t minimum=-1111)
virtual Double_t Moment(Double_t n, Double_t a, Double_t b, const Double_t *params=nullptr, Double_t epsilon=0.000001)
virtual void SetFitResult(const ROOT::Fit::FitResult &result, const Int_t *indpar=nullptr)
virtual void FixParameter(Int_t ipar, Double_t value)
std::unique_ptr< TF1Parameters > fParams
Pointer to Function parameters object (exists only for not-formula functions).
virtual void SetParameter(Int_t param, Double_t value)
virtual void SetParName(Int_t ipar, const char *name)
TObject * Clone(const char *newname=nullptr) const override
Make a clone of an object using the Streamer facility.
@ kFormula
Formula functions which can be stored,.
@ kPtrScalarFreeFcn
Pointer to scalar free function,.
@ kTemplScalar
TemplScalar functors evaluating on scalar parameters.
@ kTemplVec
Vectorized free functions or TemplScalar functors evaluating on vectorized parameters,...
@ kInterpreted
Interpreted functions constructed by name,.
virtual void SetParErrors(const Double_t *errors)
virtual TObject * DrawDerivative(Option_t *option="al")
Double_t fXmax
Upper bounds for the range.
TClass * IsA() const override
virtual Int_t GetNdim() const
virtual Double_t GetXmin() const
virtual TH1 * DoCreateHistogram(Double_t xmin, Double_t xmax, Bool_t recreate=kFALSE)
virtual Double_t GetParameter(Int_t ipar) const
virtual Int_t GetParNumber(const char *name) const
static void CalcGaussLegendreSamplingPoints(Int_t num, Double_t *x, Double_t *w, Double_t eps=3.0e-11)
virtual void SetSavedPoint(Int_t point, Double_t value)
virtual Bool_t AddToGlobalList(Bool_t on=kTRUE)
void Draw(Option_t *chopt="") override
Default Draw method for all objects.
TH1 is the base class of all histogram classes in ROOT.
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
@ kLogX
X-axis in log scale.
@ kNoStats
Don't draw stats box.
@ kIsZoomed
Bit set when zooming on Y axis.
virtual void SetMaximum(Double_t maximum=-1111)
virtual void SetMinimum(Double_t minimum=-1111)
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...
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
TMatrixTSym< Element > & Similarity(const TMatrixT< Element > &n)
Calculate B * (*this) * B^T , final matrix will be (nrowsb x nrowsb) This is a similarity transform w...
The TNamed class is the base class for all named ROOT classes.
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
void SavePrimitiveNameTitle(std::ostream &out, const char *variable_name)
Save object name and title into the output stream "out".
void Copy(TObject &named) const override
Copy this to obj.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
TObject * At(Int_t idx) const override
void Add(TObject *obj) override
Mother of all ROOT objects.
Bool_t TestBit(UInt_t f) const
virtual const char * GetName() const
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
static TString SavePrimitiveVector(std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
Save array in the output stream "out" as vector.
@ kCanDelete
if object in a list can be deleted
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
This is the base class for the ROOT Random number generators.
Double_t Rndm() override
Machine independent random number generator.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
void ToLower()
Change string to lower-case.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void ToUpper()
Change string to upper case.
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
@ kGAUSS
simple Gauss integration method with fixed rule
@ kADAPTIVE
adaptive multi-dimensional integration
double beta(double x, double y)
Calculates the beta function.
Namespace for new Math classes and functions.
ParamFunctorTempl< double > ParamFunctor
IBaseFunctionOneDim IGenFunction
double IntegralError(TF1 *func, Int_t ndim, const double *a, const double *b, const double *params, const double *covmat, double epsilon)
__device__ AFloat max(AFloat x, AFloat y)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Prob(Double_t chi2, Int_t ndf)
Double_t QuietNaN()
Returns a quiet NaN as defined by IEEE 754.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec)
Comparing floating points.
Double_t SignalingNaN()
Returns a signaling NaN as defined by IEEE 754](http://en.wikipedia.org/wiki/NaN#Signaling_NaN).
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Double_t Infinity()
Returns an infinity as defined by the IEEE standard.
const double xbins[xbins_n]
void Streamer(TBuffer &b, Int_t version, UInt_t start, UInt_t count, const TClass *onfile_class=nullptr)
specialized streamer function being able to read old TF1 versions as TF1Data in memory