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

Hi,
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 ?

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) ?

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?