33 TH1F *h_ExpGauss =
new TH1F(
"h_ExpGauss",
"Exponential convoluted by gaussian",100,0.,5.);
34 for (
int i=0;i<1e6;i++)
36 Double_t x = gRandom->Exp(1./0.3);
37 x += gRandom->Gaus(0.,3.);
41 TF1Convolution *f_conv =
new TF1Convolution(
"expo",
"gaus",-1,6,
true);
42 f_conv->SetRange(-1.,6.);
43 f_conv->SetNofPointsFFT(1000);
44 TF1 *f =
new TF1(
"f",*f_conv, 0., 5., f_conv->GetNpar());
45 f->SetParameters(1.,-0.3,0.,1.);
48 new TCanvas(
"c",
"c",800,1000);
49 h_ExpGauss -> Fit(
"f");