Chi square in roofit

Dear Experts,

I am fitting a variable Bmass with double gaussian+exponential. I want to check the fit quality. Could you please tell me how to print the chi square/dof in the fitted plot? I also want to plot pull distributions for the fit plot. How to plot pull distribution?

Thanks,
Deepak

Hi Deepak, could you post some minimal working code? These things depend on how you are doing your fit.
~/Vince

Dear Vcroft,

I am attaching the fitting code. Please have a look on it.

Thanks,
Deepakbsmass_data.cc (5.3 KB)

Okey dokey a scan of your tutorials folder should find this macro:
https://root.cern.ch/root/html/tutorials/roofit/rf109_chi2residpull.C.html

frame->chiSquare() ;
frame->makePullHist() ;
frame->makeResidHist() ;

That should fit in with your code quite easily

Dear Vcroft,

frame->chiSquare() ; prints only chisquare value. But I need chisquare/dof value.

Thanks,
Deepak

Hello Deepak,

it actually prints chi2/nBins. See e.g. here:
https://root.cern.ch/doc/master/classRooPlot.html

However, it doesn’t know how many parameters the fitted function had. That’s why you have to give this as a hint for the internal calculation.
I updated the documentation, so it will show up much more clearly on the webpages in a couple of days.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.