21 void ConfidenceIntervals()
24 "Confidence intervals on the fitted function",1200, 500);
34 for (i=0; i<ngr; i++){
40 TF1 *fpol =
new TF1(
"fpol",
"pol1", -1, 1);
46 grint->
SetTitle(
"Fitted line with .95 conf. band");
66 "Fitted gaussian with .95 conf.band", 100, -3, 3);
68 TF1 *
f =
new TF1(
"fgaus",
"gaus", -3, 3);
75 "Fitted gaussian with .95 conf.band", 100, -3, 3);
81 hint->
Draw(
"e3 same");
90 "1000*(([0]*sin(x)/x)*([1]*sin(y)/y))+250",-6,6,-6,6);
92 for (i=0; i<ngr2; i++){
96 z = f2->
Eval(x,y)*(1+rnd);
101 for (i=0; i<ngr2; i++)
123 grint2->
Draw(
"E0 same");
124 grint2->
SetTitle(
"Fitted 2d function with .95 error bars");
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
Fit this graph with function with name fname.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetParameters(const Double_t *params)
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
virtual void SetNpx(Int_t npx=100)
Set the number of points used to draw the function.
virtual void Draw(Option_t *option="")
Specific drawing options can be used to paint a TGraph2D:
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual void SetName(const char *name)
Set the name of the TNamed.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual void SetTitle(const char *title="")
Set graph title.
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="")
Fits this graph with function with name fname Predefined functions such as gaus, expo and poln are au...
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
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 ...
virtual void SetTitle(const char *title="")
Sets graph title.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Double_t Rndm()
Machine independent random number generator.
virtual void SetName(const char *name)
Changes the name of this 2D graph.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
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.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetNpy(Int_t npy=100)
Set the number of points used to draw the function.
static TVirtualFitter * GetFitter()
static: return the current Fitter
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
A 2-Dim function with parameters.
R__EXTERN TRandom * gRandom
tomato 1-D histogram with a double per channel (see TH1 documentation)}
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
virtual void SetPoint(Int_t i, Double_t x, Double_t y, Double_t z)
Set x, y and z values for point number i.
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Sets point number n.
virtual void GetRandom2(Double_t &xrandom, Double_t &yrandom)
Return 2 random numbers following this function shape.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
you should not use this method at all Int_t Int_t z
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
double f2(const double *x)
void SetNpy(Int_t npx=40)
Sets the number of bins along Y used to draw the function.
A Graph is a graphics object made of two arrays X and Y with npoints each.
A TGraphErrors is a TGraph with error bars.
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
void SetNpx(Int_t npx=40)
Sets the number of bins along X used to draw the function.
Graphics object made of three arrays X, Y and Z with the same number of points each.
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.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Graph 2D class with errors.