56 using namespace RooFit ;
57 using namespace RooStats ;
73 wspace->
factory(
"Gaussian::normal(x[-10,10],mu[-1,1],sigma[1])");
80 modelConfig->
SetPdf( *wspace->
pdf(
"normal") );
121 wspace->
factory(
"Uniform::prior(mu)");
140 double expectedLL = data->
mean(*x)
143 double expectedUL = data->
mean(*x)
148 std::cout <<
"expected interval is [" <<
149 expectedLL <<
", " <<
150 expectedUL <<
"]" << endl;
152 cout <<
"plc interval is [" <<
156 std::cout <<
"fc interval is ["<<
160 cout <<
"bc interval is [" <<
164 cout <<
"mc interval is [" <<
165 mcInt->LowerLimit(*mu) <<
", " <<
166 mcInt->UpperLimit(*mu) <<
"]" << endl;
169 cout <<
"is mu=0 in the interval? " <<
186 TCanvas* canvas =
new TCanvas(
"canvas");
double normal_quantile(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the lower tail of the normal (Gaussian) distri...
RooPlot * GetPosteriorPlot(bool norm=false, double precision=0.01) const
get the plot with option to get it normalized
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void Draw(const Option_t *options=0)
draw the likelihood interval or contour for the 1D case a RooPlot is drawn by default of the profiled...
This class provides simple and straightforward utilities to plot a MCMCInterval object.
void SetStatColor(Color_t color=19)
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
virtual void SetWorkspace(RooWorkspace &ws)
double normal_quantile_c(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the upper tail of the normal (Gaussian) distri...
R__EXTERN TStyle * gStyle
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
This class provides simple and straightforward utilities to plot a LikelihoodInterval object...
ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface class f...
virtual void SetNumBurnInSteps(Int_t numBurnInSteps)
set the number of steps in the chain to discard as burn-in, starting from the first ...
virtual void SetNumBins(Int_t numBins)
set the number of bins to create for each axis when constructing the interval
void Draw(const Option_t *options=NULL)
virtual void SetObservables(const RooArgSet &set)
specify the observables
virtual void SetSeed(UInt_t seed=0)
Set the random generator seed.
Double_t LowerLimit(const RooRealVar ¶m)
return the lower bound of the interval on a given parameter
void SetCanvasColor(Color_t color=19)
virtual LikelihoodInterval * GetInterval() const
Return a likelihood interval.
virtual SimpleInterval * GetInterval() const
compute the interval.
void plot(TString fname="data.root", TString var0="var0", TString var1="var1")
static struct mg_connection * fc(struct mg_context *ctx)
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) ...
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) ...
void Stop()
Stop the stopwatch.
void SetFrameFillColor(Color_t color=1)
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
virtual void SetPdf(const RooAbsPdf &pdf)
Set the Pdf, add to the the workspace if not already there.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
virtual Double_t LowerLimit()
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Plot dataset on specified frame.
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) ...
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
Double_t LowerLimit(RooRealVar ¶m)
return lower limit on a given parameter
Double_t UpperLimit(const RooRealVar ¶m)
return the upper bound of the interval on a given parameter
virtual void SetNumIters(Int_t numIters)
set the number of iterations to run the metropolis algorithm
virtual MCMCInterval * GetInterval() const
Main interface to get a ConfInterval.
void SetPadBorderMode(Int_t mode=1)
void SetCanvasBorderMode(Int_t mode=1)
Double_t mean(RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
void SetPadColor(Color_t color=19)
virtual void SetFillColor(Color_t fcolor)
void SetNBins(Int_t bins)
virtual RooPlot * statOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none())
Add a box with statistics information to the specified frame.
Bool_t defineSet(const char *name, const RooArgSet &aset, Bool_t importMissing=kFALSE)
Define a named RooArgSet with given constituents.
virtual Int_t numEntries() const
void FluctuateNumDataEntries(bool flag=true)
void SetLineColor(Color_t color)
void SetLineWidth(Int_t width)
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
RooDataSet is a container class to hold unbinned data.
RooRealVar * var(const char *name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found...
Double_t UpperLimit(RooRealVar ¶m)
return upper limit on a given parameter
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
PointSetInterval is a concrete implementation of the ConfInterval interface.
virtual Bool_t IsInInterval(const RooArgSet &) const
check if given point is in the interval
virtual void SetPriorPdf(const RooAbsPdf &pdf)
Set the Prior Pdf, add to the the workspace if not already there.
virtual PointSetInterval * GetInterval() const
Main interface to get a ConfInterval (will be a PointSetInterval)
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) ...
RooFactoryWSTool & factory()
Return instance to factory tool.
virtual Double_t UpperLimit()
void SetTitleFillColor(Color_t color=1)
RooDataSet * generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none())
Generate a new dataset containing the specified variables with events sampled from our distribution...
const RooArgSet * set(const char *name)
Return pointer to previously defined named set with given nmame If no such set is found a null pointe...
virtual void SetLeftSideTailFraction(Double_t a)
Set the left side tail fraction.
virtual void SetParametersOfInterest(const RooArgSet &set)
Bayesian Calculator estimating an interval or a credible region using the Markov-Chain Monte Carlo me...
BayesianCalculator is a concrete implementation of IntervalCalculator, providing the computation of a...
The RooWorkspace is a persistable container for RooFit projects.
void UseAdaptiveSampling(bool flag=true)
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.