I fill a mass distribution histogram (the left histogram in the attachements, yellow color - fit function). After that I fit it and check the extracted number of events.

If I don’t weight my events I obtain:
N_D0 = 209 +/ 19 <= both the value and its error are fine!

If events were weighted with weight>1:
N_D0 = 4444 +/- 86 <= the value is good, the error is too small

If events were weighted with weight<1:
N_D0 = 6 +/- 3 <= the value is good, the error is too big

Obviously I miss something in the options, but I don’t understand what…

And another (but related) question.
I have read that likelihood fit cannot be used on weighted data, so I have tried to use the chi2-fit, but the strange thing is that the fit did not converge (with exactly the same fit function). Is there a simple reason for that?

My ROOT version is:
Version 5.26/00 14 December 2009

But it in principle I have read (in one of the example RooFit scripts) that standard fit uses maximum likelihood (ML) method, and ML ignores custom errors, assuming always the poisson distribution for them. And in addition the error bars shown by “plotOn” has nothing to do with errors used by the fit (which is quite confusing and difficult to debug).

So have tried to switch to “chi2” method of data fitting. It still does not work well, by I have ideas how to improve it…

is there any progress on this issue? I am using ROOT 5.26 as well and I have the same problem with the chi2 fit method. When using the ML fit the fit converges just fine, but the error coming from the fit is wrong since I fit a weighted distribution. Using the chi2 fit the fit does not converge.
When fitting the distribution with ROOT directly, i.e. without roofit everything works fine. The fit converges and the uncertainty is reasonable.
But, since I have done all my fits up to this point with roofit I would like to do the fits on weighted histograms with roofit.