Fitting a TGraph2D
Processing /mnt/build/workspace/root-makedoc-v610/rootspi/rdoc/src/v6-10-00-patches/tutorials/fit/graph2dfit.C...
****************************************
Minimizer is Minuit / Migrad
Chi2 = 4.25425e+06
NDf = 398
Edm = 1.32198e-12
NCalls = 55
p0 = 0.574556 +/- 0.109982
p1 = 1.72367 +/- 0.329947
(TCanvas *) 0x55cc1574f390
{
TF2 *f2 =
new TF2(
"f2",
"1000*(([0]*sin(x)/x)*([1]*sin(y)/y))+200",
-fl,fl,-fl,fl);
z = f2->
Eval(x,y)*(1+rnd);
}
"#splitline{Difference between Original}{#splitline{function and Function}{with noise}}",
100, -hr, hr);
"#splitline{Difference between Original}{#splitline{function and Delaunay triangles}{interpolation}}",
100, -hr, hr);
"#splitline{Difference between Original}{function and Minuit fit}",
500, -hr, hr);
z = f2->
Eval(x,y)*(1+rnd);
}
f2->
SetTitle(
"Original function with Graph2D points on top");
dt->
SetTitle(
"Histogram produced with Delaunay interpolation");
fit2->
SetTitle(
"Minuit fit result on the Graph2D points");
return c;
}
- Author
- Olivier Couet
Definition in file graph2dfit.C.