CLsTS

class hep_spt.CLsTS(alt, null)[source]

Bases: object

Base class to represent the test-statistics function to work with the CLs method. The class is built from the alternative and null hypotheses.

Parameters
  • alt (CLsHypo) – alternative hypothesis.

  • null (CLsHypo) – null hypothesis.

Variables
  • ah – alternative hypothesis.

  • nh – null hypothesis.

Methods Summary

evaluate(v[, size])

Calculate the CLs, CLb and CLsb for the given value.

test_stat(v)

Calculate the test-statistics associated to the given value.

Methods Documentation

evaluate(v, size=100000)[source]

Calculate the CLs, CLb and CLsb for the given value. In order to boost any script using this function, and to prevent misbehaviours due to the use of different generated samples, it is recommended to call it using an array. As an examples, oftenly one wants to evaluate this function on the median, 1 and 2 sigma intervals, and on the observed value. All this can be passed to the function as an array, and the CLsResult instance will contain, instead of single floating values, numpy.ndarray objects.

Parameters
  • v (numpy.ndarray) – input value

  • size (int) – size of the sample to generate.

Returns

Tuple with the CLs, CLb and CLsb values.

Return type

collections.namedtuple

test_stat(v)[source]

Calculate the test-statistics associated to the given value.

Parameters

v (numpy.ndarray) – input value:

Returns

Value of the test-statistics.

Return type

float