I have a TProfile histogram that has all the points lined up in a nice polynomial curve. So I fitted using a TF1 and Trofile->Fit(…). The thing I dont understand is the Fit algorithm fits the curve onto the bottom of the error bars of the points and I get an enourmous chi2/dof.

I have to modify my polynomial to add an extra constant term of 0.004. Then the curve is fit to the central values of the points and my chi2/dof is sensible.

I dont understand why I should have to shift the curve like this. Is this is expected behaviour? I hope someone can explain this behaviour to me.

I added the file as an attachment. I should say I made the file using root 3.10/03 with gcc 2.95 and then moved the file to my laptop where i have root 3.10/02 with gcc 3.2.2. This shouldnt matter though?

Did you take away the “+0.004” from the poly function first? This is the problem I dont understand. Without this +0.0004 added to the polynomiial the curve will not fit properly - it is fit to the base of the error bars, rather than the central value of each point, which gives a better fit. Why does the fit algorithm not fit the curve in the more reasonable (through the center of the majority of points) position without me forcing it to by adding an extra constant term?

See the plot I attach for what happens if I remove the +0.0004 term from Poly.

It looks obvious that your profile cannot be fitted without the constant term. To check this, I have added a 3rd parameter to your function, see below. The fit converge with the constant parameter=3.6794e-4