44void rs_numberCountingCombination_expected();
45void rs_numberCountingCombination_observed();
46void rs_numberCountingCombination_observedWithTau();
50void rs_numberCountingCombination(
int flag = 1)
53 rs_numberCountingCombination_expected();
55 rs_numberCountingCombination_observed();
57 rs_numberCountingCombination_observedWithTau();
61void rs_numberCountingCombination_expected()
74 double s[2] = {20., 10.};
75 double b[2] = {100., 100.};
76 double db[2] = {.0100, .0100};
86 f.AddModel(s, 2, &wspace,
"TopLevelPdf",
"masterSignal");
91 f.AddExpData(s,
b, db, 2, &wspace,
"ExpectedNumberCountingData");
106 nullParams.setRealValue(
"masterSignal", 0);
114 std::unique_ptr<HypoTestResult> htr{plc.GetHypoTest()};
115 std::cout <<
"-------------------------------------------------" << std::endl;
116 std::cout <<
"The p-value for the null is " << htr->NullPValue() << std::endl;
117 std::cout <<
"Corresponding to a significance of " << htr->Significance() << std::endl;
118 std::cout <<
"-------------------------------------------------\n\n" << std::endl;
132 RooArgSet ¶msOfInterest = nullParams;
133 plc.SetParameters(paramsOfInterest);
134 std::unique_ptr<LikelihoodInterval> lrint{
static_cast<LikelihoodInterval *
>(plc.GetInterval())};
140 double lower = lrint->LowerLimit(*mu);
141 double upper = lrint->UpperLimit(*mu);
144 lrPlot.SetMaximum(3.);
148 std::cout <<
"lower limit on master signal = " << lower << std::endl;
149 std::cout <<
"upper limit on master signal = " << upper << std::endl;
157 std::cout <<
"-------------------------------------------------" << std::endl;
158 std::cout <<
"Consider this parameter point:" << std::endl;
160 if (lrint->IsInInterval(paramsOfInterest))
161 std::cout <<
"It IS in the interval." << std::endl;
163 std::cout <<
"It is NOT in the interval." << std::endl;
164 std::cout <<
"-------------------------------------------------\n\n" << std::endl;
168 std::cout <<
"-------------------------------------------------" << std::endl;
169 std::cout <<
"Consider this parameter point:" << std::endl;
171 if (lrint->IsInInterval(paramsOfInterest))
172 std::cout <<
"It IS in the interval." << std::endl;
174 std::cout <<
"It is NOT in the interval." << std::endl;
175 std::cout <<
"-------------------------------------------------\n\n" << std::endl;
212void rs_numberCountingCombination_observed()
227 double s[2] = {20., 10.};
237 f.AddModel(s, 2, &wspace,
"TopLevelPdf",
"masterSignal");
241 double mainMeas[2] = {123., 117.};
242 double bkgMeas[2] = {111.23, 98.76};
243 double dbMeas[2] = {.011, .0095};
244 f.AddData(mainMeas, bkgMeas, dbMeas, 2, &wspace,
"ObservedNumberCountingData");
259 nullParams.setRealValue(
"masterSignal", 0);
266 wspace.var(
"tau_0")->Print();
267 wspace.var(
"tau_1")->Print();
270 std::unique_ptr<HypoTestResult> htr{plc.GetHypoTest()};
271 std::cout <<
"-------------------------------------------------" << std::endl;
272 std::cout <<
"The p-value for the null is " << htr->NullPValue() << std::endl;
273 std::cout <<
"Corresponding to a significance of " << htr->Significance() << std::endl;
274 std::cout <<
"-------------------------------------------------\n\n" << std::endl;
288 RooArgSet ¶msOfInterest = nullParams;
289 plc.SetParameters(paramsOfInterest);
290 std::unique_ptr<LikelihoodInterval> lrint{
static_cast<LikelihoodInterval *
>(plc.GetInterval())};
294 std::cout <<
"lower limit on master signal = " << lrint->LowerLimit(*mu) << std::endl;
295 std::cout <<
"upper limit on master signal = " << lrint->UpperLimit(*mu) << std::endl;
298void rs_numberCountingCombination_observedWithTau()
313 double s[2] = {20., 10.};
323 f.AddModel(s, 2, &wspace,
"TopLevelPdf",
"masterSignal");
327 double mainMeas[2] = {123., 117.};
328 double sideband[2] = {11123., 9876.};
329 double tau[2] = {100., 100.};
330 f.AddDataWithSideband(mainMeas, sideband, tau, 2, &wspace,
"ObservedNumberCountingDataWithSideband");
345 nullParams.setRealValue(
"masterSignal", 0);
350 poi, 0.05, &nullParams);
353 std::unique_ptr<HypoTestResult> htr{plc.GetHypoTest()};
354 std::cout <<
"-------------------------------------------------" << std::endl;
355 std::cout <<
"The p-value for the null is " << htr->NullPValue() << std::endl;
356 std::cout <<
"Corresponding to a significance of " << htr->Significance() << std::endl;
357 std::cout <<
"-------------------------------------------------\n\n" << std::endl;
371 RooArgSet ¶msOfInterest = nullParams;
372 plc.SetParameters(paramsOfInterest);
373 std::unique_ptr<LikelihoodInterval> lrint{
static_cast<LikelihoodInterval *
>(plc.GetInterval())};
377 std::cout <<
"lower limit on master signal = " << lrint->LowerLimit(*mu) << std::endl;
378 std::cout <<
"upper limit on master signal = " << lrint->UpperLimit(*mu) << std::endl;
void Print(Option_t *options=nullptr) const override
Print the object to the defaultPrintStream().
RooAbsArg * first() const
bool setRealValue(const char *name, double newVal=0.0, bool verbose=false)
Set value of a RooAbsRealLValue stored in set with given name to newVal No error messages are printed...
virtual RooAbsArg * addClone(const RooAbsArg &var, bool silent=false)
Add a clone of the specified argument to list.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Variable that can be changed from the outside.
This class provides simple and straightforward utilities to plot a LikelihoodInterval object.
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
void SetConfidenceLevel(double cl) override
set the confidence level for the interval (e.g 0.682 for a 1-sigma interval)
A factory for building PDFs and data for a number counting combination.
The ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface cla...
Persistable container for RooFit projects.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Namespace for the RooStats classes.