␛[1mRooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby␛[0m
Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt
[#1] INFO:ObjectHandling -- RooWorkspace::exportToCint(w) INFO: references to all objects in this workspace will be created in CINT in 'namespace w'
Bayesian Result using a Flat prior
0.9% CL central interval: [ 0.50606 - 6.89326 ] or 0.95% CL limits
Bayesian Result using a 1/sqrt(s) prior
0.9% CL central interval: [ 0.0746294 - 5.85425 ] or 0.95% CL limits
void rs701_BayesianCalculator(bool useBkg = true, double confLevel = 0.90)
{
w->
factory(
"SUM::pdf(s[0.001,15]*Uniform(x[0,1]),b[1,0,2]*Uniform(x))");
w->
factory(
"Gaussian::prior_b(b,1,1)");
w->
factory(
"PROD::model(pdf,prior_b)");
if (useBkg)
nuisPar = &nuisanceParameters;
double size = 1. - confLevel;
std::cout << "\nBayesian Result using a Flat prior " << std::endl;
BayesianCalculator bcalc(data, *model,
RooArgSet(*POI), *priorPOI, nuisPar);
bcalc.SetTestSize(size);
SimpleInterval *interval = bcalc.GetInterval();
double cl = bcalc.ConfidenceLevel();
std::cout << cl << "% CL central interval: [ " << interval->LowerLimit() << " - " << interval->UpperLimit()
<< " ] or " << cl + (1. - cl) / 2 << "% CL limits\n";
RooPlot *plot = bcalc.GetPosteriorPlot();
plot->Draw();
std::cout << "\nBayesian Result using a 1/sqrt(s) prior " << std::endl;
BayesianCalculator bcalc2(data, *model,
RooArgSet(*POI), *priorPOI2, nuisPar);
bcalc2.SetTestSize(size);
SimpleInterval *interval2 = bcalc2.GetInterval();
cl = bcalc2.ConfidenceLevel();
std::cout << cl << "% CL central interval: [ " << interval2->LowerLimit() << " - " << interval2->UpperLimit()
<< " ] or " << cl + (1. - cl) / 2 << "% CL limits\n";
RooPlot *plot2 = bcalc2.GetPosteriorPlot();
plot2->Draw();
}
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooDataSet is a container class to hold unbinned data.
static RooMsgService & instance()
Return reference to singleton instance.
void setGlobalKillBelow(RooFit::MsgLevel level)
A RooPlot is a plot frame and a container for graphics objects within that frame.
The RooWorkspace is a persistable container for RooFit projects.
RooRealVar * var(const char *name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found.
RooFactoryWSTool & factory()
Return instance to factory tool.
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
Template specialisation used in RooAbsArg:
Namespace for the RooStats classes.