First order RooPolynomial problem

RooRealVar p0(“p0”, “”, 0,-10000,10000);
RooPolynomial bkgo(“bkgo”, “bkgo”, mJpsi3686, RooArgList(p0),1);

RooRealVar nsig("nsig","nsig",10,0,330020);
RooRealVar notherbkg("notherbkg","notherbkg",10,0,300000);

RooAddPdf summJpsi3686("summJpsi3686", "summJpsi3686", RooArgList(conv1,bkgo), RooArgList(nsig,notherbkg));
cout<<"before fit"<<endl;
summJpsi3686.fitTo(realdata);
RooPlot* mJpsi3686frame = mJpsi3686.frame();

TCanvas *c1 = new TCanvas("c1","a canvas",0,0,800,1200);
c1 -> Divide(1,2);
////////////////////
c1 -> cd(2);
realdata.plotOn(mJpsi3686frame,Binning(50, 3.6, 3.8));// ->is fine , . gives warning but still works
summJpsi3686.plotOn(mJpsi3686frame,LineColor(4));//. is fine, -> gives warning but still works
summJpsi3686.plotOn(mJpsi3686frame,Components(conv1),LineStyle(4),LineColor(2), LineWidth(3));//. is fine, -> gives warning but still works
summJpsi3686.plotOn(mJpsi3686frame,Components(bkgo),LineStyle(2),LineColor(7), LineWidth(3));//. is fine, -> gives warning but still works
 mJpsi3686frame->SetAxisRange (3.6,3.8,"X");
mJpsi3686frame -> Draw();

I use a first order polynomial to describe the background, but it seems like when the polynomial becomes zero, the fitting figure would look really strange. What can I do to avoid this?

Thanks a lot!

image

May be @moneta can help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.