91 BinCountTestStat(
void) : fColumnName(
"tmp") {}
92 BinCountTestStat(
string columnName) : fColumnName(columnName) {}
102 virtual const TString GetVarName()
const {
return fColumnName; }
116 void HybridInstructional() {
147 w->
factory(
"Poisson::px(x[150,0,500],sum::splusb(s[0,0,100],b[100,0,300]))");
148 w->
factory(
"Poisson::py(y[100,0,500],prod::taub(tau[1.],b))");
149 w->
factory(
"PROD::model(px,py)");
150 w->
factory(
"Uniform::prior_b(b)");
176 w->
factory(
"PROJ::averagedModel(PROD::foo(px|b,py,prior_b),b)") ;
198 cout <<
"-----------------------------------------"<<endl;
199 cout <<
"Part 2" << endl;
200 cout <<
"Hybrid p-value from direct integration = " << 1-cdf->
getVal() << endl;
201 cout <<
"Z_Gamma Significance = " <<
214 cout <<
"-----------------------------------------"<<endl;
215 cout <<
"Part 3" << endl;
216 std::cout <<
"Z_Bi p-value (analytic): " << p_Bi << std::endl;
217 std::cout <<
"Z_Bi significance (analytic): " << Z_Bi << std::endl;
243 data->
add(*w->
set(
"obs"));
249 b_model.SetPdf(*w->
pdf(
"px"));
250 b_model.SetObservables(*w->
set(
"obs"));
251 b_model.SetParametersOfInterest(*w->
set(
"poi"));
253 b_model.SetSnapshot(*w->
set(
"poi"));
257 sb_model.SetPdf(*w->
pdf(
"px"));
258 sb_model.SetObservables(*w->
set(
"obs"));
259 sb_model.SetParametersOfInterest(*w->
set(
"poi"));
261 sb_model.SetSnapshot(*w->
set(
"poi"));
272 BinCountTestStat binCount(
"x");
294 w->
factory(
"Gaussian::gauss_prior(b,y, expr::sqrty('sqrt(y)',y))");
298 w->
factory(
"Lognormal::lognorm_prior(b,y, expr::kappa('1+1./sqrt(y)',y))");
320 hc1.SetToys(20000,1000);
321 hc1.ForcePriorNuisanceAlt(*w->
pdf(
"py"));
322 hc1.ForcePriorNuisanceNull(*w->
pdf(
"py"));
344 cout <<
"-----------------------------------------"<<endl;
345 cout <<
"Part 4" << endl;
363 slrts.SetAltParameters(*sb_model.GetSnapshot());
370 hc2.SetToys(20000,1000);
371 hc2.ForcePriorNuisanceAlt(*w->
pdf(
"py"));
372 hc2.ForcePriorNuisanceNull(*w->
pdf(
"py"));
391 cout <<
"-----------------------------------------"<<endl;
392 cout <<
"Part 5" << endl;
420 dataXY->
add(*w->
set(
"obsXY"));
424 b_modelXY.SetPdf(*w->
pdf(
"model"));
425 b_modelXY.SetObservables(*w->
set(
"obsXY"));
426 b_modelXY.SetParametersOfInterest(*w->
set(
"poi"));
428 b_modelXY.SetSnapshot(*w->
set(
"poi"));
432 sb_modelXY.SetPdf(*w->
pdf(
"model"));
433 sb_modelXY.SetObservables(*w->
set(
"obsXY"));
434 sb_modelXY.SetParametersOfInterest(*w->
set(
"poi"));
436 sb_modelXY.SetSnapshot(*w->
set(
"poi"));
451 ropl(*b_modelXY.GetPdf(), *sb_modelXY.GetPdf(), sb_modelXY.GetSnapshot());
468 w->
factory(
"Gamma::gamma_y0(b,sum::temp0(y0,1),1,0)");
469 w->
factory(
"Gaussian::gauss_prior_y0(b,y0, expr::sqrty0('sqrt(y0)',y0))");
477 hc3.SetToys(30000,1000);
478 hc3.ForcePriorNuisanceAlt(*w->
pdf(
"gamma_y0"));
479 hc3.ForcePriorNuisanceNull(*w->
pdf(
"gamma_y0"));
498 cout <<
"-----------------------------------------"<<endl;
499 cout <<
"Part 6" << endl;
Holds configuration options for proof and proof-lite.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
virtual void SetLogy(Int_t value=1)=0
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
static double p3(double t, double a, double b, double c, double d)
virtual TVirtualPad * GetPad(Int_t subpadnumber) const
Get a pointer to subpadnumber of this pad.
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
RooCmdArg LineColor(Color_t color)
virtual const RooArgSet * get() const
void Print(const Option_t *="") const
Print out some information about the results Note: use Alt/Null labels for the hypotheses here as the...
Double_t getVal(const RooArgSet *set=0) const
Double_t PValueToSignificance(Double_t pvalue)
returns one-sided significance corresponding to a p-value
HypoTestResult is a base class for results from hypothesis tests.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
RooFit::MsgLevel globalKillBelow() const
virtual void SetNEventsPerToy(const Int_t nevents)
This class provides the plots for the result of a study performed with any of the HypoTestCalculatorG...
static RooMsgService & instance()
Return reference to singleton instance.
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 RooCmdArg &arg9=RooCmdArg::none(), const RooCmdArg &arg10=RooCmdArg::none()) const
Plot (project) PDF on specified frame.
Double_t BinomialWithTauObsP(Double_t nObs, Double_t bExp, Double_t tau)
RooAbsReal * createCdf(const RooArgSet &iset, const RooArgSet &nset=RooArgSet())
Create a cumulative distribution function of this p.d.f in terms of the observables listed in iset...
virtual void SetTestStatistic(TestStatistic *testStatistic, unsigned int i)
RooCmdArg Range(const char *rangeName, Bool_t adjustNorm=kTRUE)
void Stop()
Stop the stopwatch.
#define ClassDef(name, id)
void SetNullParameters(const RooArgSet &nullParameters)
static double p2(double t, double a, double b, double c)
void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
Double_t BinomialWithTauObsZ(Double_t nObs, Double_t bExp, Double_t tau)
virtual void setVal(Double_t value)
Set value of variable to 'value'.
Bool_t defineSet(const char *name, const RooArgSet &aset, Bool_t importMissing=kFALSE)
Define a named RooArgSet with given constituents.
void SetProofConfig(ProofConfig *pc=NULL)
void setGlobalKillBelow(RooFit::MsgLevel level)
void SetSubtractMLE(bool subtract)
RooAbsData is the common abstract base class for binned and unbinned datasets.
static double p1(double t, double a, double b)
ProfileLikelihoodTestStat is an implementation of the TestStatistic interface that calculates the pro...
ToyMCSampler is an implementation of the TestStatSampler interface.
RooDataSet is a container class to hold unbinned data.
TestStatistic that returns the ratio of profiled likelihoods.
Same purpose as HybridCalculatorOriginal, but different implementation.
virtual void add(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0)
Add a data point, with its coordinates specified in the 'data' argset, to the data set...
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
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
Namespace for the RooStats classes.
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
TestStatistic class that returns -log(L[null] / L[alt]) where L is the likelihood.
RooRealVar * var(const char *name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found...
MaxLikelihoodEstimateTestStat: TestStatistic that returns maximum likelihood estimate of a specified ...
RooFactoryWSTool & factory()
Return instance to factory tool.
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.
Double_t getRealValue(const char *name, Double_t defVal=0, Bool_t verbose=kFALSE) const
Get value of a RooAbsReal stored in set with given name.
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...
static constexpr double pc
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save Pad contents in a file in one of various formats.
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
The RooWorkspace is a persistable container for RooFit projects.
virtual Int_t numEntries() const
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.