69 RooRealVar alpha(
"alpha",
"alpha", -0.04, -0.1, -0.0);
73 x.setRange(
"LEFT",10,20);
74 x.setRange(
"RIGHT",60,100);
76 x.setRange(
"FULL",10,100);
78 std::unique_ptr<RooDataSet>
data{model.generate(
x, 10000)};
95 RooExtendPdf extmodel(
"extmodel",
"Extended model", model,
N,
"FULL");
126 model.paramOn(frame,
Label(
"Non-extended fit"));
134 data->plotOn(frame2);
135 extmodel.plotOn(frame2);
137 extmodel.paramOn(frame2,
Label(
"Extended fit"),
Layout(0.4,0.95));
151 RooRealVar Nsig(
"Nsig",
"Number of signal events", 1000, 0, 2000);
152 RooRealVar Nbkg(
"Nbkg",
"Number of background events", 10000, 0, 20000);
154 RooRealVar mean(
"mean",
"Mean of signal model", 40.);
158 RooAddPdf modelsum(
"modelsum",
"NSig*signal + NBkg*background", {sig, model}, {Nsig, Nbkg});
172 data->plotOn(frame3);
173 modelsum.plotOn(frame3);
175 modelsum.paramOn(frame3,
Label(
"S+B fit with RooAddPdf"),
Layout(0.3,0.95));
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
RooFit::OwningPtr< RooFitResult > fitTo(RooAbsData &data, CmdArgs_t const &... cmdArgs)
Fit PDF to given dataset.
Efficient implementation of a sum of PDFs of the form.
RooExtendPdf is a wrapper around an existing PDF that adds a parameteric extended likelihood term to ...
Plot frame and a container for graphics objects within that frame.
static RooPlot * frame(const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins)
Create a new frame for a given variable in x.
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.
RooCmdArg Layout(double xmin, double xmax=0.99, double ymin=0.95)
RooCmdArg Save(bool flag=true)
RooCmdArg PrintLevel(Int_t code)
RooCmdArg VisualizeError(const RooDataSet ¶mData, double Z=1)
const Rcpp::internal::NamedPlaceHolder & Label
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...