168 void FourBinInstructional(
bool doBayesian=
false,
bool doFeldmanCousins=
false,
bool doMCMC=
false){
179 wspace->
factory(
"Poisson::on(non[0,1000], sum::splusb(s[40,0,100],b[100,0,300]))");
180 wspace->
factory(
"Poisson::off(noff[0,5000], prod::taub(b,tau[5,3,7],rho[1,0,2]))");
181 wspace->
factory(
"Poisson::onbar(nonbar[0,10000], bbar[1000,500,2000])");
182 wspace->
factory(
"Poisson::offbar(noffbar[0,1000000], prod::lambdaoffbar(bbar, tau))");
183 wspace->
factory(
"Gaussian::mcCons(rhonom[1.,0,2], rho, sigma[.2])");
184 wspace->
factory(
"PROD::model(on,off,onbar,offbar,mcCons)");
185 wspace->
defineSet(
"obs",
"non,noff,nonbar,noffbar,rhonom");
187 wspace->
factory(
"Uniform::prior_poi({s})");
188 wspace->
factory(
"Uniform::prior_nuis({b,bbar,tau, rho})");
189 wspace->
factory(
"PROD::prior(prior_poi,prior_nuis)");
196 wspace->
defineSet(
"nuis",
"b,tau,rho,bbar");
223 modelConfig->
SetPdf(*wspace->
pdf(
"model"));
227 wspace->
import(*modelConfig);
236 plc.SetConfidenceLevel(0.95);
245 fc.SetConfidenceLevel(0.95);
247 fc.FluctuateNumDataEntries(
false);
248 fc.UseAdaptiveSampling(
true);
251 if(doFeldmanCousins){
258 bc.SetConfidenceLevel(0.95);
260 if(doBayesian && wspace->
set(
"poi")->
getSize() == 1) {
261 bInt = bc.GetInterval();
263 cout <<
"Bayesian Calc. only supports on parameter of interest" << endl;
279 mc.SetConfidenceLevel(0.95);
280 mc.SetProposalFunction(*pf);
281 mc.SetNumBurnInSteps(500);
282 mc.SetNumIters(50000);
283 mc.SetLeftSideTailFraction(0.5);
286 mcInt = mc.GetInterval();
294 if(doBayesian && doMCMC){
298 else if (doBayesian || doMCMC){
306 if(doBayesian && wspace->
set(
"poi")->
getSize() == 1) {
310 bc.SetScanOfPosterior(20);
311 RooPlot* bplot = bc.GetPosteriorPlot();
316 if(doBayesian && wspace->
set(
"poi")->
getSize() == 1)
326 cout <<
"Profile Likelihood interval on s = [" <<
332 if(doBayesian && wspace->
set(
"poi")->
getSize() == 1) {
333 cout <<
"Bayesian interval on s = [" <<
338 if(doFeldmanCousins){
339 cout <<
"Feldman Cousins interval on s = [" <<
346 cout <<
"MCMC interval on s = [" <<
ProposalFunction is an interface for all proposal functions that would be used with a Markov Chain Mo...
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
const RooArgList & floatParsFinal() const
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 Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
virtual void SetWorkspace(RooWorkspace &ws)
const TMatrixDSym & covarianceMatrix() const
Return covariance matrix.
virtual ProposalFunction * GetProposalFunction()
virtual void SetUpdateProposalParameters(Bool_t updateParams)
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
This class provides simple and straightforward utilities to plot a LikelihoodInterval object...
RooFit::MsgLevel globalKillBelow() const
ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface class f...
static RooMsgService & instance()
Return reference to singleton instance.
Double_t LowerLimit(const RooRealVar ¶m)
return the lower bound of the interval on a given parameter
static struct mg_connection * fc(struct mg_context *ctx)
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
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()
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 SetNuisanceParameters(const RooArgSet &set)
specify the nuisance parameters (e.g. the rest of the parameters)
virtual void SetCacheSize(Int_t size)
Bool_t defineSet(const char *name, const RooArgSet &aset, Bool_t importMissing=kFALSE)
Define a named RooArgSet with given constituents.
void setGlobalKillBelow(RooFit::MsgLevel level)
Bool_t writeToFile(const char *fileName, Bool_t recreate=kTRUE)
Save this current workspace into given file.
virtual Double_t UpperLimit(RooRealVar ¶m)
get the highest value of param that is within the confidence interval
RooDataSet is a container class to hold unbinned data.
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...
Namespace for the RooStats classes.
PointSetInterval is a concrete implementation of the ConfInterval interface.
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
virtual Double_t LowerLimit(RooRealVar ¶m)
get the lowest value of param that is within the confidence interval
virtual void SetPriorPdf(const RooAbsPdf &pdf)
Set the Prior Pdf, add to the the workspace if not already there.
virtual void SetCovMatrix(const TMatrixDSym &covMatrix)
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.
RooCmdArg Save(Bool_t flag=kTRUE)
virtual Double_t UpperLimit()
SimpleInterval is a concrete implementation of the ConfInterval interface.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
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.
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 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.
virtual void SetParametersOfInterest(const RooArgSet &set)
MCMCInterval is a concrete implementation of the RooStats::ConfInterval interface.
virtual void SetVariables(RooArgList &vars)
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.
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.