How to obtain fit goodness in ROOFIT?

Hi,

RooPlot::chiSquare() should give you the chi2/dof. You can provide it the number of floating parameters if the curve is the result of a fit to adjust the ndof. If you have multiple curves or dataset, the chi^2 is calculated from the last added dataset and curve. If this is not what you want you can explicitly specify the names of the curve and histogram in the RooPlot you want compared.

Double_t chiSquare(int nFitParam=0) ;
Double_t chiSquare(const char* pdfname, const char* histname, int nFitParam=0) const ;

Plot and histogram names are automatically chosen (do e.g. RooPlot::print()), but you can also choose them yourself by adding a Name(“blah”) argument to each plotOn call.

If you still see problems can you send me an example that reproduces the problem (or send the a ROOT file with the RooPlot in question)

Wouter

1 Like