20void ConfidenceIntervals()
23 "Confidence intervals on the fitted function",1000, 500);
30 gr->SetName(
"GraphNoError");
33 for (i=0; i<ngr; i++){
36 gr->SetPoint(i,
x,
y);
39 TF1 *fpol =
new TF1(
"fpol",
"pol1", -1, 1);
45 grint->
SetTitle(
"Fitted line with .95 conf. band");
56 gr->SetMarkerStyle(5);
57 gr->SetMarkerSize(0.7);
65 "Fitted Gaussian with .95 conf.band", 100, -3, 3);
66 h->FillRandom(
"gaus", nh);
67 TF1 *
f =
new TF1(
"fgaus",
"gaus", -3, 3);
74 "Fitted Gaussian with .95 conf.band", 100, -3, 3);
80 hint->
Draw(
"e3 same");
89 "1000*(([0]*sin(x)/x)*([1]*sin(y)/y))+250",-6,6,-6,6);
91 for (i=0; i<ngr2; i++){
100 for (i=0; i<ngr2; i++)
122 grint2->
Draw(
"E0 same");
123 grint2->
SetTitle(
"Fitted 2d function with .95 error bars");
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
virtual void SetNpx(Int_t npx=100)
virtual void SetParameters(const Double_t *params)
virtual void GetRandom2(Double_t &xrandom, Double_t &yrandom, TRandom *rng=nullptr)
void Draw(Option_t *option="") override
Default Draw method for all objects.
virtual void SetNpy(Int_t npy=100)
void SetPoint(Int_t i, Double_t x, Double_t y, Double_t z) override
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
void SetName(const char *name) override
Set the name of the TNamed.
void SetNpy(Int_t npx=40)
void SetTitle(const char *title="") override
Set the title of the TNamed.
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="")
void Draw(Option_t *option="P0") override
Default Draw method for all objects.
void SetNpx(Int_t npx=40)
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
void Draw(Option_t *chopt="") override
Default Draw method for all objects.
void SetTitle(const char *title="") override
Set the title of the TNamed.
1-D histogram with a double per channel (see TH1 documentation)
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
static TVirtualFitter * GetFitter()
static: return the current Fitter
bool GetConfidenceIntervals(const TH1 *h1, const ROOT::Fit::FitResult &r, TGraphErrors *gr, double cl=0.95)
compute confidence intervals at level cl for a fitted histogram h1 in a TGraphErrors gr