[ROOT] TGraph::Fit

From: nurse (nurse@fnal.gov)
Date: Wed Oct 09 2002 - 16:30:03 MEST


Hi,
I am trying to draw a TGraph and then fit it to a pol2.
I get a segmentation violation when I try and run this code:

{

const Int_t  n=5;
Double_t x[n]={1.0, 2.0, 3.0, 4.0, 5.0}, y[n]={8.8,7.7,7.0,8.1,9.1};
TGraph *chi=new TGraph(n,x,y);

chi->Draw("*A");

Axis_t xmin=x[0];
Axis_t xmax=x[5];
chi->Fit("pol2","","",xmin,xmax);
//chi->Fit("pol2");
}


I notice that if I fit with the line that is commented out on version
3.02/07 it works fine so I assume it is to do with the changes made to Fit
in the new root version.
Please also note that if I run this code without the chi->Draw("*A"); line
it compiles but gives a very bad fit.
Thanks for your help,
Emily Nurse.



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:13 MET