32 RooRealVar mean(
"mean",
"mean of gaussians", 5);
33 RooRealVar sigma1(
"sigma1",
"width of gaussians", 0.5);
34 RooRealVar sigma2(
"sigma2",
"width of gaussians", 1);
36 RooGaussian sig1(
"sig1",
"Signal component 1",
x, mean, sigma1);
37 RooGaussian sig2(
"sig2",
"Signal component 2",
x, mean, sigma2);
45 RooRealVar sig1frac(
"sig1frac",
"fraction of component 1 in signal", 0.8, 0., 1.);
49 RooRealVar bkgfrac(
"bkgfrac",
"fraction of background", 0.5, 0., 1.);
55 std::unique_ptr<RooDataSet>
d{model.generate(
x, 10000)};
56 std::unique_ptr<RooDataHist> dh{
d->binnedClone()};
71 std::unique_ptr<RooAbsData> dsmall{
d->reduce(
EventRange(1, 100))};
73 std::unique_ptr<RooAbsReal> chi2_lowstat{model.createChi2(*dhsmall)};
74 cout << chi2_lowstat->getVal() << endl;
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.
Container class to hold unbinned data.
RooFit::OwningPtr< RooDataHist > binnedClone(const char *newName=nullptr, const char *newTitle=nullptr) const
Return binned clone of this dataset.
Variable that can be changed from the outside.
RooCmdArg EventRange(Int_t nStart, Int_t nStop)
RooCmdArg PrintLevel(Int_t code)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...