This tutorial shows an example of a combination of two searches using number counting with background uncertainty.
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;
}