# Convolve RooAbsReal with Gauss

Hello,
I am having issues computing the convolution integral of the Klein-Nishina formula with a gaussian distribution. Below is my source code:

#ifndef CINT
#include “RooGlobalFunc.h”
#else
// Refer to a class implemented in libRooFit to force its loading
class Roo2DKeysPdf;
#endif
#include “RooRealVar.h”
#include “RooDataSet.h”
#include “RooGaussian.h”
#include “TCanvas.h”
#include “TAxis.h”
#include “RooPlot.h”
#include “TMath.h”
#include “TF1.h”
#include “Math/DistFunc.h”
#ifndef CINT
#include “RooCFunction1Binding.h”
#include “RooCFunction3Binding.h”
#endif
#include “RooTFnBinding.h”
#include “RooNumConvPdf.h”
#include “RooConvIntegrandBinding.h”

using namespace RooFit;

void main()
{

// Declare variables x,mean,sigma with associated name, title, initial value and allowed range
RooRealVar x(“x”,“x”,0,30) ;
RooRealVar mean(“mean”,“mean of gaussian”,0) ;
RooRealVar sigma(“sigma”,“width of gaussian”,4.25) ;

// Build gaussian p.d.f in terms of x,mean and sigma
RooGaussian gauss(“gauss”,“gaussian PDF”,x,mean,sigma) ;

// Construct plot frame in 'x’
RooPlot* xframe = x.frame(Title(“Gaussian p.d.f.”)) ;

// Plot gauss in frame (i.e. in x) and draw frame on canvas
gauss.plotOn(xframe) ;

// Plot Klein-Nishina Compton Cross Section
// ---------------------------------------------------------------------------
TF1 *f1 = new TF1(“Differential Cross Section of Compton Scattering for 5MeV Photons”,myfunction,0,30,0);

``````//Create binding of TF1 object to x observable
RooAbsReal* kn = bindFunction(f1, x);

//Make plot frame in observable, plot TF1 binding function
kn->plotOn(xframe);

TCanvas* c = new TCanvas("main", "main", 1200, 400);

//Plot Convolution Integral
x.setBins(10000,"cache");
RooNumConvPdf final(“final”,”final”,x,kn,gauss); //Does not work
final.plotOn(frame);

xframe->Draw();
``````

}

Double_t myfunction(Double_t x, Double_t par)
{
const Double_t pi = TMath::Pi();
Float_t y = x[0];
Double_t f = (pi
pow(7.94,-26))/(0.04677
23.9)(2-(2y)/(0.04677*(23.9-y))+(yy)/((0.046770.04677)(23.9-y)(23.9-y))+(yy/(23.9(23.9-y))));

``````return f;
``````

}

When I run this I get:

Error: Symbol “final” is not defined in current scope main.cpp:61: