void rf205_compplot()
{
RooRealVar sigma1(
"sigma1",
"width of gaussians", 0.5);
RooRealVar sigma2(
"sigma2",
"width of gaussians", 1);
RooGaussian sig1(
"sig1",
"Signal component 1",
x, mean, sigma1);
RooGaussian sig2(
"sig2",
"Signal component 2",
x, mean, sigma2);
RooRealVar sig1frac(
"sig1frac",
"fraction of component 1 in signal", 0.8, 0., 1.);
RooAddPdf sig(
"sig",
"Signal", {sig1, sig2}, sig1frac);
RooRealVar bkg1frac(
"bkg1frac",
"fraction of component 1 in background", 0.8, 0., 1.);
RooAddPdf bkg(
"bkg",
"Total background", {bkg1, bkg2}, bkg1frac);
RooRealVar bkgfrac(
"bkgfrac",
"fraction of background", 0.5, 0., 1.);
RooAddPdf model(
"model",
"g1+g2+a", {bkg, sig}, bkgfrac);
std::unique_ptr<RooDataSet> data{model.generate(
x, 1000)};
data->plotOn(xframe);
model.plotOn(xframe);
gPad->SetLeftMargin(0.15);
xframe->GetYaxis()->SetTitleOffset(1.4);
xframe->Draw();
gPad->SetLeftMargin(0.15);
}
Efficient implementation of a sum of PDFs of the form.
Chebychev polynomial p.d.f.
Plot frame and a container for graphics objects within that frame.
void Draw(Option_t *options=nullptr) override
Draw this plot and all of the elements it contains.
Variable that can be changed from the outside.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
RooCmdArg Title(const char *name)
RooCmdArg Components(Args_t &&... argsOrArgSet)
RooCmdArg LineColor(TColorNumber color)
RooCmdArg Invisible(bool inv=true)
RooCmdArg LineStyle(Style_t style)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
[#0] WARNING:InputArguments -- The parameter 'sigma1' with range [-inf, inf] of the RooGaussian 'sig1' exceeds the safe range of (0, inf). Advise to limit its range.
[#0] WARNING:InputArguments -- The parameter 'sigma2' with range [-inf, inf] of the RooGaussian 'sig2' exceeds the safe range of (0, inf). Advise to limit its range.
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) directly selected PDF components: (bkg)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) indirectly selected PDF components: (bkg1,bkg2)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) directly selected PDF components: (bkg2)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) indirectly selected PDF components: (bkg)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) directly selected PDF components: (bkg,sig2)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) indirectly selected PDF components: (bkg1,bkg2,sig)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) directly selected PDF components: (bkg)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) indirectly selected PDF components: (bkg1,bkg2)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) directly selected PDF components: (bkg1,sig2)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) indirectly selected PDF components: (bkg,sig)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) directly selected PDF components: (sig,sig1,sig2)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) indirectly selected PDF components: ()
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) directly selected PDF components: (bkg1,sig,sig1,sig2)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(model) indirectly selected PDF components: (bkg)