I wanted to read the documentation of some parts of root and after searching for a couple hours i almost managed to find everything but i still haven’t found
How root estimates uncertainty on fit parameters (especially when fitting TGraph and TGraphErrors, also if there are differences between the two)
This is one is a bit strange i guess but somebody at university told me that “root has a strange way of calculating the chi square” so i’m also looking for that part of the code (but at this point i too don’t really know what i am looking for)
When fitting a TGraph, you do not provide uncertainties on the data points and therefore the parameters uncertainties are obtained by rescaling the obtained error from the covariance matrix from the fit by the factor: sqrt(chisquare/(ndf-1)).
This is explained in the doc of `TGraph::TFit( see note 5 in ROOT: TGraph Class Reference) and also Least squares - Wikipedia.
When fitting instead a TGraphErrors you provide errors in the data point (in y and/or y) and the parameter errors are obtained directly from the covariance matrix of the fit without any rescaling.
It is clear that in case you obtained a chi2/ndf very different from 1, there could be an issue with the obtained parameter errors, since the provided errors in the data points might be under/over estimated.