RooFit access p.d.f

Hi All,

I’m trying out the new RooFit, and have a question about separating the pdfs.
Here is my situation. I fit a distribution with a background plus gaussian function. The background is modeled after the simulation histogram.

RooRealVar x(“x”,“x”,1.4,2.);
RooRealVar mean(“mean”,“mean”,1.4,1.6);
RooRealVar sigma(“sigma”,“sigma”,0.0005,0.018);

RooGaussian gauss(“gauss”,“Theta Peak”,x,mean,sigma);

RooDataHist simulation(“simulation”,"",x,HSIM);
RooDataHist data(“data”,"",x,HDATA);

RooRealVar nsig(“nsig”,“signal Fracktion”,500,0.,10000.);
RooRealVar nbkg(“nbkg”,“backgroun Fracktion”,500,0.,10000.);

RooHistPdf BackGround(“BackGround”,“Phi Simulation”,x,simulation,7);
RooAddPdf fModel(“Model”,“Model”,RooArgList(BackGround,gauss),RooArgList(nbkg,nsig));

RooFitResult* res = fModel.fitTo(data,Range(1.40,1.80),Minos(kTRUE),PrintLevel(3),Save());

Everything works well, and plots well. Now I want to get a function or a PDF that can give me the value of the background at any point along X for fitted value of course. The final goal is comparing the log-likelihood ration for NULL hypothesis with the FULL hypothesis.

How can I extract the background and the gauss functions from my fitted model ??


Please report Roofit questions to the “Stat and Math Tools” thread