Please find my code down below.
I want to have the fit-parameters box (sigma and width of the gaussian and the chi square of the fit)
As you can see I tried to use “paramOn” but the parameter box is not appearing (I’m sure I used it wrong )
I hope you’ll be able to help me.
//---------------------------------------------------------------------------------------------------------------------------------------------//
RooRealVar x(“x”,“MM”,3.,3.19) ;
RooDataHist dh(“dh”,“dataset”,x,h);
RooPlot* frame = x.frame(Title("")) ;
dh.plotOn(frame) ;
RooRealVar mean1(“mean1”,“mean of gaussians”,3.095);
RooRealVar sigma1(“sigma1”,“width of gaussians”,0.004);
RooGaussian sig1(“sig1”,“Signal component 1”,x,mean1,sigma1); //gaussianSignal
RooRealVar a0(“a0”,“a0”,0.0005,-2.,1.) ;
RooRealVar a1(“a1”,“a1”,-0.0002,-2.,1.) ;
RooRealVar a2(“a2”,“a2”,0.0005,-1.,1.) ;
RooChebychev bkg(“bkg”,“background p.d.f.”,x,RooArgList(a0,a1,a2)) ;
RooRealVar sig1frac(“sig1frac”,“fraction of component 1 in signal”,0.8,0.,1.) ; //sig +bcg
RooAddPdf all(“all”,“Signal”,RooArgList(bkg,sig1),sig1frac) ;
all.fitTo(dh) ;
all.plotOn(frame) ;
all.plotOn(frame,Components(bkg),LineStyle(kDashed));
paramOn (frame,RooFit.Parameters(mean1,sigma1))
frame->Draw();