RooProdPdf v's RooEffProd

Is there a difference in the normalization/fitting of these classes?

I build two PDF’s that I expect to be the same:

[code]RooRealVar X(“X”, “X”, 0.0, 2.0);

RooRealVar P(“P”, “Fit Parameter”, -1.0, 1.0);
RooPolynomial PDF(“PDF”, “Theory PDF”, X, RooArgList§);

RooGenericPdf A1(“A1”, “Acceptance PDF”, “X <= 1.0 ? 1.0 : 0.5”, RooArgSet(X));
RooFormulaVar A2(“A2”, “Acceptance Function”, “X <= 1.0 ? 1.0 : 0.5”, RooArgSet(X));

RooProdPdf PDFA1(“PDFA1”, “Theory * Acceptance PDF”, RooArgSet(PDF, A1));
RooEffProd PDFA2(“PDFA2”, “Theory * Acceptance Function”, PDF, A2);[/code]
But fitting them against my toy MC gives very different results.

Can anyone point out the flaw in my logic?

Hi,

IN your case the two classes should be equivalent. However due to a bug in the RooProdPdf when using in fitting default optimisation (RooFit::Optimise(2) ), the result is different.
See the bug reported at sft.its.cern.ch/jira/browse/ROOT-7720

Attached is your running example showing that you get the same result when using RooFit::Optimise(1)

Lorenzo

prodTest.C (942 Bytes)