SensitivityScan

class SensitivityScan.SensitivityScan(sighistos, bkghisto, **kwargs)[source]

Bases: MethodProxy.MethodProxy

Class for computing the sensitivity that would result from a cut placed at any given bin.

Creates histograms showing the sensitivity scan across all bins for each of the specified signal histograms.

__init__(sighistos, bkghisto, **kwargs)[source]

Initialize a sensitivity scan plot.

Creates sensitivity histograms for each of the signal histograms sighistos. The sensitivity per bin is computed using the function specified by the sensitivitymeasure property by comparing the signal yield to the number of events in the background histograms bkghisto as defined by the user.

Parameters:
  • sighistos (list, Histo1D, TH1D) – a single or list of signal histograms, or list of tuples where the first entry corresponds to the signal histogram and the second to the dictionary of properties of the resulting sensitivity histogram
  • bkghisto (Histo1D, TH1D) – total background histogram
  • **kwargsSensitivityScan properties
SetSensitivityHistoProperties(index=0, **kwargs)[source]

Declare properties of the sensitivity histogram.

The parameters index refers to the sensitivity histogram corresponding to the signal histogram with index index as initially given to the the constructor.

Parameters:
  • index (int) – index of the associated signal histogram (default: 0)
  • **kwargsHisto1D properties
SetDirection(sign)[source]

Set the direction of the scan.

For ‘+’ the sensitivity is computed by summing up all entries in current and following bins, for ‘-‘ in the current and all previous bins.

Parameters:sign (str) – scan direction, can be either ‘+’ or ‘-‘
GetDirection()[source]

Return the direction of the scan.

Returntype:str
SetSensitivityMeasure(func)[source]

Define a function to be used for computing the sensitivity.

The parameter func can be a either a function or lambda taking exactly three parameters or a string containing the code to be executed. The three parameters are s, b and db which will be interpreted then as:

  • s : number of signal events
  • b : number of background events
  • db : total relative background uncertainty (including flatbkgsys)
Examples:
  • func = lambda s, b, db : s / b
  • func = 's / b'
  • func = 'ROOT.RooStats.NumberCountingUtils.BinomialExpZ(s, b, db)'
  • func = 'AsymptoticFormulae.AsimovExpZ(s, b, db)'
Parameters:

func (function, str) – function or string of code used to evaluate the sensitivity

GetSensitivityMeasure()[source]

Return the function used to evaluate the sensitivity.

Returntype:function
SetName(name)[source]

Set the name of object.

Parameters:name (str) – name of the object
GetName()[source]

Return the name of the object.

Returntype:str
InheritsFrom(classname)[source]
SetFlatBkgSys(value)[source]

Define the value of the relative flat systematic uncertainty on the background.

The value is interpreted as the uncertainty relative to the number of background events.

Parameters:value (float) – value of the flat relative background systematic uncertainty (default: 0.3)
GetFlatBkgSys()[source]

Return the value of the relative flat systematic uncertainty on the background.

SetIncludeUnderflow(boolean)[source]

Set whether the underflow bin is included in the calculation.

Parameters:boolean (bool) – if set to True the underflow bin will be included
GetIncludeUnderflow()[source]

Return whether the underflow bin is included in the calculation.

Returntype:bool
SetIncludeOverflow(boolean)[source]

Set whether the overflow bin is included in the calculation.

Parameters:boolean (bool) – if set to True the overflow bin will be included
GetIncludeOverflow()[source]

Return whether the overflow bin is included in the calculation.

Returntype:bool
SetYMin(value)[source]

Set the minimal value of the y-axis.

Parameters:value (float) – minimal value of the y-axis
GetYMin()[source]

Return the minimal value of the y-axis.

Returntype:float
SetYMax(value)[source]

Set the maximal value of the y-axis.

Parameters:value (float) – maximal value of the y-axis
GetYMax()[source]

Return the maximal value of the y-axis.

Returntype:float
SetDrawOption(option)[source]

Define the draw option for all sensitivity histograms.

Parameters:option (str) – draw option (see ROOT.THistPainter class reference)
GetDrawOption()[source]

Return the draw option defined for all sensitivity histograms.

Returntype:str