by michela » Wed Oct 31, 2012 18:38
Hello
thanks for your answer, I attach a simple example below. The results of the fit do not change,
no matter how large or small are the x-errors.
It seems the y-errors instead are taken into account.
{
c1 = new TCanvas("c1","",200,10,700,500);
Int_t n = 3;
Double_t x[n] = { 0.35, 0.5, 1.61};
Double_t y[n] = {7.4,9,9.6};
Double_t xerr_low=2.05.;
Double_t xerr_high=2.05;
Double_t exl[n] = {.05,.051,err_low};
Double_t exh[n] = {.05,.05,err_high};
Double_t yerr_low=0.05.;
Double_t yerr_high=0.05;
Double_t eyl[n] = {.5,.4,yerr_low};
Double_t eyh[n] = {.3,.2,yerr_high};
gr = new TGraphAsymmErrors(n,x,y,exl,exh,eyl,eyh);
gr->SetMarkerColor(4);
gr->SetMarkerStyle(21);
gr->Draw("AP");
gr->Fit("pol1","F");
return c1;
}