This tutorial shows an example of a combination of two searches using number counting with background uncertainty.
Processing /builddir/build/BUILD/root-6.10.00/tutorials/roostats/rs_numberCountingCombination.C...
[1mRooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby[0m
Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
All rights reserved, please
read http:
[#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.
[#0]
PROGRESS:Minization -- ProfileLikelihoodCalcultor::DoGLobalFit - find MLE
[#0]
PROGRESS:Minization -- ProfileLikelihoodCalcultor::DoMinimizeNLL -
using Minuit / Migrad with
strategy 1
[#1]
INFO:Minization -- The following expressions will be evaluated in cache-and-track mode: (sigRegion_0,sideband_0,sigRegion_1,sideband_1)
RooFitResult: minimized FCN value: 17.6316, estimated distance to minimum: 4.65724e-14
covariance matrix quality: Full, accurate covariance matrix
Status : MINIMIZE=0
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
b_0 1.0000e+02 +/- 1.14e+00
b_1 1.0000e+02 +/- 1.45e+00
masterSignal 1.0000e+00 +/- 2.46e-01
[#0]
PROGRESS:Minization -- ProfileLikelihoodCalcultor::GetHypoTest -
do conditional fit
[#0]
PROGRESS:Minization -- ProfileLikelihoodCalcultor::DoMinimizeNLL -
using Minuit / Migrad with
strategy 1
RooFitResult: minimized FCN value: 19.9696, estimated distance to minimum: 1.4638e-07
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
-------------------------------------------------
[#0]
PROGRESS:Minization -- ProfileLikelihoodCalcultor::DoGLobalFit - find MLE
[#0]
PROGRESS:Minization -- ProfileLikelihoodCalcultor::DoMinimizeNLL -
using Minuit / Migrad with
strategy 1
[#1]
INFO:Minization -- The following expressions will be evaluated in cache-and-track mode: (sigRegion_0,sideband_0,sigRegion_1,sideband_1)
RooFitResult: minimized FCN value: 17.6316, estimated distance to minimum: 4.62904e-07
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 9.9967e-01 +/- 4.78e-01
[#1]
INFO:Minization --
RooProfileLL::evaluate(nll_TopLevelPdf_ExpectedNumberCountingData_Profile[masterSignal]) Creating instance of MINUIT
[#1]
INFO:Minization --
RooProfileLL::evaluate(nll_TopLevelPdf_ExpectedNumberCountingData_Profile[masterSignal]) determining minimum likelihood
for current configurations w.r.t all observable
[#1]
INFO:Minization --
RooProfileLL::evaluate(nll_TopLevelPdf_ExpectedNumberCountingData_Profile[masterSignal]) minimum found at (masterSignal=1.00002)
.
[#1]
INFO:Minization --
RooProfileLL::evaluate(nll_TopLevelPdf_ExpectedNumberCountingData_Profile[masterSignal]) Creating instance of MINUIT
[#1]
INFO:Minization --
RooProfileLL::evaluate(nll_TopLevelPdf_ExpectedNumberCountingData_Profile[masterSignal]) determining minimum likelihood
for current configurations w.r.t all observable
[#1]
INFO:Minization --
RooProfileLL::evaluate(nll_TopLevelPdf_ExpectedNumberCountingData_Profile[masterSignal]) minimum found at (masterSignal=1.00007)
..........................................................................................................................................................................................................lower limit on master
signal = 0.089069
upper limit on master signal = 2.00127
-------------------------------------------------
Consider this parameter point:
RooRealVar::masterSignal = 0 +/- 0.477956
L(0 - 3)
It is NOT in the interval.
-------------------------------------------------
-------------------------------------------------
Consider this parameter point:
RooRealVar::masterSignal = 2 +/- 0.477956 L(0 - 3)
It IS in the interval.
-------------------------------------------------
using namespace RooFit;
using namespace RooStats;
void rs_numberCountingCombination_expected();
void rs_numberCountingCombination_observed();
void rs_numberCountingCombination_observedWithTau();
void rs_numberCountingCombination(int flag=1)
{
if(flag==1)
rs_numberCountingCombination_expected();
if(flag==2)
rs_numberCountingCombination_observed();
if(flag==3)
rs_numberCountingCombination_observedWithTau();
}
void rs_numberCountingCombination_expected()
{
f.
AddModel(s,2,wspace,
"TopLevelPdf",
"masterSignal");
f.
AddExpData(s, b, db, 2, wspace,
"ExpectedNumberCountingData");
*wspace->
pdf(
"TopLevelPdf"), *poi, 0.05, nullParams);
assert(htr != 0);
cout << "-------------------------------------------------" << endl;
cout << "The p-value for the null is " << htr->NullPValue() << endl;
cout << "Corresponding to a significance of " << htr->Significance() << endl;
cout << "-------------------------------------------------\n\n" << endl;
lrPlot.SetMaximum(3.);
lrPlot.Draw();
cout << "lower limit on master signal = " << lower << endl;
cout << "upper limit on master signal = " << upper << endl;
cout << "-------------------------------------------------" << 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;
cout << "-------------------------------------------------\n\n" << endl;
cout << "-------------------------------------------------" << 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;
cout << "-------------------------------------------------\n\n" << endl;
delete lrint;
delete htr;
delete wspace;
delete poi;
delete nullParams;
}
void rs_numberCountingCombination_observed()
{
f.
AddModel(s,2,wspace,
"TopLevelPdf",
"masterSignal");
f.
AddData(mainMeas, bkgMeas, dbMeas, 2, wspace,
"ObservedNumberCountingData");
*wspace->
pdf(
"TopLevelPdf"), *poi, 0.05, nullParams);
cout << "-------------------------------------------------" << endl;
cout <<
"The p-value for the null is " << htr->
NullPValue() << endl;
cout <<
"Corresponding to a significance of " << htr->
Significance() << endl;
cout << "-------------------------------------------------\n\n" << endl;
cout <<
"lower limit on master signal = " << lrint->
LowerLimit(*mu ) << endl;
cout <<
"upper limit on master signal = " << lrint->
UpperLimit(*mu ) << endl;
delete lrint;
delete htr;
delete wspace;
delete nullParams;
delete poi;
}
void rs_numberCountingCombination_observedWithTau()
{
f.
AddModel(s,2,wspace,
"TopLevelPdf",
"masterSignal");
f.
AddDataWithSideband(mainMeas, sideband, tau, 2, wspace,
"ObservedNumberCountingDataWithSideband");
*wspace->
pdf(
"TopLevelPdf"), *poi, 0.05, nullParams);
cout << "-------------------------------------------------" << endl;
cout <<
"The p-value for the null is " << htr->
NullPValue() << endl;
cout << "Corresponding to a significance of " << htr->Significance() << endl;
cout << "-------------------------------------------------\n\n" << endl;
cout <<
"lower limit on master signal = " << lrint->
LowerLimit(*mu ) << endl;
cout <<
"upper limit on master signal = " << lrint->
UpperLimit(*mu ) << endl;
delete lrint;
delete htr;
delete wspace;
delete nullParams;
delete poi;
}