97 for (
int i = 0; i <
data.numEntries(); i++) {
98 value +=
data.get(i)->getRealValue(fColumnName.c_str());
102 virtual const TString GetVarName()
const {
return fColumnName; }
116void HybridInstructional(
int ntoys = 6000)
144 w->factory(
"Poisson::px(x[150,0,500],sum::splusb(s[0,0,100],b[100,0.1,300]))");
145 w->factory(
"Poisson::py(y[100,0.1,500],prod::taub(tau[1.],b))");
146 w->factory(
"PROD::model(px,py)");
147 w->factory(
"Uniform::prior_b(b)");
165 w->factory(
"PROJ::averagedModel(PROD::foo(px|b,py,prior_b),b)");
172 w->var(
"s")->setVal(50.);
176 w->var(
"s")->setVal(0.);
183 w->var(
"y")->setVal(100);
184 w->var(
"x")->setVal(150);
185 std::unique_ptr<RooAbsReal>
cdf{
w->pdf(
"averagedModel")->createCdf(*
w->var(
"x"))};
187 cout <<
"-----------------------------------------" << endl;
188 cout <<
"Part 2" << endl;
189 cout <<
"Hybrid p-value from direct integration = " << 1 -
cdf->getVal() << endl;
200 double p_Bi = NumberCountingUtils::BinomialWithTauObsP(150, 100, 1);
201 double Z_Bi = NumberCountingUtils::BinomialWithTauObsZ(150, 100, 1);
202 cout <<
"-----------------------------------------" << endl;
203 cout <<
"Part 3" << endl;
204 std::cout <<
"Z_Bi p-value (analytic): " <<
p_Bi << std::endl;
205 std::cout <<
"Z_Bi significance (analytic): " <<
Z_Bi << std::endl;
229 w->defineSet(
"obs",
"x");
230 w->defineSet(
"poi",
"s");
234 data->add(*
w->set(
"obs"));
241 b_model.SetObservables(*
w->set(
"obs"));
242 b_model.SetParametersOfInterest(*
w->set(
"poi"));
243 w->var(
"s")->setVal(0.0);
244 b_model.SetSnapshot(*
w->set(
"poi"));
250 sb_model.SetParametersOfInterest(*
w->set(
"poi"));
251 w->var(
"s")->setVal(50.0);
284 w->factory(
"Gaussian::gauss_prior(b,y, expr::sqrty('sqrt(y)',y))");
288 w->factory(
"Lognormal::lognorm_prior(b,y, expr::kappa('1+1./sqrt(y)',y))");
311 hc1.ForcePriorNuisanceAlt(*
w->pdf(
"py"));
312 hc1.ForcePriorNuisanceNull(*
w->pdf(
"py"));
329 cout <<
"-----------------------------------------" << endl;
330 cout <<
"Part 4" << endl;
359 hc2.ForcePriorNuisanceAlt(*
w->pdf(
"py"));
360 hc2.ForcePriorNuisanceNull(*
w->pdf(
"py"));
376 cout <<
"-----------------------------------------" << endl;
377 cout <<
"Part 5" << endl;
402 w->defineSet(
"obsXY",
"x,y");
405 w->var(
"x")->setVal(150.);
406 w->var(
"y")->setVal(100.);
414 b_modelXY.SetParametersOfInterest(*
w->set(
"poi"));
415 w->var(
"s")->setVal(0.0);
422 sb_modelXY.SetParametersOfInterest(*
w->set(
"poi"));
423 w->var(
"s")->setVal(50.0);
436 ropl.SetSubtractMLE(
false);
451 w->factory(
"y0[100]");
452 w->factory(
"Gamma::gamma_y0(b,sum::temp0(y0,1),1,0)");
453 w->factory(
"Gaussian::gauss_prior_y0(b,y0, expr::sqrty0('sqrt(y0)',y0))");
461 hc3.ForcePriorNuisanceAlt(*
w->pdf(
"gamma_y0"));
462 hc3.ForcePriorNuisanceNull(*
w->pdf(
"gamma_y0"));
478 cout <<
"-----------------------------------------" << endl;
479 cout <<
"Part 6" << endl;
488 c->GetPad(4)->SetLogy();
492 c->SaveAs(
"zbi.pdf");
#define ClassDef(name, id)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Abstract base class for binned and unbinned datasets.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Container class to hold unbinned data.
static RooMsgService & instance()
Return reference to singleton instance.
Plot frame and a container for graphics objects within that frame.
void Draw(Option_t *options=nullptr) override
Draw this plot and all of the elements it contains.
Same purpose as HybridCalculatorOriginal, but different implementation.
This class provides the plots for the result of a study performed with any of the HypoTestCalculatorG...
HypoTestResult is a base class for results from hypothesis tests.
MaxLikelihoodEstimateTestStat: TestStatistic that returns maximum likelihood estimate of a specified ...
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
ProfileLikelihoodTestStat is an implementation of the TestStatistic interface that calculates the pro...
TestStatistic that returns the ratio of profiled likelihoods.
TestStatistic class that returns -log(L[null] / L[alt]) where L is the likelihood.
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
ToyMCSampler is an implementation of the TestStatSampler interface.
Persistable container for RooFit projects.
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void Stop()
Stop the stopwatch.
void Print(Option_t *option="") const override
Print the real and cpu time passed between the start and stop events.
RooCmdArg LineColor(TColorNumber color)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
MsgLevel
Verbosity level for RooMsgService::StreamConfig in RooMsgService.
Namespace for the RooStats classes.
double PValueToSignificance(double pvalue)
returns one-sided significance corresponding to a p-value