Problem with RooProdPdf

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:

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.

Hello Sasha,

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

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! :slightly_smiling_face:
Here is the corresponding section from the tutorials:

And specifically, I think that rf208 could help:

Hello Stephan,

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

Thanks !

Cheers, Sasha.

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