Trouble with RooProdPdf of a RooSimultaneousPdf and a gaussian constraint when root version >6.30

I recently upgraded my code from 6.30 to a newer version, and 6.32, 6.34 or 6.36 all give me the same problem.

This used to work:

RooAddPdf pdf_combined_1= RooAddPdf(("pdf_combined_1", ("Signal + Background_PDF_1",  pdfs_1, norms_1);
RooAddPdf pdf_combined_2 = RooAddPdf(("pdf_combined_2", ("Signal + Background_PDF_2",  pdfs_2, norms_2);

RooSimultaneous sim_pdf = RooSimultaneous("pdf_sim", "Simultaneous PDF", *eventClass_);
sim_pdf.addPdf(pdf_combined_1, “class_1“);
sim_pdf.addPdf(pdf_combined_2, “class_2“);

RooProdPdf pdf_full_ = RooProdPdf("pdf_full", "Total PDF with extermalconstraints", RooArgList(sim_pdf,gauss_constraint));

RooFitResult* fitResult_= pdf_full_.fitTo(*data);

However, when I upgraded the root version I got this error:

RooSimultaneous did not overload RooAbsPdf::createExpectedEventsFunc()!

I solved it by instead of making a product by calling fitTo of the simulatenous pdf with an argument of ExternalConstraints(). However, I also try to use RooStats and the ProfileLikelihoodCalculator with a modelconfig, and SetExternalConstraints() for the model config does nothing, I tried to dig up the code of the profile calculator and it is not used, so the NLL built by the calculator doesn’'t contain my constraints.

Is there any example where RooSimultaneous is used with constraints and RooStats? I only find examples with simple pdfs with no constraints but maybe I am overlooking something.

Thank you!

I guess @jonas can help

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.