RooFFTConvPdf on a large mass range

Dear experts,

I’m experiencing a problem with the definition of a RooFFTConvPdf on a large mass range.

First I define my dataset:
RooRealVar* mgg = new RooRealVar(“mgg”, “MASS”, 300, 6000, “”);
RooArgSet* ntplVars = new RooArgSet(*mgg)
RooDataSet signal(“signal”,“dataset”,sigTree,*ntplVars,"","");

then a Breit Wigner:
RooBreitWigner SigModelBW(“SigModelBW”,“SigModelBW”, *mgg, BWmean, BWwidth);

and then a doubleCrystalBall:
RooDoubleCB ResponseDoubleCB(“ResponseDoubleCB”,“ResponseDoubleCB”, *mgg, CBmean, CBsigma, CBalpha1, CBn1, CBalpha2, CBn2);

All the parameters of both the BW and the crystal ball functions are fixed.

Finally I define the convolution in this way:
mgg->setBins(5000, “cache”);
RooFFTConvPdf* ConvolutedRes;
ConvolutedRes = new RooFFTConvPdf(“sig”,“sig”, *mgg, SigModelBW, ResponseDoubleCB);

and when I plot it I get the result attached (largeRange.png).
If I restrict everything to a smaller range (eg 1250-1700) things look ok, see the attached plot (narrowRange.png).

Can you please help me in understanding what I’m doing wrong, and if there is a way to have my pdf on the full range?
Many thanks in advance for your help.




When you are using the larger range, have you tried to increase also the number of bins to a larger value, for example 50000 ?


Hi Lorenzo,

yes, I tried but it did not help. The result does not change.



Hello Chiara,

Can you please post the running macro (including workspace or whatever data are needed) so I can check it



Hi Lorenzo,

I attach the macro, which I run with
root -b
The doubleCB function is defined in myRooPdfs.*

The macro reads a root file which is in a public afs area, please let me know if I need to upload it as well or you can access it from there.

Many thanks in advance. Cheers,

        Chiara (3.66 KB)
myRooPdfs.h (1 KB) (3.52 KB)


Thank you for uploading your code. I could download your root file and reproduce your problem. I will investigate this problem.

Best Regards



The convolution works fine, as expected. This seems to be a plotting problem of the RooPlot, if you plot the convolution PDF using ROOT, for example adding these lines in your code,

  TH1D * h1 = new TH1D("h1","Convoluted Distribution",500,MINmass,MAXmass);

  for (int i = 1; i <= h1->GetNbinsX(); ++i) {
     mgg->setVal(h1->GetXaxis()->GetBinCenter(i) );
     h1->SetBinContent(i, ConvolutedRes->getVal(*mgg) ); 


The drawn curve seems to be correct. Probably the algorithm of RooPlot fails to evaluate the curve in a so large range. We will investigate the cause


Ok. Thank you very much for your help!



I found the cause of your problem. You have defined two times the observable variable “mug” and with different binning. This confuses the plotter. Attached is a fixed version of the macro that should work

Best Regards

Lorenzo (3.89 KB)