27 double *
x =
new double[
n];
28 double *
y =
new double[
n];
29 double *
e =
new double[
n];
31 "Fitting 3 TGraphErrors with linear functions");
41 TF1 *f3 =
gre3->GetFunction(
"pol3");
57 TF1 *f2 =
new TF1(
"f2",
"sin(x) ++ sin(2*x)", -2, 2);
59 f2 =
gre2->GetFunction(
"f2");
71 gre4->Fit(
"1 ++ exp(-x)");
73 TF1 *f4 =
gre4->GetFunction(
"1 ++ exp(-x)");
79 leg->AddEntry(
gre3,
" -7 + 2*x*x + x*x*x",
"p");
80 leg->AddEntry(
gre2,
"sin(x) + sin(2*x)",
"p");
81 leg->AddEntry(
gre4,
"-2 + exp(-x)",
"p");
93 x[i] =
r.Uniform(-2, 2);
100 x[i] =
r.Uniform(-2, 2);
101 y[i] = -7 + 2*
x[i]*
x[i] +
x[i]*
x[i]*
x[i]+
r.Gaus()*0.1;
106 for (i=0; i<
n; i++) {
107 x[i] =
r.Uniform(-2, 2);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
A TGraphErrors is a TGraph with error bars.
This class displays a legend box (TPaveText) containing several legend entries.
virtual void SetName(const char *name)
Set the name of the TNamed.
This is the base class for the ROOT Random number generators.
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.