A “fraction” that represents a selection efficiency

The first one (“model”) is built as a RooAddPdf (of other RooAbsPdf objects); the second (“fraction”) as a RooGenericPdf.

Is the following definition supported/expected to behave correctly?
RooGenericPdf ymodel(“final”, “final”, “model*fraction”, RooArgSet(model,fraction));

it compiles and runs, but the result seems to have normalization problems; specifically, a 2D model defined as:
RooProdPdf m2d (“m2d”, “m2d”, ymodel, Conditional(shape,x));

the following sequence fails to draw the model correctly:
RooDataSet *toy = m2d.generate(RooArgSet(x,y),10000);

RooGenericPdf ymodel(“ymodel”, “ymodel”, fraction + " * xmodel", RooArgSet(y,model,x));
(where ‘fraction’ is a TString with the expression for the selection fraction)

with slightly better (but still not quite correct) results.

I can’t precisely guess what goes wrong in your setup, but if you are dealing
with a production of a pdf and an efficieny, I can suggest to look at the
specialized class for this RooEffProd.

I am getting problem while using RooGeneric PDF for toy MC study. I have three signals in my fitter. So I did toy MC study with Generic PDF then it is effecting my other two signals. So pull distribution is shifted. But when I try any other PDF (defined in Roofit) instead of Generic one, then pull distribution is returning no bias. Is there any problem regarding Normalization while toy MC study.