11.3.1. Constructing the TMinimisation object

As stated above, the only available constructor is the one whose prototype includes an instance of a TRun-inheriting object. This approach provides a simple way to change the evaluator (e.g., from a C++ function to a Python function or an external code) and to use either a sequential approach (for a code) or a threaded one (to distribute locally the estimates).

In this case, the constructor should look like this:

// Constructor with a runner
TMinimisation(TDataServer *tds, TRun *runner, Int_t ns=1, Option_t *option="");

This method takes up to four arguments, two of which are optional:

  1. tds: a TDataServer object containing one attribute for each parameter to be calibrated. This is the
    TDataServer object called tdsPar, defined in General introduction to data and model definition.

  2. runner: a TRun-inheriting instance that contains all the model information and whose type determines how the estimates are distributed: it can either be a TSequentialRun instance or TThreadedRun for distributed computations.

  3. ns (optional): the number of samples to be produced. This parameter is not used in this context.

  4. option (optional): the options that can be applied to the method. Options common to all calibration classes (those defined in the TCalibration class) are discussed in Running the estimate.

A crucial step in this constructor is the creation of the instance that inherits from TRun. As mentioned earlier, its type determines how the estimates are distributed. To construct such an object, one needs to provide an evaluator (the available evaluators are described in detail in TEval).

The final step is to construct the TDistanceLikelihoodFunction, a mandatory step that must always follow the constructor, using the setDistance method (following the prototype presented in Recommended distance and likelihood functions, construction method). Advanced users also have the option to define a custom distance by following the prototype:

void setDistance(TDistanceLikelihoodFunction *distFunc, TDataServer *tdsRef, const char *input, const char *reference, const char *weight="");