Multidimensional models: working with parametrized ranges in a fit.
This an example of a fit with an acceptance that changes per-event
pdf = exp(-t/tau)
with t[tmin,5]
where t
and tmin
are both observables in the dataset
{
t.setRange(tmin, RooConst(t.getMax()));
std::unique_ptr<RooDataSet> dall{model.generate(t, 10000)};
std::unique_ptr<RooDataSet> tmp{
RooGaussian(
"gmin",
"gmin", tmin, 0.0, 0.5).
generate(tmin, 5000)};
std::unique_ptr<RooDataSet> dacc{model.generate(t,
ProtoData(*tmp))};
std::unique_ptr<RooFitResult>
r{model.fitTo(*dacc,
Save(),
PrintLevel(-1))};
model.plotOn(frame);
dacc->plotOn(frame);
new TCanvas(
"rf314_paramranges",
"rf314_paramranges", 600, 600);
gPad->SetLeftMargin(0.15);
return;
}
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< 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&,...
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.
RooCmdArg Save(bool flag=true)
RooCmdArg PrintLevel(Int_t code)
RooCmdArg ProtoData(const RooDataSet &protoData, bool randomizeOrder=false, bool resample=false)
RooCmdArg MarkerColor(Color_t color)
RooCmdArg LineColor(Color_t color)
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
[#1] INFO:Plotting -- RooPlot::updateFitRangeNorm: New event count of 5000 will supersede previous event count of 10000 for normalization of PDF projections
RooFitResult: minimized FCN value: 2823.97, estimated distance to minimum: 3.17108e-08
covariance matrix quality: Full, accurate covariance matrix
Status : MINIMIZE=0 HESSE=0
Floating Parameter InitialValue FinalValue +/- Error GblCorr.
-------------------- ------------ -------------------------- --------
tau -1.5400e+00 -1.5335e+00 +/- 2.22e-02 <none>
- Date
- July 2008
- Author
- Wouter Verkerke
Definition in file rf314_paramfitrange.C.