Basic functionality: fitting, plotting, toy data generation on one-dimensional PDFs.
pdf = gauss(x,m,s)
{
RooRealVar mean(
"mean",
"mean of gaussian", 1, -10, 10);
gauss.plotOn(xframe);
gauss.plotOn(xframe, LineColor(
kRed));
std::unique_ptr<RooDataSet>
data{gauss.generate(
x, 10000)};
gauss.plotOn(xframe2);
gauss.fitTo(*
data, PrintLevel(-1));
mean.Print();
TCanvas *
c =
new TCanvas(
"rf101_basics",
"rf101_basics", 800, 400);
c->Divide(2);
gPad->SetLeftMargin(0.15);
gPad->SetLeftMargin(0.15);
}
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
A RooPlot is a 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.
RooRealVar represents a variable that can be changed from the outside.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: activating const optimization
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: deactivating const optimization
RooRealVar::mean = 1.01746 +/- 0.0300144 L(-10 - 10)
RooRealVar::sigma = 2.9787 +/- 0.0219217 L(0.1 - 10)
- Date
- July 2008
- Author
- Wouter Verkerke
Definition in file rf101_basics.C.