46 using namespace RooFit;
47 using namespace RooStats;
54 const char* workspaceName =
"combined",
55 const char* modelConfigName =
"ModelConfig",
56 const char* dataName =
"obsData"){
67 filename =
"results/example_combined_GaussExample_model.root";
72 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
76 cout <<
"will run standard hist2workspace example"<<endl;
77 gROOT->ProcessLine(
".! prepareHistFactory .");
78 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
79 cout <<
"\n\n---------------------"<<endl;
80 cout <<
"Done creating example input"<<endl;
81 cout <<
"---------------------\n\n"<<endl;
93 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
106 cout <<
"workspace not found" << endl;
119 cout <<
"data or ModelConfig was not found" <<endl;
164 new TCanvas(
"IntervalPlot");
168 TCanvas*
c2 =
new TCanvas(
"extraPlots");
187 cout <<
"\n95% interval on " <<firstPOI->
GetName()<<
" is : ["<<
188 interval->LowerLimit(*firstPOI) <<
", "<<
189 interval->UpperLimit(*firstPOI) <<
"] "<<endl;
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
This class provides simple and straightforward utilities to plot a MCMCInterval object.
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
static const char * filename()
virtual void SetNumBurnInSteps(Int_t numBurnInSteps)
set the number of steps in the chain to discard as burn-in, starting from the first ...
void Draw(const Option_t *options=NULL)
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
Iterator abstract base class.
void setMax(const char *name, Double_t value)
Set maximum of name range to given value.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
RooAbsArg * first() const
void plot(TString fname="data.root", TString var0="var0", TString var1="var1")
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) ...
virtual void SetIntervalType(enum MCMCInterval::IntervalType intervalType)
set what type of interval to have the MCMCInterval represent
TIterator * createIterator(Bool_t dir=kIterForward) const
RooRealVar represents a fundamental (non-derived) real valued object.
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.
R__EXTERN TSystem * gSystem
Class implementing a proposal function that samples the parameter space by moving only in one coordin...
virtual const char * GetName() const
Returns name of object.
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual void SetProposalFunction(ProposalFunction &proposalFunction)
set the proposal function for suggesting new points for the MCMC
void DrawChainScatter(RooRealVar &xVar, RooRealVar &yVar)
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
void Print(Option_t *opts=0) const
Print contents of the workspace.
virtual TObject * Next()=0
virtual void SetLeftSideTailFraction(Double_t a)
Set the left side tail fraction.
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
void StandardBayesianMCMCDemo(const char *infile="", const char *workspaceName="combined", const char *modelConfigName="ModelConfig", const char *dataName="obsData")
Bayesian Calculator estimating an interval or a credible region using the Markov-Chain Monte Carlo me...
Int_t CeilNint(Double_t x)
The RooWorkspace is a persistable container for RooFit projects.