Large chi squre per ndf in fitting with gaussian function

Hello Rooters,
I am trying to fit left side of a histogram with simple in-built Gaussian function. But the chi square/ndf is so huge which means the fit is terrible! Could you please offer a suggestion?
I attached a macro reproducing the error.
fit.C (641 Bytes)
fit.root (7.5 KB)

ROOT Version: 5
Platform: Not Provided
Compiler: Not Provided

I’m afraid that the “gaus” function is not really able to describe your data, which error bars are quite small. You can try to use the “W” fit option in order to “ignore” them (i.e. set them to 1):
hist->Fit("gaus", "W", "", -3.5, 0.0);

You can get a much better result with:
hist->Fit("expo", "", "", -3.5, 0.0); // "expo" = exp([Constant]+[Slope]*x)

BTW. Your histogram has y_max./y_min. around 1e8 so I think that you should create a TH1D, not a TH1F.

Dear Coyote,
thanks for your help. One question here is it necessary that chi square per ndf must be near to 1 to indicate goodness of fit? If so, then fitting with the exponential function is still not suited for the fit…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.