00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __CINT__
00016 #include "RooGlobalFunc.h"
00017 #endif
00018 #include "RooRealVar.h"
00019 #include "RooDataSet.h"
00020 #include "RooGaussian.h"
00021 #include "RooLandau.h"
00022 #include "RooFFTConvPdf.h"
00023 #include "RooPlot.h"
00024 #include "TCanvas.h"
00025 #include "TAxis.h"
00026 #include "TH1.h"
00027 using namespace RooFit ;
00028
00029
00030
00031 void rf208_convolution()
00032 {
00033
00034
00035
00036
00037 RooRealVar t("t","t",-10,30) ;
00038
00039
00040 RooRealVar ml("ml","mean landau",5.,-20,20) ;
00041 RooRealVar sl("sl","sigma landau",1,0.1,10) ;
00042 RooLandau landau("lx","lx",t,ml,sl) ;
00043
00044
00045 RooRealVar mg("mg","mg",0) ;
00046 RooRealVar sg("sg","sg",2,0.1,10) ;
00047 RooGaussian gauss("gauss","gauss",t,mg,sg) ;
00048
00049
00050
00051
00052
00053
00054 t.setBins(10000,"cache") ;
00055
00056
00057 RooFFTConvPdf lxg("lxg","landau (X) gauss",t,landau,gauss) ;
00058
00059
00060
00061
00062
00063
00064
00065 RooDataSet* data = lxg.generate(t,10000) ;
00066
00067
00068 lxg.fitTo(*data) ;
00069
00070
00071 RooPlot* frame = t.frame(Title("landau (x) gauss convolution")) ;
00072 data->plotOn(frame) ;
00073 lxg.plotOn(frame) ;
00074 landau.plotOn(frame,LineStyle(kDashed)) ;
00075
00076
00077
00078 new TCanvas("rf208_convolution","rf208_convolution",600,600) ;
00079 gPad->SetLeftMargin(0.15) ; frame->GetYaxis()->SetTitleOffset(1.4) ; frame->Draw() ;
00080
00081 }
00082
00083
00084