Convolution with non-observable

Hello ROOTers!

I am playing with Roofit trying to fit our data. I would like to convolute two pdfs via non-observable variable.
Example: I have a distribution of positions on the detector with kinetic energy as a parameter. The kinetic energy has also some distribution (e.g. gauss). Is it possible to convolute the two distributions via energy to obtain distribution vs. position?

Thank you!


This should work. One can do e.g.

RooAbsPdf* pdf1 ; // = F(x;E) ;
RooAbsPdf* pdf2 ; // = G(E) ;
RooFFTConvPdf pdf1x2(“pdf1x2”,“pdf1x2”,E,*pdf1,*pdf2) ;

and use pdf1x2 as a p.d.f in x. I’m not 100% sure it works completely OK in the
latest ROOT release, but it definitely works in the roofit/roostats development branch,
on which I just tested it.

( to get that one do ‘svn co root_dev_roostats’, configure it with ‘.configure --enable-roofit --enable-fftw’ and ‘make’ it)

If you decide to use the dev branch code you will need add one extra line of code

pdf1x2.setCacheObs(RooArgSet(x,E)) ;

as the new code implements a new default strategy for observable caching that is less efficient for the case of a convolution in parameters, but more efficient in other cases.