I am a beginner with ROOT. I have a very basic question:
When I do a fit using FitPanel I get a certain value for chisquare, but if I use TMinuit (using something similar to root.cern.ch/root/HowtoFit.html; I am just fitting some data with a simple exponential) I get a chisquare which is 10^3 larger than the one from FitPanel. (If for the FitPanel I get a chisquare of the order of 10^1, for the TMinuit chisquare I get a 10^4 factor!). Otherwise, the fitted parameters from the FitPanel and TMinuit are close to each other. Do you know why the TMinuit chisquare is so unrealistic?
(I have attached the code for the TMinuit fit).
TMinuit.C (1.78 KB)
what are you fitting using the fitpanel, a TGraph ? In that case, the errors in each point is not used in the fit, you should use a TGraphErrors instead.
Otherwise they should return the same chi2, if you are passing the same points (i.e use also the same range)
I am actually using a TGraphErrors. I can’t figure out where the difference is coming from.
please send me also the program you are using for fitting the TGraphErrors.
Also your previous one (TMinuit.C) needs the data file to be run, can you please attach it ?
I appologize for the trouble. While re-checking my code to post it, I did find a mistake. Now both fittings give me the same chi2.
Thank you very much for your help,