Very high chi2/ndf value for a 'good looking' fit!

Dear ROOT forum,

I am trying to fit jpsi invariant mass, and even though the fit looks good visually, the chi2/ndf value is absurdly high ( chi2 = 550696 & chi2_val/ndf = 585.847)! I have attached the image for it. I have used gaussian + crystalball functions for roofit!
How can I improve upon this?


The fit is not perfect, it seems the left tail is not fitting very well, maybe you should consider a different function there. However, it seems the value of the chi2 is still too high for your fit, a log-plot can help more to see the quality of the fit in the tails.
How do you compute the chi2? <aune share the code and/or the RooPlot object



I have used the ‘RooChi2Var’ object. Please find the code attached below.
Thank You!
jpsi_massfit.cxx (2.4 KB)

It is possible that RooChi2Var uses the empty bins. What is the value returned by RooPlot::chiSquare(6), where 6 is your number of fit parameters ?

It comes around ‘Chi-square value (with 6 degrees of freedom) = 23.1149’!

6 should be the number of fitter parameters and not the degree of freedom. 23 is still a large value, but probably reflects what your fit is given the data you have


Yes, I worded it wrong, but it is still RooPlot::chiSquare ( int nFitParam = 6 )'.
So, is it possible to improve upon this then( by taking a zeroth order poly/ exponential function, for example) ?

Maybe you need to add a pdf for some background description. It is difficult to see from just the plot.


I see. Thank you!

Hi ,
I got the following plot after applying (CB + gauss + exp bkg) , with chi2/ndf ~ 1.05. How can I apply a selection cut to jpsi_inv mass based on this?
Like my selection efficiency for mass cut?

This is an analysis question, you apply the cut on your observable, Jpsi_InvM depending on your criteria for retaining signal events vs background events

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