RooGenericPdf from the product of predefined RooAbsPdf's


I defined two models of a single variable (y):

  1. CrystalBall1 + CrystallBall2 + fraction*exponential
  2. 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);

RooPlot *yframe = y.frame();

(on the other hand, using only fraction or only model1 instead of ymodel, the plot does show as expected).

Is there a way to fix this? (without recoding model*fraction as a standalone RooAbsPdf class)


I’ve also tried the following:

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.

Here is an example … rod.C.html


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.

Thanks a lot in advance
A. Bala

For the record, this problem is most likely fixed in ROOT 6.28.00 with this pull request: