This tutorial shows an example of a combination of two searches using number counting with background uncertainty.
[#0] WARNING:ObjectHandling -- NumberCountingPdfFactory: changed value of tau_0 to 100.01 to be consistent with background and its uncertainty. Also stored these values of tau into workspace with name . tau_0ExpectedNumberCountingData if you test with a different dataset, you should adjust tau appropriately.
[#0] WARNING:ObjectHandling -- NumberCountingPdfFactory: changed value of tau_1 to 100.01 to be consistent with background and its uncertainty. Also stored these values of tau into workspace with name . tau_1ExpectedNumberCountingData if you test with a different dataset, you should adjust tau appropriately.
[#1] INFO:InputArguments -- The deprecated RooFit::CloneData(1) option passed to createNLL() is ignored.
[#1] INFO:Fitting -- RooAbsPdf::fitTo(TopLevelPdf) fixing normalization set for coefficient determination to observables in data
[#1] INFO:Fitting -- using CPU computation library compiled with -mavx2
[#1] INFO:Fitting -- Creation of NLL object took 1.53352 ms
[#0] PROGRESS:Minimization -- ProfileLikelihoodCalcultor::DoGLobalFit - find MLE
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_TopLevelPdf_ExpectedNumberCountingData) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: activating const optimization
[#0] PROGRESS:Minimization -- ProfileLikelihoodCalcultor::DoMinimizeNLL - using Minuit2 / with strategy 1
[#1] INFO:Minimization --
RooFitResult: minimized FCN value: 17.6316, estimated distance to minimum: 4.66835e-14
covariance matrix quality: Full, accurate covariance matrix
Status : MINIMIZE=0
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
b_0 1.0000e+02 +/- 9.99e-01
b_1 1.0000e+02 +/- 9.96e-01
masterSignal 1.0000e+00 +/- 4.78e-01
[#0] PROGRESS:Minimization -- ProfileLikelihoodCalcultor::GetHypoTest - do conditional fit
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_TopLevelPdf_ExpectedNumberCountingData) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: activating const optimization
[#0] PROGRESS:Minimization -- ProfileLikelihoodCalcultor::DoMinimizeNLL - using Minuit2 / with strategy 1
[#1] INFO:Minimization --
RooFitResult: minimized FCN value: 19.9696, estimated distance to minimum: 2.75635e-13
covariance matrix quality: Full, accurate covariance matrix
Status : MINIMIZE=0
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
b_0 1.0020e+02 +/- 9.96e-01
b_1 1.0010e+02 +/- 9.95e-01
-------------------------------------------------
The p-value for the null is 0.015294
Corresponding to a significance of 2.16239
-------------------------------------------------
[#1] INFO:InputArguments -- The deprecated RooFit::CloneData(1) option passed to createNLL() is ignored.
[#1] INFO:Fitting -- RooAbsPdf::fitTo(TopLevelPdf) fixing normalization set for coefficient determination to observables in data
[#1] INFO:Fitting -- Creation of NLL object took 729.651 μs
[#0] PROGRESS:Minimization -- ProfileLikelihoodCalcultor::DoGLobalFit - find MLE
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_TopLevelPdf_ExpectedNumberCountingData) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: activating const optimization
[#0] PROGRESS:Minimization -- ProfileLikelihoodCalcultor::DoMinimizeNLL - using Minuit2 / with strategy 1
[#1] INFO:Minimization --
RooFitResult: minimized FCN value: 17.6316, estimated distance to minimum: 7.42432e-13
covariance matrix quality: Full, accurate covariance matrix
Status : MINIMIZE=0
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
b_0 1.0000e+02 +/- 9.99e-01
b_1 1.0000e+02 +/- 9.96e-01
masterSignal 1.0000e+00 +/- 4.78e-01
[#1] INFO:Minimization -- RooProfileLL::evaluate(RooEvaluatorWrapper_Profile[masterSignal]) Creating instance of MINUIT
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_TopLevelPdf_ExpectedNumberCountingData) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minimization -- RooProfileLL::evaluate(RooEvaluatorWrapper_Profile[masterSignal]) determining minimum likelihood for current configurations w.r.t all observable
[#1] INFO:Minimization -- RooProfileLL::evaluate(RooEvaluatorWrapper_Profile[masterSignal]) minimum found at (masterSignal=1.00388)
.
[#1] INFO:Minimization -- RooProfileLL::evaluate(RooEvaluatorWrapper_Profile[masterSignal]) Creating instance of MINUIT
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_TopLevelPdf_ExpectedNumberCountingData) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minimization -- RooProfileLL::evaluate(RooEvaluatorWrapper_Profile[masterSignal]) determining minimum likelihood for current configurations w.r.t all observable
[#0] ERROR:InputArguments -- RooArgSet::checkForDup: ERROR argument with name masterSignal is already in this set
[#1] INFO:Minimization -- RooProfileLL::evaluate(RooEvaluatorWrapper_Profile[masterSignal]) minimum found at (masterSignal=1.00732)
..........................................................................................................................................................................................................lower limit on master signal = 0.089069
upper limit on master signal = 2.00127
-------------------------------------------------
Consider this parameter point:
RooRealVar::masterSignal = 0 +/- 0.477961 L(0 - 3)
It is NOT in the interval.
-------------------------------------------------
-------------------------------------------------
Consider this parameter point:
RooRealVar::masterSignal = 2 +/- 0.477961 L(0 - 3)
It IS in the interval.
-------------------------------------------------
#include <cassert>
void flag = 1)
{
}
{
double s[2] = {20., 10.};
double b[2] = {100., 100.};
double db[2] = {.0100, .0100};
f.AddModel(s, 2, &wspace,
"TopLevelPdf",
"masterSignal");
f.AddExpData(s,
b,
db, 2, &wspace,
"ExpectedNumberCountingData");
std::unique_ptr<HypoTestResult>
htr{
plc.GetHypoTest()};
std::cout << "-------------------------------------------------" << std::endl;
std::cout <<
"The p-value for the null is " <<
htr->NullPValue() << std::endl;
std::cout <<
"Corresponding to a significance of " <<
htr->Significance() << std::endl;
std::cout << "-------------------------------------------------\n\n" << std::endl;
lrint->SetConfidenceLevel(0.95);
std::cout <<
"lower limit on master signal = " <<
lower << std::endl;
std::cout <<
"upper limit on master signal = " <<
upper << std::endl;
std::cout << "-------------------------------------------------" << std::endl;
std::cout << "Consider this parameter point:" << std::endl;
std::cout << "It IS in the interval." << std::endl;
else
std::cout << "It is NOT in the interval." << std::endl;
std::cout << "-------------------------------------------------\n\n" << std::endl;
std::cout << "-------------------------------------------------" << std::endl;
std::cout << "Consider this parameter point:" << std::endl;
std::cout << "It IS in the interval." << std::endl;
else
std::cout << "It is NOT in the interval." << std::endl;
std::cout << "-------------------------------------------------\n\n" << std::endl;
}
{
double s[2] = {20., 10.};
f.AddModel(s, 2, &wspace,
"TopLevelPdf",
"masterSignal");
double bkgMeas[2] = {111.23, 98.76};
double dbMeas[2] = {.011, .0095};
wspace.var("tau_0")->Print();
wspace.var("tau_1")->Print();
std::unique_ptr<HypoTestResult>
htr{
plc.GetHypoTest()};
std::cout << "-------------------------------------------------" << std::endl;
std::cout <<
"The p-value for the null is " <<
htr->NullPValue() << std::endl;
std::cout <<
"Corresponding to a significance of " <<
htr->Significance() << std::endl;
std::cout << "-------------------------------------------------\n\n" << std::endl;
lrint->SetConfidenceLevel(0.95);
std::cout <<
"lower limit on master signal = " <<
lrint->LowerLimit(*mu) << std::endl;
std::cout <<
"upper limit on master signal = " <<
lrint->UpperLimit(*mu) << std::endl;
}
{
double s[2] = {20., 10.};
f.AddModel(s, 2, &wspace,
"TopLevelPdf",
"masterSignal");
double tau[2] = {100., 100.};
f.AddDataWithSideband(
mainMeas,
sideband, tau, 2, &wspace,
"ObservedNumberCountingDataWithSideband");
std::unique_ptr<HypoTestResult>
htr{
plc.GetHypoTest()};
std::cout << "-------------------------------------------------" << std::endl;
std::cout <<
"The p-value for the null is " <<
htr->NullPValue() << std::endl;
std::cout <<
"Corresponding to a significance of " <<
htr->Significance() << std::endl;
std::cout << "-------------------------------------------------\n\n" << std::endl;
lrint->SetConfidenceLevel(0.95);
std::cout <<
"lower limit on master signal = " <<
lrint->LowerLimit(*mu) << std::endl;
std::cout <<
"upper limit on master signal = " <<
lrint->UpperLimit(*mu) << std::endl;
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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.
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.