Can I believe this fit result and be Happy .
PS; If you look at the fit some data points near the mean are not lying on the pdf, but still I am getting this much good reduced ChiSq value?!
Please enlighten me .
I think you have a lots of bins with little statistics or are empty. The chi-square makes sense only of you have at least 5 entries per bin, otherwise it will be biased. Try rebinning your data and re-compute the chi-square. One other thing to try is to compute the likelihood ratio as suggested by Baker-Cousins (see for example https://www.physics.ucla.edu/~cousins/stats/cousins_saturated.pdf ).
As for the error that you see, itβs because your are doing an extended fit with the Extended() command with a model that doesnβt encode any number of events.
In particular, this definition of the RooAddPdf is similar to the code in your script:
// Sum the composite signal and background into an extended pdf nsig*sig+nbkg*bkg
RooRealVar nsig("nsig", "number of signal events", 500, 0., 10000);
RooRealVar nbkg("nbkg", "number of background events", 500, 0, 10000);
RooAddPdf model("model", "(g1+g2)+a", RooArgList(bkg, sig), RooArgList(nbkg, nsig));
So to be able to do extended fits, the coefficients of the RooAddPdf should be expected number of events, and not fractions below one.
Alternatively, you can simply remove the Extended() command in fitTo() to not do an extended fit. Depends on your usecase.