40 using namespace RooFit;
41 using namespace RooStats;
55 const char* workspaceName =
"combined",
56 const char* modelConfigName =
"ModelConfig",
57 const char* dataName =
"obsData") {
66 filename =
"results/example_combined_GaussExample_model.root";
71 cout <<
"HistFactory file cannot be generated on Windows - exit" << endl;
75 cout <<
"will run standard hist2workspace example"<<endl;
76 gROOT->ProcessLine(
".! prepareHistFactory .");
77 gROOT->ProcessLine(
".! hist2workspace config/example.xml");
78 cout <<
"\n\n---------------------"<<endl;
79 cout <<
"Done creating example input"<<endl;
80 cout <<
"---------------------\n\n"<<endl;
92 cout <<
"StandardRooStatsDemoMacro: Input file " << filename <<
" is not found" << endl;
104 cout <<
"workspace not found" << endl;
117 cout <<
"data or ModelConfig was not found" <<endl;
144 for (
int i = 0; i < nuisPar.getSize(); ++i) {
149 std::cout <<
"setting interval for nuisance " << v->
GetName() <<
" : [ " << v->
getMin() <<
" , " << v->
getMax() <<
" ]" << std::endl;
171 cout <<
"using TOYMC integration: make nuisance pdf from the model " << std::endl;
189 cout <<
"\n95% interval on " << poi->
GetName()<<
" is : ["<<
199 cout <<
"\nDrawing plot of posterior function....." << endl;
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
RooPlot * GetPosteriorPlot(bool norm=false, double precision=0.01) const
get the plot with option to get it normalized
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...
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
RooAbsPdf * MakeNuisancePdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name)
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
void SetScanOfPosterior(int nbin=100)
use directly the approximate posterior function obtained by binning it in nbins by default the cdf is...
RooCmdArg PrintLevel(Int_t code)
void SetIntegrationType(const char *type)
set the integration type (possible type are) :
static const char * filename()
virtual Double_t getMin(const char *name=0) const
Short_t Min(Short_t a, Short_t b)
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
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.
virtual SimpleInterval * GetInterval() const
compute the interval.
RooAbsArg * first() const
void plot(TString fname="data.root", TString var0="var0", TString var1="var1")
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
virtual void SetNumIters(Int_t numIters)
set the number of iterations when running a MC integration algorithm If not set use default algorithm...
virtual Double_t LowerLimit()
Double_t getVal(const RooArgSet *set=0) const
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.
void SetShortestInterval()
set the Bayesian calculator to compute the shorest interval (default is central interval) to switch o...
void SetLeftSideTailFraction(Double_t leftSideFraction)
set the fraction of probability content on the left tail Central limits use 0.5 (default case) for up...
R__EXTERN TSystem * gSystem
static const std::string & DefaultMinimizerType()
RooCmdArg Minimizer(const char *type, const char *alg=0)
void setMin(const char *name, Double_t value)
Set minimum of name range to given value.
static int DefaultPrintLevel()
virtual const char * GetName() const
Returns name of object.
RooAbsData is the common abstract base class for binned and unbinned datasets.
void StandardBayesianNumericalDemo(const char *infile="", const char *workspaceName="combined", const char *modelConfigName="ModelConfig", const char *dataName="obsData")
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
RooCmdArg Hesse(Bool_t flag=kTRUE)
virtual void SetPriorPdf(const RooAbsPdf &pdf)
Set the Prior Pdf, add to the the workspace if not already there.
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
virtual Double_t getMax(const char *name=0) const
RooCmdArg Save(Bool_t flag=kTRUE)
virtual Double_t UpperLimit()
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Bool_t import(const RooAbsArg &arg, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Import a RooAbsArg object, e.g.
Short_t Max(Short_t a, Short_t b)
void Print(Option_t *opts=0) const
Print contents of the workspace.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual RooFitResult * fitTo(RooAbsData &data, 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())
Fit PDF to given dataset.
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
void ForceNuisancePdf(RooAbsPdf &pdf)
force the nuisance pdf when using the toy mc sampling
BayesianCalculator is a concrete implementation of IntervalCalculator, providing the computation of a...
The RooWorkspace is a persistable container for RooFit projects.
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
Double_t getError() const