23 "Fitting 3 TGraphErrors with linear functions");
50 TF1 *
f2 =
new TF1(
"f2",
"sin(x) ++ sin(2*x)", -2, 2);
64 gre4->
Fit(
"1 ++ exp(-x)");
72 leg->
AddEntry(gre3,
" -7 + 2*x*x + x*x*x",
"p");
73 leg->
AddEntry(gre2,
"sin(x) + sin(2*x)",
"p");
74 leg->
AddEntry(gre4,
"-2 + exp(-x)",
"p");
96 y[i] = -7 + 2*x[i]*x[i] + x[i]*x[i]*x[i]+ r.
Gaus()*0.1;
101 for (i=0; i<
n; i++) {
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)
This class displays a legend box (TPaveText) containing several legend entries.
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)
Change (i.e.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
void makePoints(Int_t n, Double_t *x, Double_t *y, Double_t *e, Int_t p)
This is the base class for the ROOT Random number generators.
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetLineColor(Color_t lcolor)
virtual void SetFillColor(Color_t fcolor)
TF1 * GetFunction(const char *name) const
Return pointer to function with name.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
A TGraphErrors is a TGraph with error bars.