34 double f(
double *
x,
double * p) {
40 void ErrorIntegral() {
41 fitFunc =
new TF1(
"f",
f,0,1,NPAR);
44 double par[NPAR] = { 3.14, 1.};
54 double integral = fitFunc->
Integral(0,1);
63 std::cout <<
"Integral = " << integral <<
" +/- " << sigma_integral
69 double ic = p[1]* (1-
std::cos(p[0]) )/p[0];
71 double c1c = (1-
std::cos(p[0]) )/p[0];
74 double sic =
std::sqrt( c0c*c0c * covMatrix[0] + c1c*c1c * covMatrix[3]
75 + 2.* c0c*c1c * covMatrix[1]);
77 if (
std::fabs(sigma_integral-sic) > 1.
E-6*sic )
78 std::cout <<
" ERROR: test failed : different analytical integral : " 79 << ic <<
" +/- " << sic << std::endl;
virtual void SetParameters(const Double_t *params)
virtual Double_t * GetCovarianceMatrix() const =0
virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
IntegralOneDim or analytical integral.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
static TVirtualFitter * GetFitter()
static: return the current Fitter
1-D histogram with a double per channel (see TH1 documentation)}
constexpr Double_t E()
Base of natural log: .
Abstract Base Class for Fitting.
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
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 void SetParameter(Int_t param, Double_t value)
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.