25 auto c =
new TCanvas(
"c",
"Graph2D example",0,0,600,800);
35 auto f2 =
new TF2(
"f2",
"1000*(([0]*sin(x)/x)*([1]*sin(y)/y))+200",
37 f2->SetParameters(1,1);
42 for (
int N=0;
N<nd;
N++) {
46 z = f2->Eval(
x,
y)*(1+rnd);
48 dt->SetPoint(
N,
x,
y,z);
53 "#splitline{Difference between Original}{#splitline{function and Function}{with noise}}",
56 "#splitline{Difference between Original}{#splitline{function and Delaunay triangles}{interpolation}}",
59 "#splitline{Difference between Original}{function and Minuit fit}",
62 f2->SetParameters(0.5,1.5);
64 auto fit2 = (
TF2*)dt->FindObject(
"f2");
66 f2->SetParameters(1,1);
68 for (
int N=0;
N<
np;
N++) {
72 z = f2->Eval(
x,
y)*(1+rnd);
74 z = dt->Interpolate(
x,
y);
75 h2->Fill(f2->Eval(
x,
y)-z);
77 h3->Fill(f2->Eval(
x,
y)-z);
81 f2->SetTitle(
"Original function with Graph2D points on top");
90 dt->SetTitle(
"Histogram produced with Delaunay interpolation");
94 fit2->SetTitle(
"Minuit fit result on the Graph2D points");
102 c->cd(4);
h2->Fit(
"gaus",
"Q") ;
h2->Draw();
103 c->cd(6);
h3->Fit(
"gaus",
"Q") ;
h3->Draw();
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
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
R__EXTERN TStyle * gStyle
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
A 2-Dim function with parameters.
Graphics object made of three arrays X, Y and Z with the same number of points each.
1-D histogram with a double per channel (see TH1 documentation)
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 Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
void Draw(Option_t *option="") override
Draw this histogram with options.
This is the base class for the ROOT Random number generators.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
void SetHistTopMargin(Double_t hmax=0.05)
void SetOptFit(Int_t fit=1)
The type of information about fit parameters printed in the histogram statistics box can be selected ...