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

**URL:** <https://root-forum.cern.ch/t/trouble-with-rooprodpdf-of-a-roosimultaneouspdf-and-a-gaussian-constraint-when-root-version-6-30/64380>\
**Category:** Roofit and RooStats\
**Created:** [November 5, 2025, 9:27am UTC](https://root-forum.cern.ch/t/trouble-with-rooprodpdf-of-a-roosimultaneouspdf-and-a-gaussian-constraint-when-root-version-6-30/64380 "2025-11-05T09:27:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vic](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vic/32/37197_2.png) [@Vic](https://root-forum.cern.ch/u/Vic)\
**Post date:** [November 5, 2025, 9:27am UTC](https://root-forum.cern.ch/t/trouble-with-rooprodpdf-of-a-roosimultaneouspdf-and-a-gaussian-constraint-when-root-version-6-30/64380/1 "2025-11-05T09:27:19Z")

</div>

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:

```auto
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:

```auto
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!

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [November 5, 2025, 9:29am UTC](https://root-forum.cern.ch/t/trouble-with-rooprodpdf-of-a-roosimultaneouspdf-and-a-gaussian-constraint-when-root-version-6-30/64380/2 "2025-11-05T09:29:41Z")

</div>

I guess @jonas can help

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [November 19, 2025, 9:30am UTC](https://root-forum.cern.ch/t/trouble-with-rooprodpdf-of-a-roosimultaneouspdf-and-a-gaussian-constraint-when-root-version-6-30/64380/3 "2025-11-19T09:30:32Z")

</div>

Closed on November 19, 2025, 9:30am UTC

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