SampleHandlerInterface

class pyMaCh3._pyMaCh3.samples.SampleHandlerInterface

Bases: pybind11_object

Methods Summary

get_bin_LLH(self, data, mc, w2)

Get the LLH for a bin by comparing the data and MC. The result depends on having previously set the test statistic using pyMaCh3.samples.SampleHandlerInterface.set_test_stat()

get_likelihood(self)

Get the sample likelihood at the current point in your model space.

get_mc_hist(self, sample)

Get MC histogram as numpy arrays.

get_n_dim(self, sample)

Get the dimension of a given sample

get_n_samples(self)

Get the total number of samples

reweight(self)

reweight the MC events in this sample.

set_test_stat(self, test_stat)

Set the test statistic that should be used when calculating likelihoods.

Methods Documentation

get_bin_LLH(self: pyMaCh3._pyMaCh3.samples.SampleHandlerInterface, data: float, mc: float, w2: float) float
Get the LLH for a bin by comparing the data and MC. The result depends on having previously set the test statistic using pyMaCh3.samples.SampleHandlerInterface.set_test_stat()
param data:

The data content of the bin.

param mc:

The mc content of the bin

param w2:

The Sum(w_{i}^2) (sum of weights squared) in the bin, which is sigma^2_{MC stats}

get_likelihood(self: pyMaCh3._pyMaCh3.samples.SampleHandlerInterface) float

Get the sample likelihood at the current point in your model space. You will need to override this.

get_mc_hist(self: SampleHandlerBase, sample: int) tuple

Get MC histogram as numpy arrays. For 1D: Returns (contents, edges) For 2D: Returns (contents, edgesX, edgesY) where contents is shape (nbinsY, nbinsX) for 2D

get_n_dim(self: pyMaCh3._pyMaCh3.samples.SampleHandlerInterface, sample: int) int

Get the dimension of a given sample

get_n_samples(self: pyMaCh3._pyMaCh3.samples.SampleHandlerInterface) int

Get the total number of samples

reweight(self: pyMaCh3._pyMaCh3.samples.SampleHandlerInterface) None

reweight the MC events in this sample. You will need to override this.

set_test_stat(self: pyMaCh3._pyMaCh3.samples.SampleHandlerInterface, test_stat: pyMaCh3._pyMaCh3.samples.TestStatistic) None
Set the test statistic that should be used when calculating likelihoods.
param test_stat:

The new test statistic to use