UnbinnedEvaluator

class minkit.UnbinnedEvaluator(fcn, pdf, data, range='full', constraints=None, weights_treatment='rescale')[source]

Bases: minkit.Evaluator

Proxy class to evaluate an FCN with a PDF.

Parameters
  • fcn (str) – FCN to be used during minimization.

  • pdf (PDF) – PDF to minimize.

  • data (DataSet) – data sample to process.

  • range (str) – range of data to minimize.

  • constraints (list(PDF)) – set of constraints to consider in the minimization.

  • weights_treatment (str) – what to do with weighted samples (see below for more information).

The treatment of weights when calculating FCNs can lead to unreliable errors for the parameters. In general there is no correct way of processing the likelihoods. In this package the following methods are supported:

  • none: the raw weights are used to calculate the FCN. This will lead to completely incorrect uncertainties, since the statistical weight of the events in the data sample will not be proportional to the sample weight.

  • rescale: in this case the weights are rescaled so \(\omega^\prime_i = \omega_i \times \frac{\sum_{j = 0}^n \omega_j}{\sum_{j = 0}^n \omega_j^2}\). In this case the statistical weight of each event is proportional to the sample weight, although the uncertainties will still be incorrect.

Attributes Summary

args

All the arguments of the evaluator.

Methods Summary

__call__(*values)

Evaluate the FCN.

fcn()

Calculate the value of the FCN with the current set of values.

using_caches()

Create a context where the cache of the PDF is activated.

Attributes Documentation

args

All the arguments of the evaluator.

Type

Registry(Parameter)

Methods Documentation

__call__(*values)[source]

Evaluate the FCN. Values must be provided sorted as PDF.args().

Parameters

values (tuple(float)) – set of values to evaluate the FCN.

Returns

value of the FCN.

Return type

float

fcn()[source]

Calculate the value of the FCN with the current set of values.

Returns

Value of the FCN.

Return type

float

using_caches()[source]

Create a context where the cache of the PDF is activated. This should be done before successive calls to the evaluator.