Does the function fit include errorbars of each bin content?

Supposed I have TH1D* hist, I want to fit it with a gaus function. So one can do the following:
hist->Fit(“gaus”).

My question is that in this fit, whether the errorbar of each bin content ( sqrt(bin content) in my case) is automatically included? Or in this fit the weight is set equally for each bin? What is the default setting for fit?

Second question: several packages are offered in the document, like the standard root fit, Minuit and etc… Are there any preference which one is better? I cannot find more detail information on this.

Thanks.

Hi,

  1. Yes by default the error in each bin are considered in the fit. If you do not want to consider them (i.e set all errors to 1) you can do it by using option “W”.
    See root.cern.ch/root/htmldoc/TH1.html#TH1:Fit

  2. The standard ROOT fit is based by default on Minuit and it is the recommended one. It is the most efficient one when fitting a simple function like a Gaussian.

Best Regards

Lorenzo