PDF normalization error

Hi all, I do not understand how pdf is properly normalized after data is plot on. I am now working with roofit tutorial 312 with a step further. What happened in tutorial 312 is generateing a dataset in full range (10000 events). Fitting a subset of data (only 3335 events), I want to plot the data and the PDF function (for that subset). The plotting of data is fine, the pdf function is also in correct shape, but the normalization is about 6 times larger than it should be.

I am using root v5.27/04 on SL5, and I am attaching the code in the attachment. Could someone help me with this question? Thanks a lot!!

I am also getting an error message when plotting like following,
[#0] ERROR:InputArguments – RooArgSet::checkForDup: ERROR argument with name model_Int[x,y|fit_nll_model_modelData]_Norm[x,y] is already in this set
I did some search and found this post viewtopic.php?f=3&t=6452&start=0
Is this the same thing?
rf312_multirangefit_2.C (4.16 KB)