I have a TGraph object w/ points essentially on a line. When I do TGraph::Fit(“pol1”) the fit results look funny. I’ve attached the pictures and .ROOT file. To demonstrate for yourself type
TFile f("diag.root")
pgx->Draw("ap");
pgx->Fit("pol1") Any help would be greatly appreciated
Your two graphs have many points at [0,0]. If you remove these points,
you will get a correct fit, otherwise these weights have a strong weight
during the fit (all together).
Rene,
I did not realize that calling TGraph::TGraph(n) creates n points at (0,0) . The fix was to call TGraph::Set(actualNumberOfPoints) before doing the fit. Thanks!
Ed