RooFit Calculating chi2

Hi,

See my previous answer 4 ways to compute chi2 -> 4 different numbers in RooFit

Concerning the error, I think you are not plotting the full pdf but only the “cb” component. Just add a line

sum.plotOn(frame) ;

Best Regards

Lorenzo