Accessing parameters while fitting


I’m using root 3.10.02.

I’m trying get access to the chi2 while I’m fitting a set of datapoints, instead of getting only the resulting best chi2 with the GetChisquare() function.
I’d like to do this in order to take a look at the chi2 surface.


TGraphErrors *graph = new TGraphErrors(…)

Double_t galster_fit(Double_t *x, Double_t *par);

TF1 *func = new TF1(“galster”,galster_fit,low,high,8);



I’m leaving out quite a few lines of code, but basically the fit itself works. What I’d like to know is if there is any way to access the chi2 WHILE Minuit is fitting (or at least dump it into a TH1 or something). I looked through Ifit.C and some other examples, but it’s not very clear to me how I can do this.



You can try to use gMinuit->fAmin (public member of TMinuit)