31void rf204a_extendedLikelihood()
42 RooRealVar mean(
"mean",
"mean of gaussians",5) ;
43 RooRealVar sigma1(
"sigma1",
"width of gaussians",0.5) ;
44 RooRealVar sigma2(
"sigma2",
"width of gaussians",1) ;
46 RooGaussian sig1(
"sig1",
"Signal component 1",
x,mean,sigma1) ;
47 RooGaussian sig2(
"sig2",
"Signal component 2",
x,mean,sigma2) ;
55 RooRealVar sig1frac(
"sig1frac",
"fraction of component 1 in signal",0.8,0.,1.) ;
64 x.setRange(
"signalRange",4,6) ;
67 RooRealVar nsig(
"nsig",
"number of signal events in signalRange",500,0.,10000) ;
68 RooRealVar nbkg(
"nbkg",
"number of background events in signalRange",500,0,10000) ;
79 std::unique_ptr<RooDataSet> data{model.generate(
x,1000)};
83 auto canv =
new TCanvas(
"Canvas",
"Canvas", 1500, 600);
98 std::unique_ptr<RooFitResult>
r{model1.fitTo(*data,
Save(),
PrintLevel(-1))};
104 model1.plotOn(frame);
105 model1.paramOn(frame);
113 x.setRange(
"left", 0., 4.);
114 x.setRange(
"right", 6., 10.);
117 std::unique_ptr<RooFitResult> r2{model2.fitTo(*data,
Range(
"left,right"),
Save(),
PrintLevel(-1))};
121 RooPlot * frame2 =
x.frame(
Title(
"Fit in left/right sideband"));
122 data->plotOn(frame2);
124 model2.plotOn(frame2);
125 model2.paramOn(frame2);
135 x.setRange(
"leftToMiddle", 0., 5.);
138 std::unique_ptr<RooFitResult> r3{model3.fitTo(*data,
Range(
"leftToMiddle"),
Save(),
PrintLevel(-1))};
142 RooPlot * frame3 =
x.frame(
Title(
"Fit from left to middle"));
143 data->plotOn(frame3);
145 model3.plotOn(frame3);
146 model3.paramOn(frame3);
Efficient implementation of a sum of PDFs of the form.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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.
RooCmdArg Title(const char *name)
RooCmdArg Save(bool flag=true)
RooCmdArg PrintLevel(Int_t code)
RooCmdArg VisualizeError(const RooDataSet ¶mData, double Z=1)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...