Changing Behaviour of fitTo() in RooFit


I have a macro which uses RooFit to make some fits to my toy data. I am using the fitTo() method of RooAbsPdf to do the fit.

I would like to see how the fit is affected by doing the fit using the Chisq method rather than the -log(L) method which is the default in RooFit.

In the documentation for fitTo(), I couldn’t find any mention of a named argument (or old-style fit option letter) which lets you do the fit using the chisq method.

Could anyone tell me what it is?

Thank you,


Hi Laurence,

A chi^2 fit is not interfaced to the RooAbsPdf::fitTo() method but can be performed quite easily. Given a RooAbsPdf* f and a RooDataHist* d do

RooChi2Var chi2("chi2","chi2",*f,*d) ;
RooMinuit m(chi2) ;
m.migrad() ;
m.hesse() ;
RooFitResult* r = ; 

The last step is optional (and corresponds to the “r” option of fitTo()), changes in parameter values and their error are automatically backpropagated after each minuit call.