# Problem with RooProdPdf

**URL:** <https://root-forum.cern.ch/t/problem-with-rooprodpdf/64159>\
**Category:** Roofit and RooStats\
**Created:** [September 17, 2025, 2:40pm UTC](https://root-forum.cern.ch/t/problem-with-rooprodpdf/64159 "2025-09-17T14:40:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anikiten](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@anikiten](https://root-forum.cern.ch/u/anikiten)\
**Post date:** [September 17, 2025, 2:40pm UTC](https://root-forum.cern.ch/t/problem-with-rooprodpdf/64159/1 "2025-09-17T14:40:10Z")

</div>

Dear experts,

I got a problem with fitting my unbinned data with signal model and RooProdPdf which is convolution of Gaussian and Polynomial of 1st order. I got unnormous amount of wornings like this:

[#0] WARNING:Eval – RooAbsPdf::getLogVal(model) WARNING: large likelihood value: 1.30437e+142

and absolutely stupid result of fit. When I fit separately by Gaussian or by Polynomial there is no problem with fit.

Here are lines of code I use:

```cpp
RooRealVar dimuonmass11(“dimuonmass11”,“mass interval”,12.0,70.0);

// signal model
RooRealVar mean(“mean”,“BW mean”,27.3,25.0,30.0);
RooRealVar width(“width”,“BW width”,1.4,0.0,5.6);
RooRealVar sigma(“sigma”,“dimuon resolution”,0.45,0.45,0.45);
RooVoigtian sig(“sig”, “signal”, dimuonmass11, mean, width, sigma);
RooRealVar nsig(“nsig”,“signal normalization”,30.,0.0,300.0); 

// background model
// Gaussian
RooRealVar a1g(“a1g”,“coefficient a1g”,14,0.0,30.0);
RooRealVar a2g(“a2g”,“coefficient a2g”,21,0.0,30.0);
RooGaussian bkg_gauss(“bkg_gauss”," background gaussian",dimuonmass11,a1g,a2g);
// Poly1
RooRealVar a1p(“a1p”,“coefficient a1p”,0.002,-0.03,0.03);
RooPolynomial bkg_poly1(“bkg_poly1”,“background poly1”,dimuonmass11,RooArgList(a1p));
// Gauss x Poly
RooProdPdf bkg(“bkg”,“Gaussian x Poly1”,RooArgSet(bkg_gauss,bkg_poly1));

// bkg normalization
RooRealVar nbkg(“nbkg”,“bkg normalization”,3380,3280,3480);
// define model
RooAddPdf model(“model”,“model”,RooArgList(sig,bkg),RooArgList(nsig,nbkg));

// define data
RooDataSet data(“data”,“my data”,tree,dimuonmass11);

//fit

RooFitResult\* r = model.fitTo(data,Range(12.0,70.0),Save());

```

Can you help, please. I guess it is a simple, stupid error I do in code but I can’t see it.

Thanks, Sasha.

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [September 17, 2025, 4:41pm UTC](https://root-forum.cern.ch/t/problem-with-rooprodpdf/64159/2 "2025-09-17T16:41:31Z")

</div>

Hello Sasha,

I’m inviting @jonas to have a look here.

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [September 17, 2025, 4:46pm UTC](https://root-forum.cern.ch/t/problem-with-rooprodpdf/64159/3 "2025-09-17T16:46:45Z")

</div>

Hello Sasha,

I did, however, notice that there might be a misunderstanding: You would use the ProdPdf to do a 2D fit in two variables. The product is used to multiply the likelihood values from both dimensions.

If you want to convolute two distributions, you have to … well convolute! 🙂  
Here is the corresponding section from the tutorials:

> **[ROOT: RooFit](https://root.cern.ch/doc/master/group __tutorial__ roofit__main.html#roofit_addition_convolution)**

And specifically, I think that rf208 could help:

> **[ROOT: tutorials/roofit/roofit/rf208\_convolution.C File Reference](https://root.cern.ch/doc/master/rf208__convolution_8C.html)**

---

<div class="post-metadata">

**Author:** ![anikiten](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@anikiten](https://root-forum.cern.ch/u/anikiten)\
**Post date:** [September 18, 2025, 9:58am UTC](https://root-forum.cern.ch/t/problem-with-rooprodpdf/64159/4 "2025-09-18T09:58:14Z")

</div>

Hello Stephan,

Indeed I want to convolute 🙂  
Let me try your example and I will let you know.

Thanks !

Cheers, Sasha.

---

<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:** [October 2, 2025, 9:58am UTC](https://root-forum.cern.ch/t/problem-with-rooprodpdf/64159/5 "2025-10-02T09:58:51Z")

</div>

Closed on October 2, 2025, 9:58am UTC

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