void rf608_fitresultaspdf()
{
RooRealVar mean(
"mean",
"mean of g1 and g2", 0, -1, 1);
RooRealVar sigma_g1(
"sigma_g1",
"width of g1", 2);
RooRealVar sigma_g2(
"sigma_g2",
"width of g2", 4, 3.0, 5.0);
std::unique_ptr<RooDataSet> data{model.generate(
x, 1000)};
std::unique_ptr<RooFitResult>
r{model.fitTo(*data,
Save(),
PrintLevel(-1))};
std::unique_ptr<RooDataSet>
d{parabPdf->
generate({mean, sigma_g2, frac}, 100000)};
new TCanvas(
"rf608_fitresultaspdf_1",
"rf608_fitresultaspdf_1", 600, 600);
TCanvas *
c2 =
new TCanvas(
"rf608_fitresultaspdf_2",
"rf608_fitresultaspdf_2", 900, 600);
gPad->SetLeftMargin(0.15);
hh_mean_sigmag2->
Draw(
"surf3");
gPad->SetLeftMargin(0.15);
hh_sigmag2_frac->
Draw(
"surf3");
gPad->SetLeftMargin(0.15);
hh_mean_frac->
Draw(
"surf3");
gPad->SetLeftMargin(0.15);
gPad->SetLeftMargin(0.15);
gPad->SetLeftMargin(0.15);
}
Abstract interface for all probability density functions.
RooFit::OwningPtr< RooDataSet > generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={})
See RooAbsPdf::generate(const RooArgSet&,const RooCmdArg&,const RooCmdArg&,const RooCmdArg&,...
virtual RooAbsPdf * createProjection(const RooArgSet &iset)
Return a p.d.f that represent a projection of this p.d.f integrated over given observables.
TH1 * createHistogram(RooStringView varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const
Create and fill a ROOT histogram TH1, TH2 or TH3 with the values of this function for the variables w...
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.
Variable that can be changed from the outside.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
TH1 is the base class of all histogram classes in ROOT.
void Draw(Option_t *option="") override
Draw this histogram with options.
Service class for 2-D histogram classes.
The 3-D histogram classes derived from the 1-D histogram classes.
RooCmdArg Save(bool flag=true)
RooCmdArg PrintLevel(Int_t code)
RooCmdArg Binning(const RooAbsBinning &binning)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
[#0] WARNING:InputArguments -- The parameter 'sigma_g1' with range [-inf, inf] of the RooGaussian 'g1' exceeds the safe range of (0, inf). Advise to limit its range.
[#1] INFO:Fitting -- RooAbsPdf::fitTo(model) fixing normalization set for coefficient determination to observables in data
[#1] INFO:Fitting -- using generic CPU library compiled with no vectorizations
[#1] INFO:Fitting -- Creation of NLL object took 15.1148 ms
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_model_modelData) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: activating const optimization
[#1] INFO:Minimization -- [fitFCN] No discrete parameters, performing continuous minimization only
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: deactivating const optimization