# Accuracy of convolution using RooFFTConvPdf

**URL:** <https://root-forum.cern.ch/t/accuracy-of-convolution-using-roofftconvpdf/19571>\
**Category:** Roofit and RooStats\
**Created:** [July 20, 2015, 2:45pm UTC](https://root-forum.cern.ch/t/accuracy-of-convolution-using-roofftconvpdf/19571 "2015-07-20T14:45:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emiglior](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/ed655f/32.png) [@emiglior](https://root-forum.cern.ch/u/emiglior)\
**Post date:** [July 20, 2015, 2:45pm UTC](https://root-forum.cern.ch/t/accuracy-of-convolution-using-roofftconvpdf/19571/1 "2015-07-20T14:45:40Z")

</div>

Dear experts,

I would like to produce a TH2 representing the convolution of a TH1, the distribution of the invariant mass of muons from Z-\>mumu decays, with a Gaussian for different values of the standard deviation of the Gaussian (e.g. 'sigma"). The typical range of sigmas I am investigating is [0.,50] GeV in 50 MeV steps.  
For the convolution I use RooFFTConvPdf.

I attach a tar file with the PyROOT script and the input file I am using.

Indeed with this script I am experiencing two problems:

1. with the current settings the shift of the peak position, even with a small value of the sigma, looks larger than expected, e.g. with sigma=50 MeV the peak is shifted of about 200 MeV

 ![](https://root-forum.cern.ch/uploads/default/original/2X/d/dd4e21a4fb1446b57ef3bcd7e76d79ff59785098.png)  

1. when trying a finer scan of the sigmas, I have found that for sigma\<5 MeV the convolution fails returning a pdf which is always zero.

I have tried to increase the number of bins used in the FFT or changing the choice of the buffer apparently with no effects.

Am I mis-configuring something? Do you have any suggestion?  
Thanks in advance for the answer.

Regards,  
Ernesto Migliore  
[ProbsConv\_Z.tar](https://root-forum.cern.ch/uploads/default/original/2X/4/4e228f53b842c965c82d2e843c8b80841af01337.tar) (19.6 KB)
