god day …
i am excuting this code, and when it finishied it is supposed to plot a PDF of some variable(cos_theta) with its components
but i always have a wired looking line in the Canvas at the biginnig of the range(wich is not a part of my distribution)
i think it is the RooAddPdf who causes this problem??
thank you for your help!.
using namespace RooFit;
int angle(){
RooRealVar *cos_theta = new RooRealVar(“cos_theta”,“cos_theta”,-1.,1.);
RooRealVar *Rt = new RooRealVar(“Rt”,“Rt”,0.2,0.,1.);
RooRealVar *a = new RooRealVar(“a”,“a”,0,-2.,2.);
RooAbsPdf* Pdftheta_odd = new RooGenericPdf(“Pdftheta_odd”,“Pdftheta_odd”," 1 - cos_theta2 " ,cos_theta);
RooAbsPdf Pdftheta_even = new RooGenericPdf(“Pdftheta_even”,“Pdftheta_even”," ( 1 + cos_theta2 )/2",cos_theta);
RooAbsPdf bkg_ang = new RooGenericPdf(“bkg_ang”,“bkg_ang”,“1 + a*cos_theta**2”,RooArgList(*a,*cos_theta));
RooAbsReal *B_S_fitt = new RooRealVar(“B_S_fitt”,“B_S_fitt”,0.26,0.,10.);
RooAbsPdf *pdf_sig_mix_ang = new RooAddPdf(“pdf_sig_mix_ang”,“pdf_sig_mix_ang”,*Pdftheta_odd,*Pdftheta_even,*Rt);
RooAbsPdf *pdf_sig_mix_ang_bkg = new RooAddPdf(“pdf_sig_mix_ang_bkg”,“pdf_sig_mix_ang_bkg”,*bkg_ang,*pdf_sig_mix_ang,*B_S_fitt);
RooDataSet *data = pdf_sig_mix_ang_bkg->generate(*cos_theta,78363);
RooPlot *cadre1 = cos_theta->frame();
pdf_sig_mix_ang_bkg->plotOn(cadre1);
pdf_sig_mix_ang_bkg->plotOn(cadre1,Components(“Pdftheta_odd”),LineColor(kBlack));
pdf_sig_mix_ang_bkg->plotOn(cadre1,Components(“Pdftheta_even”),LineStyle(kDotted),LineColor(kBlack));
pdf_sig_mix_ang_bkg->plotOn(cadre1,Components(“bkg_ang”),LineStyle(kDashed),LineColor(kBlack));
cadre1->Draw();
return 0 ;
}