11.2.2.3. Available options for every distance and likelihood function
All distance and likelihood function classes inherit from TDistanceLikelihoodFunction, and the only difference
among them lies in the implementation of the localeval function. As a result, a large
portion of the code is shared across all the distance and likelihood function objects, including the parts handling
their configuration and options.
This subsection gathers all the shared options, which can be configured either through the optional
“Option” parameter in several methods and constructors, or by accessing the distance or likelihood function object directly once it has been
created. To do so, the user can call the getDistanceLikelihoodFunction method, which returns the distance
or likelihood function instance stored within the calibration object.
The following lines provide an example using an instance
cal of the mock class TCalClass (as if it inherited from the TCalibration class).
# import rootlogon to get Calibration namespace
from rootlogon import DataServer, Calibration
# Creating the calibration instance from a TDataServer and a Relauncher::TRun
cal = Calibration.TCalClass(tdsPar, runner, 1, "")
# Creating the distance function (a least square one)
cal.setDistance("LS", tdsRef, "logRe:logPr", "logNu")
# Retrieving the instance to be able to change options
dFunc = cal.getDistanceLikelihoodFunction()