Hi all:
How can i obtain chi2/d.o.f after a fitting by roofit?
The roofit use likelihood method to fit a pdf to data.
can chi2 = xframe->chiSquare() work? it seems the value of it
is not right for i only have 70 bins but the chiSquare() alway greater than 1000 and the fit seems ok.
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.
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)