'Number Counting Utils' RooStats tutorial
This tutorial shows an example of the RooStats standalone utilities that calculate the p-value or Z value (eg. significance in 1-sided Gaussian standard deviations) for a number counting experiment. This is a hypothesis test between background only and signal-plus-background. The background estimate has uncertainty derived from an auxiliary or sideband measurement.
Documentation for these utilities can be found here: https://root.cern.ch/doc/master/namespaceNumberCountingUtils.html
This problem is often called a proto-type problem for high energy physics. In some references it is referred to as the on/off problem.
The problem is treated in a fully frequentist fashion by interpreting the relative background uncertainty as being due to an auxiliary or sideband observation that is also Poisson distributed with only background. Finally, one considers the test as a ratio of Poisson means where an interval is well known based on the conditioning on the total number of events and the binomial distribution. For more on this, see
expected p-value = 0.0009416504675382001 Z value (Gaussian sigma) = 3.108043895747122
observed p-value = 0.0009416504675382001 Z value (Gaussian sigma) = 3.108043895747122
observed p-value = 0.0009416504675382269 Z value (Gaussian sigma) = 3.1080438957471137
observed p-value = 0.0009416504675382269 Z value (Gaussian sigma) = 3.1080438957471137
import ROOT
sExpected = 50
bExpected = 100
relativeBkgUncert = 0.1
pExp = ROOT.RooStats.NumberCountingUtils.BinomialExpP(sExpected, bExpected, relativeBkgUncert)
zExp = ROOT.RooStats.NumberCountingUtils.BinomialExpZ(sExpected, bExpected, relativeBkgUncert)
print(
"expected p-value = {} Z value (Gaussian sigma) = {}".
format(pExp, zExp))
observed = 150
pObs = ROOT.RooStats.NumberCountingUtils.BinomialObsP(observed, bExpected, relativeBkgUncert)
zObs = ROOT.RooStats.NumberCountingUtils.BinomialObsZ(observed, bExpected, relativeBkgUncert)
print(
"observed p-value = {} Z value (Gaussian sigma) = {}".
format(pObs, zObs))
tau = 1
pExpWithTau = ROOT.RooStats.NumberCountingUtils.BinomialWithTauExpP(sExpected, bExpected, tau)
zExpWithTau = ROOT.RooStats.NumberCountingUtils.BinomialWithTauExpZ(sExpected, bExpected, tau)
print(
"observed p-value = {} Z value (Gaussian sigma) = {}".
format(pExpWithTau, zExpWithTau))
pObsWithTau = ROOT.RooStats.NumberCountingUtils.BinomialWithTauObsP(observed, bExpected, tau)
zObsWithTau = ROOT.RooStats.NumberCountingUtils.BinomialWithTauObsZ(observed, bExpected, tau)
print(
"observed p-value = {} Z value (Gaussian sigma) = {}".
format(pObsWithTau, zObsWithTau))
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
- Date
- July 2022
- Authors
- Artem Busorgin, Kyle Cranmer (C++ version)
Definition in file rs_numbercountingutils.py.