79 using namespace RooFit;
80 using namespace RooStats;
90 BinCountTestStat(
void) : fColumnName(
"tmp") {}
91 BinCountTestStat(
string columnName) : fColumnName(columnName) {}
101 virtual const TString GetVarName()
const {
return fColumnName; }
116 void HybridInstructional() {
134 cout <<
"DO NOT RUN WITH CINT: we are using a custom test statistic ";
135 cout <<
"which requires that this tutorial must be compiled ";
136 cout <<
"with ACLIC" << endl;
143 TCanvas *
c =
new TCanvas;
153 w->
factory(
"Poisson::px(x[150,0,500],sum::splusb(s[0,0,100],b[100,0,300]))");
154 w->
factory(
"Poisson::py(y[100,0,500],prod::taub(tau[1.],b))");
155 w->
factory(
"PROD::model(px,py)");
156 w->
factory(
"Uniform::prior_b(b)");
180 w->
factory(
"PROJ::averagedModel(PROD::foo(px|b,py,prior_b),b)") ;
202 cout <<
"-----------------------------------------"<<endl;
203 cout <<
"Part 2" << endl;
204 cout <<
"Hybrid p-value from direct integration = " << 1-cdf->
getVal() << endl;
205 cout <<
"Z_Gamma Significance = " <<
218 cout <<
"-----------------------------------------"<<endl;
219 cout <<
"Part 3" << endl;
220 std::cout <<
"Z_Bi p-value (analytic): " << p_Bi << std::endl;
221 std::cout <<
"Z_Bi significance (analytic): " << Z_Bi << std::endl;
247 data->
add(*w->
set(
"obs"));
276 BinCountTestStat binCount(
"x");
298 w->
factory(
"Gaussian::gauss_prior(b,y, expr::sqrty('sqrt(y)',y))");
302 w->
factory(
"Lognormal::lognorm_prior(b,y, expr::kappa('1+1./sqrt(y)',y))");
344 cout <<
"-----------------------------------------"<<endl;
345 cout <<
"Part 4" << endl;
388 cout <<
"-----------------------------------------"<<endl;
389 cout <<
"Part 5" << endl;
419 dataXY->
add(*w->
set(
"obsXY"));
467 w->
factory(
"Gamma::gamma_y0(b,sum::temp0(y0,1),1,0)");
468 w->
factory(
"Gaussian::gauss_prior_y0(b,y0, expr::sqrty0('sqrt(y0)',y0))");
495 cout <<
"-----------------------------------------"<<endl;
496 cout <<
"Part 6" << endl;
502 c->GetPad(4)->SetLogy();
506 c->SaveAs(
"zbi.pdf");
Holds configuration options for proof and proof-lite.
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
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)
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
static double p3(double t, double a, double b, double c, double d)
RooCmdArg LineColor(Color_t color)
Double_t PValueToSignificance(Double_t pvalue)
HypoTestResult is a base class for results from hypothesis tests.
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 void SetObservables(const RooArgSet &set)
specify the observables
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)
virtual HypoTestResult * GetHypoTest() const
inherited methods from HypoTestCalculator interface
TestStatSampler * GetTestStatSampler(void) const
double cdf(double *x, double *p)
void SetNullParameters(const RooArgSet &nullParameters)
unsigned int r3[N_CITIES]
void Print(const Option_t *="") const
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
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.
virtual void SetPdf(const RooAbsPdf &pdf)
Set the Pdf, add to the the workspace if not already there.
Double_t getVal(const RooArgSet *set=0) const
virtual const RooArgSet * get() const
Double_t BinomialWithTauObsZ(Double_t nObs, Double_t bExp, Double_t tau)
RooFit::MsgLevel globalKillBelow() const
virtual void setVal(Double_t value)
Set value of variable to 'value'.
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.
unsigned int r1[N_CITIES]
Bool_t defineSet(const char *name, const RooArgSet &aset, Bool_t importMissing=kFALSE)
Define a named RooArgSet with given constituents.
virtual Int_t numEntries() const
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.
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
RooDataSet is a container class to hold unbinned data.
TestStatistic that returns the ratio of profiled likelihoods.
This class implements the Hypothesis test calculation using an hybrid (frequentist/bayesian) procedur...
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...
RooRealVar * var(const char *name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found...
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
const RooArgSet * GetSnapshot() const
get RooArgSet for parameters for a particular hypothesis (return NULL if not existing) ...
void SetToys(int toysNull, int toysAlt)
set number of toys
TestStatistic class that returns -log(L[null] / L[alt]) where L is the likelihood.
MaxLikelihoodEstimateTestStat: TestStatistic that returns maximum likelihood estimate of a specified ...
RooFactoryWSTool & factory()
Return instance to factory tool.
typedef void((*Func_t)())
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 void SetParametersOfInterest(const RooArgSet &set)
ClassImp(BinCountTestStat)
virtual void SetSnapshot(const RooArgSet &set)
set parameter values for a particular hypothesis if using a common PDF by saving a snapshot in the wo...
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
unsigned int r2[N_CITIES]
virtual void ForcePriorNuisanceAlt(RooAbsPdf &priorNuisance)
The RooWorkspace is a persistable container for RooFit projects.
virtual void ForcePriorNuisanceNull(RooAbsPdf &priorNuisance)
Override the distribution used for marginalizing nuisance parameters that is inferred from ModelConfi...
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
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.