RooAbsPdf::generate problem?

Hi I am using ROOT v5.27/04, I am now working on per event error fit simulation. It is similar to the tutorial 306, but I would like to add a background piece into the PDF. Below is what I want to do.

There is a signal PDF which is a Gaussian with x, mean and sigma, there is also a background PDF which is flat over x and sigma. A landau distribution is used to generate a dataset of sigma, the dataset of x is then generated using ProtoData(*sigmaData). The generated dataset of x is indeed a combination of Gaussian and flat background, however, the fraction is wrong. For input background fraction = 0.1, the generated frac is actually about 0.25. If the fraction is set to be 0.0 or 1.0 (pure signal or pure background), no problem encountered, but as long as the fraction is between 0 and 1, the generated fraction is not what I provide.

I do not even try to fit the data, I just have a PDF and then generate data from the PDF. Could someone take a look at the script I attached? Thanks !!script_error.C (1.7 KB)