59void IntervalExamples()
71 wspace->
factory(
"Gaussian::normal(x[-10,10],mu[-1,1],sigma[1])");
78 modelConfig->
SetPdf(*wspace->
pdf(
"normal"));
91 double confidenceLevel = 0.95;
95 plc.SetConfidenceLevel(confidenceLevel);
100 fc.SetConfidenceLevel(confidenceLevel);
102 fc.UseAdaptiveSampling(
true);
106 fc.FluctuateNumDataEntries(
false);
112 wspace->
factory(
"Uniform::prior(mu)");
117 bc.SetConfidenceLevel(confidenceLevel);
122 mc.SetConfidenceLevel(confidenceLevel);
125 mc.SetNumBurnInSteps(500);
126 mc.SetNumIters(100000);
127 mc.SetLeftSideTailFraction(0.5);
137 std::cout <<
"expected interval is [" << expectedLL <<
", " << expectedUL <<
"]" << endl;
139 cout <<
"plc interval is [" << plInt->
LowerLimit(*mu) <<
", " << plInt->
UpperLimit(*mu) <<
"]" << endl;
141 std::cout <<
"fc interval is [" << interval->
LowerLimit(*mu) <<
" , " << interval->
UpperLimit(*mu) <<
"]" << endl;
143 cout <<
"bc interval is [" << bcInt->
LowerLimit() <<
", " << bcInt->
UpperLimit() <<
"]" << endl;
145 cout <<
"mc interval is [" << mcInt->
LowerLimit(*mu) <<
", " << mcInt->
UpperLimit(*mu) <<
"]" << endl;
151 gStyle->SetCanvasColor(0);
152 gStyle->SetCanvasBorderMode(0);
153 gStyle->SetPadBorderMode(0);
155 gStyle->SetCanvasColor(0);
156 gStyle->SetTitleFillColor(0);
158 gStyle->SetFrameFillColor(0);
185 RooPlot *bcPlot = bc.GetPosteriorPlot();
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&,...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
BayesianCalculator is a concrete implementation of IntervalCalculator, providing the computation of a...
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
This class provides simple and straightforward utilities to plot a LikelihoodInterval object.
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
double UpperLimit(const RooRealVar ¶m)
return the upper bound of the interval on a given parameter
double LowerLimit(const RooRealVar ¶m)
return the lower bound of the interval on a given parameter
bool IsInInterval(const RooArgSet &) const override
check if given point is in the interval
Bayesian Calculator estimating an interval or a credible region using the Markov-Chain Monte Carlo me...
This class provides simple and straightforward utilities to plot a MCMCInterval object.
void Draw(const Option_t *options=nullptr) override
void SetLineColor(TColorNumber color)
void SetLineWidth(Int_t width)
MCMCInterval is a concrete implementation of the RooStats::ConfInterval interface.
virtual double UpperLimit(RooRealVar ¶m)
get the highest value of param that is within the confidence interval
virtual double LowerLimit(RooRealVar ¶m)
get the lowest value of param that is within the confidence interval
void SetParametersOfInterest(const RooArgSet &set)
Specify parameters of interest.
void SetObservables(const RooArgSet &set)
Specify the observables.
void SetPriorPdf(const RooAbsPdf &pdf)
Set the Prior Pdf, add to the workspace if not already there.
void SetWorkspace(RooWorkspace &ws)
void SetPdf(const RooAbsPdf &pdf)
Set the Pdf, add to the workspace if not already there.
PointSetInterval is a concrete implementation of the ConfInterval interface.
double UpperLimit(RooRealVar ¶m)
return upper limit on a given parameter
double LowerLimit(RooRealVar ¶m)
return lower limit on a given parameter
The ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface cla...
SimpleInterval is a concrete implementation of the ConfInterval interface.
virtual double UpperLimit()
return the interval upper limit
virtual double LowerLimit()
return the interval lower limit
Persistable container for RooFit projects.
RooAbsPdf * pdf(RooStringView name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
const RooArgSet * set(RooStringView name)
Return pointer to previously defined named set with given nmame If no such set is found a null pointe...
RooFactoryWSTool & factory()
Return instance to factory tool.
RooRealVar * var(RooStringView name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found.
bool defineSet(const char *name, const RooArgSet &aset, bool importMissing=false)
Define a named RooArgSet with given constituents.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
void Update() override
Update canvas pad buffers.
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void Stop()
Stop the stopwatch.
void Print(Option_t *option="") const override
Print the real and cpu time passed between the start and stop events.
double normal_quantile(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the lower tail of the normal (Gaussian) distri...
double normal_quantile_c(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the upper tail of the normal (Gaussian) distri...
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
RooStats::ModelConfig ModelConfig
Namespace for the RooStats classes.