English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Calibration: URANIE::Calibration::TDistanceFunction Class Reference
Uranie / Calibration v4.9.0
/* @license-end */
URANIE::Calibration::TDistanceFunction Class Referenceabstract

Description of the class TDistanceFunction. More...

#include <TDistanceFunction.h>

Inheritance diagram for URANIE::Calibration::TDistanceFunction:
Collaboration diagram for URANIE::Calibration::TDistanceFunction:

Public Member Functions

Constructor and Destructor
 TDistanceFunction (URANIE::DataServer::TDataServer *tdsEval, URANIE::DataServer::TDataServer *tdsObs, const char *reference, const char *output, const char *weight="")
 Standard constructor.
 
virtual ~TDistanceFunction ()
 Default destructor.
 
Initialisation and evaluation
void fillInOutAtt (URANIE::DataServer::TDataServer *tdsPar)
 Internal initialisation method.
 
void initParameters (URANIE::DataServer::TDataServer *tdsPar, URANIE::Relauncher::TRun *run)
 
void initParameters (URANIE::DataServer::TDataServer *tdsPar, const char *funcName, const char *varexpinput, const char *varexpoutput)
 
void initParameters (URANIE::DataServer::TDataServer *tdsPar, void(*fcn)(Double_t *, Double_t *), const char *varexpinput, const char *varexpoutput)
 
void initParameters (URANIE::DataServer::TDataServer *tdsPar, URANIE::Launcher::TCode *Code)
 
Int_t eval (Double_t *theta, Double_t *res, int=0)
 Official method inherited from TSimpleEval, it is the main method of a DF It calls three methods in a row : runConfiguration, getData and localeval.
 
void runConfiguration (double *theta)
 Runs the code provided on the reference input to get estimations.
 
Get and Set methods
vector< vector< double > > getObservationVector ()
 Return the observation vector of vector.
 
TMatrixD getObservationMatrix ()
 Return the observation matrix.
 
void setSaveAllEvaluations (bool value)
 Choose whether every evaluations should be kept (might slown down the process)
 
void changeLauncher (TString tlcName)
 Change the code launcher.
 
void changeCodeLauncherOpt (TString opt)
 Change the option of the code launcher.
 
void dumpAllDataservers ()
 
void keepParametersValue ()
 
void dumpDetails ()
 
void addCodeLauncherOpt (TString opt)
 add options to the already of the code launcher
 
void setUseMatrix (bool value)
 Choose whether vector of vector or matrix should be used in the distance function localeval method.
 
void setVarWeights (int nwei, double *wei)
 Set a weight to ponderate variable when _nVar >1.
 
void setVarWeights (vector< double > wei)
 Set a weight to ponderate variable when _nVar >1.
 
void setObservationCovarianceMatrix (TMatrixD &mat)
 set the observatiton covariance matrix
 
bool getSaveAllEvaluation ()
 Check the value of the saveAll option.
 
bool getUseMatrix ()
 Check the value of the useMatrix option.
 
void setGaussianRandomNoise (const char *stdname)
 Set Normal random noise for an output variable.
 
void setSeed (UInt_t nval)
 Set the seed of the random generator if one is used.
 
Printing Log
void setLog ()
 
void unsetLog ()
 
void changeLog ()
 
Bool_t getLog ()
 
virtual void printLog (Option_t *option="")
 

Public Attributes

URANIE::DataServer::TDataServer * _tdsEval
 pointer toward the evaluation dataserver
 
URANIE::DataServer::TDataServer * _tdsObs
 pointer toward the reference dataserver
 
URANIE::DataServer::TDSNtupleD * _allData
 pointer toward the reference dataserver
 

Protected Member Functions

Internal methods
void getData (bool reference=false)
 Get the data either the reference one, or the estimated one for a given parameter configuration.
 
virtual Int_t localeval (Double_t *res)=0
 Use the reference and the newly obtained estimations to compute a distance.
 

Protected Attributes

vector< string > _vrefName
 Vector of reference name.
 
vector< string > _voutName
 Vector of output name.
 
vector< string > _vparName
 Vector of parameters name.
 
vector< vector< double > > _yObs
 Vector of observations outputs (size: _nVar < _nObs >)
 
vector< vector< double > > _yExp
 Vector of tested values (size: _nVar <_nObs>)
 
TMatrixD _mObsCovMat
 Observation Covariance matrix.
 
TMatrixD _myObs
 Vector of observations outputs (size: _nVar < _nObs >)
 
TMatrixD _myExp
 Vector of tested values (size: _nVar <_nObs>)
 
unsigned int _nObs
 Number of observations.
 
unsigned int _nVar
 Number of variables;.
 
unsigned int _nPar
 Number of Parameters;.
 
vector< double > _vParValues
 
vector< double > _varWeights
 Vector of variable weights (size: _nVar)
 
vector< vector< double > > _obsWeights
 Vector of observation weights outputs (size: _nObs)
 
URANIE::Relauncher::TRun * _run
 
TString _tlcType
 
TString _codeLauncherOpt
 Option for code launcher.
 
URANIE::Launcher::TCode * _code
 
TString _funcName
 
void(* _pFunction )(double *, double *)
 Function pointer.
 
TString _varexpinput
 
TString _varexpoutput
 
bool _baprioriSet
 Whether apriori is set to evaluator.
 
bool _bsaveAll
 Whether all evaluations should be saved, not only a priori and a posteriori.
 
bool _buseMatrix
 Use matrix instead of vectors.
 
bool _blog
 Boolean to decide if the log information is shown or not.
 
bool _dumpAllTds
 dump all tested dataserver;
 
bool _keepParValue
 Keep the parameters values in runner case.
 
bool _bdumpDetails
 Dump the details in Distance Computation.
 
int _icalc
 Calcul iterator;.
 
unsigned int _ivar
 
unsigned int _iobs
 
TList * _listOfParameters
 list of parameters
 
TRandom3 * _rand
 The random generator.
 
int _nSeed
 The seed of the random generator.
 
TMatrixD _mSigma
 Vector of variance of errors.
 
bool _boolNoise
 Whether noise is add to the output.
 

Detailed Description

Description of the class TDistanceFunction.

This class defines the structure of all distance function (DF) and rely on the relauncher structure to do so. Every DF will be based on this class, inherinting from TSimpleEval. The aim of the distance function is to

  • handle the data (input / reference values and possible weights)
  • get parameters value from the TCalibration inheriting object and recompute estimated outputs for all events in reference dataserver
  • store the apriori evaluation for residuals plots (and possibly all evaluations if requested)
  • compute a distance that will be used as a way to quantify how close the new parameters set is to the reference.

Constructor & Destructor Documentation

◆ TDistanceFunction()

URANIE::Calibration::TDistanceFunction::TDistanceFunction ( URANIE::DataServer::TDataServer *  tdsEval,
URANIE::DataServer::TDataServer *  tdsObs,
const char *  reference,
const char *  output,
const char *  weight = "" 
)

Standard constructor.

A TDistanceFunction object is created by providing

  • the evaluation dataserver
  • the reference dataserver
  • the list of variable that are the output reference (_nVar in total)
  • the outputs of the code (_nVar as well)
  • the observation weight (uncertainty for instance)

Referenced by ClassImp().

◆ ~TDistanceFunction()

virtual URANIE::Calibration::TDistanceFunction::~TDistanceFunction ( )
virtual

Default destructor.

Referenced by ClassImp().

Member Function Documentation

◆ addCodeLauncherOpt()

void URANIE::Calibration::TDistanceFunction::addCodeLauncherOpt ( TString  opt)
inline

add options to the already of the code launcher

References _codeLauncherOpt.

◆ changeCodeLauncherOpt()

void URANIE::Calibration::TDistanceFunction::changeCodeLauncherOpt ( TString  opt)
inline

Change the option of the code launcher.

References _codeLauncherOpt.

◆ changeLauncher()

void URANIE::Calibration::TDistanceFunction::changeLauncher ( TString  tlcName)

Change the code launcher.

Referenced by ClassImp().

◆ changeLog()

void URANIE::Calibration::TDistanceFunction::changeLog ( )
inline

References _blog.

◆ dumpAllDataservers()

void URANIE::Calibration::TDistanceFunction::dumpAllDataservers ( )
inline

References _dumpAllTds.

◆ dumpDetails()

void URANIE::Calibration::TDistanceFunction::dumpDetails ( )
inline

References _bdumpDetails.

◆ eval()

Int_t URANIE::Calibration::TDistanceFunction::eval ( Double_t *  theta,
Double_t *  res,
int  = 0 
)

Official method inherited from TSimpleEval, it is the main method of a DF It calls three methods in a row : runConfiguration, getData and localeval.

Parameters
thetavalue of the parameters to be tested (dimension _nPDar)
resoutput value of the DF (dimension 1)

Referenced by ClassImp(), ClassImp(), ClassImp(), ClassImp(), ClassImp(), and URANIE::Calibration::TABC::computeABC().

◆ fillInOutAtt()

void URANIE::Calibration::TDistanceFunction::fillInOutAtt ( URANIE::DataServer::TDataServer *  tdsPar)

Internal initialisation method.

Referenced by ClassImp().

◆ getData()

void URANIE::Calibration::TDistanceFunction::getData ( bool  reference = false)
protected

Get the data either the reference one, or the estimated one for a given parameter configuration.

Parameters
referenceboolean by default set to false.

Referenced by ClassImp(), and setUseMatrix().

◆ getLog()

Bool_t URANIE::Calibration::TDistanceFunction::getLog ( )
inline

References _blog.

◆ getObservationMatrix()

TMatrixD URANIE::Calibration::TDistanceFunction::getObservationMatrix ( )
inline

Return the observation matrix.

References _buseMatrix, and _myObs.

Referenced by ClassImp().

◆ getObservationVector()

vector< vector< double > > URANIE::Calibration::TDistanceFunction::getObservationVector ( )
inline

Return the observation vector of vector.

References _buseMatrix, and _yObs.

◆ getSaveAllEvaluation()

bool URANIE::Calibration::TDistanceFunction::getSaveAllEvaluation ( )
inline

Check the value of the saveAll option.

References _bsaveAll.

◆ getUseMatrix()

bool URANIE::Calibration::TDistanceFunction::getUseMatrix ( )
inline

Check the value of the useMatrix option.

References _buseMatrix.

◆ initParameters() [1/4]

void URANIE::Calibration::TDistanceFunction::initParameters ( URANIE::DataServer::TDataServer *  tdsPar,
const char *  funcName,
const char *  varexpinput,
const char *  varexpoutput 
)

◆ initParameters() [2/4]

void URANIE::Calibration::TDistanceFunction::initParameters ( URANIE::DataServer::TDataServer *  tdsPar,
URANIE::Launcher::TCode *  Code 
)

◆ initParameters() [3/4]

void URANIE::Calibration::TDistanceFunction::initParameters ( URANIE::DataServer::TDataServer *  tdsPar,
URANIE::Relauncher::TRun *  run 
)

Referenced by ClassImp(), and ClassImp().

◆ initParameters() [4/4]

void URANIE::Calibration::TDistanceFunction::initParameters ( URANIE::DataServer::TDataServer *  tdsPar,
void(*)(Double_t *, Double_t *)  fcn,
const char *  varexpinput,
const char *  varexpoutput 
)

◆ keepParametersValue()

void URANIE::Calibration::TDistanceFunction::keepParametersValue ( )
inline

References _keepParValue.

◆ localeval()

virtual Int_t URANIE::Calibration::TDistanceFunction::localeval ( Double_t *  res)
protectedpure virtual

Use the reference and the newly obtained estimations to compute a distance.

Parameters
resoutput value of the DF (dimension 1)

Implemented in URANIE::Calibration::TLSDistanceFunction, URANIE::Calibration::TWeightedLSDistanceFunction, URANIE::Calibration::TRelativeLSDistanceFunction, URANIE::Calibration::TL1DistanceFunction, and URANIE::Calibration::TMahalanobisDistanceFunction.

Referenced by ClassImp().

◆ printLog()

virtual void URANIE::Calibration::TDistanceFunction::printLog ( Option_t *  option = "")
virtual

Referenced by ClassImp().

◆ runConfiguration()

void URANIE::Calibration::TDistanceFunction::runConfiguration ( double *  theta)

Runs the code provided on the reference input to get estimations.

Parameters
thetavalue of the parameters to be tested (dimension _nPar)

Referenced by ClassImp(), and ClassImp().

◆ setGaussianRandomNoise()

void URANIE::Calibration::TDistanceFunction::setGaussianRandomNoise ( const char *  stdname)

Set Normal random noise for an output variable.

Referenced by ClassImp(), and URANIE::Calibration::TABC::setGaussianNoise().

◆ setLog()

void URANIE::Calibration::TDistanceFunction::setLog ( )
inline

References _blog.

Referenced by ClassImp().

◆ setObservationCovarianceMatrix()

void URANIE::Calibration::TDistanceFunction::setObservationCovarianceMatrix ( TMatrixD &  mat)

set the observatiton covariance matrix

Referenced by ClassImp(), and ClassImp().

◆ setSaveAllEvaluations()

void URANIE::Calibration::TDistanceFunction::setSaveAllEvaluations ( bool  value)
inline

Choose whether every evaluations should be kept (might slown down the process)

References _bsaveAll.

Referenced by ClassImp().

◆ setSeed()

void URANIE::Calibration::TDistanceFunction::setSeed ( UInt_t  nval)
inline

Set the seed of the random generator if one is used.

References _nSeed.

◆ setUseMatrix()

void URANIE::Calibration::TDistanceFunction::setUseMatrix ( bool  value)
inline

Choose whether vector of vector or matrix should be used in the distance function localeval method.

References _buseMatrix, and getData().

Referenced by ClassImp().

◆ setVarWeights() [1/2]

void URANIE::Calibration::TDistanceFunction::setVarWeights ( int  nwei,
double *  wei 
)

Set a weight to ponderate variable when _nVar >1.

Referenced by ClassImp().

◆ setVarWeights() [2/2]

void URANIE::Calibration::TDistanceFunction::setVarWeights ( vector< double >  wei)

Set a weight to ponderate variable when _nVar >1.

◆ unsetLog()

void URANIE::Calibration::TDistanceFunction::unsetLog ( )
inline

References _blog.

Member Data Documentation

◆ _allData

URANIE::DataServer::TDSNtupleD* URANIE::Calibration::TDistanceFunction::_allData

pointer toward the reference dataserver

Referenced by ClassImp().

◆ _baprioriSet

bool URANIE::Calibration::TDistanceFunction::_baprioriSet
protected

Whether apriori is set to evaluator.

Referenced by ClassImp().

◆ _bdumpDetails

bool URANIE::Calibration::TDistanceFunction::_bdumpDetails
protected

Dump the details in Distance Computation.

Referenced by dumpDetails().

◆ _blog

bool URANIE::Calibration::TDistanceFunction::_blog
protected

Boolean to decide if the log information is shown or not.

Referenced by changeLog(), ClassImp(), getLog(), setLog(), and unsetLog().

◆ _boolNoise

bool URANIE::Calibration::TDistanceFunction::_boolNoise
protected

Whether noise is add to the output.

Referenced by ClassImp().

◆ _bsaveAll

bool URANIE::Calibration::TDistanceFunction::_bsaveAll
protected

Whether all evaluations should be saved, not only a priori and a posteriori.

Referenced by ClassImp(), getSaveAllEvaluation(), and setSaveAllEvaluations().

◆ _buseMatrix

bool URANIE::Calibration::TDistanceFunction::_buseMatrix
protected

Use matrix instead of vectors.

Referenced by ClassImp(), getObservationMatrix(), getObservationVector(), getUseMatrix(), and setUseMatrix().

◆ _code

URANIE::Launcher::TCode* URANIE::Calibration::TDistanceFunction::_code
protected

Referenced by ClassImp().

◆ _codeLauncherOpt

TString URANIE::Calibration::TDistanceFunction::_codeLauncherOpt
protected

Option for code launcher.

Referenced by addCodeLauncherOpt(), changeCodeLauncherOpt(), and ClassImp().

◆ _dumpAllTds

bool URANIE::Calibration::TDistanceFunction::_dumpAllTds
protected

dump all tested dataserver;

Referenced by ClassImp(), and dumpAllDataservers().

◆ _funcName

TString URANIE::Calibration::TDistanceFunction::_funcName
protected

Referenced by ClassImp().

◆ _icalc

int URANIE::Calibration::TDistanceFunction::_icalc
protected

Calcul iterator;.

Referenced by ClassImp().

◆ _iobs

unsigned int URANIE::Calibration::TDistanceFunction::_iobs
protected

◆ _ivar

unsigned int URANIE::Calibration::TDistanceFunction::_ivar
protected

Referenced by ClassImp().

◆ _keepParValue

bool URANIE::Calibration::TDistanceFunction::_keepParValue
protected

Keep the parameters values in runner case.

Referenced by ClassImp(), and keepParametersValue().

◆ _listOfParameters

TList* URANIE::Calibration::TDistanceFunction::_listOfParameters
protected

list of parameters

Referenced by ClassImp().

◆ _mObsCovMat

TMatrixD URANIE::Calibration::TDistanceFunction::_mObsCovMat
protected

Observation Covariance matrix.

Referenced by ClassImp().

◆ _mSigma

TMatrixD URANIE::Calibration::TDistanceFunction::_mSigma
protected

Vector of variance of errors.

Referenced by ClassImp().

◆ _myExp

TMatrixD URANIE::Calibration::TDistanceFunction::_myExp
protected

Vector of tested values (size: _nVar <_nObs>)

Referenced by ClassImp().

◆ _myObs

TMatrixD URANIE::Calibration::TDistanceFunction::_myObs
protected

Vector of observations outputs (size: _nVar < _nObs >)

Referenced by ClassImp(), and getObservationMatrix().

◆ _nObs

unsigned int URANIE::Calibration::TDistanceFunction::_nObs
protected

Number of observations.

Referenced by ClassImp().

◆ _nPar

unsigned int URANIE::Calibration::TDistanceFunction::_nPar
protected

Number of Parameters;.

Referenced by ClassImp().

◆ _nSeed

int URANIE::Calibration::TDistanceFunction::_nSeed
protected

The seed of the random generator.

Referenced by ClassImp(), and setSeed().

◆ _nVar

unsigned int URANIE::Calibration::TDistanceFunction::_nVar
protected

Number of variables;.

Referenced by ClassImp().

◆ _obsWeights

vector<vector<double> > URANIE::Calibration::TDistanceFunction::_obsWeights
protected

Vector of observation weights outputs (size: _nObs)

◆ _pFunction

void(* URANIE::Calibration::TDistanceFunction::_pFunction) (double *, double *)
protected

Function pointer.

Referenced by ClassImp().

◆ _rand

TRandom3* URANIE::Calibration::TDistanceFunction::_rand
protected

The random generator.

Referenced by ClassImp().

◆ _run

URANIE::Relauncher::TRun* URANIE::Calibration::TDistanceFunction::_run
protected

Referenced by ClassImp().

◆ _tdsEval

URANIE::DataServer::TDataServer* URANIE::Calibration::TDistanceFunction::_tdsEval

pointer toward the evaluation dataserver

Referenced by ClassImp().

◆ _tdsObs

URANIE::DataServer::TDataServer* URANIE::Calibration::TDistanceFunction::_tdsObs

pointer toward the reference dataserver

Referenced by ClassImp().

◆ _tlcType

TString URANIE::Calibration::TDistanceFunction::_tlcType
protected

Referenced by ClassImp().

◆ _varexpinput

TString URANIE::Calibration::TDistanceFunction::_varexpinput
protected

Referenced by ClassImp().

◆ _varexpoutput

TString URANIE::Calibration::TDistanceFunction::_varexpoutput
protected

Referenced by ClassImp().

◆ _varWeights

vector<double> URANIE::Calibration::TDistanceFunction::_varWeights
protected

Vector of variable weights (size: _nVar)

Referenced by ClassImp().

◆ _voutName

vector<string> URANIE::Calibration::TDistanceFunction::_voutName
protected

Vector of output name.

Referenced by ClassImp().

◆ _vparName

vector<string> URANIE::Calibration::TDistanceFunction::_vparName
protected

Vector of parameters name.

Referenced by ClassImp().

◆ _vParValues

vector<double> URANIE::Calibration::TDistanceFunction::_vParValues
protected

Referenced by ClassImp().

◆ _vrefName

vector<string> URANIE::Calibration::TDistanceFunction::_vrefName
protected

Vector of reference name.

Referenced by ClassImp().

◆ _yExp

vector<vector<double> > URANIE::Calibration::TDistanceFunction::_yExp
protected

Vector of tested values (size: _nVar <_nObs>)

Referenced by ClassImp().

◆ _yObs

vector<vector<double> > URANIE::Calibration::TDistanceFunction::_yObs
protected

Vector of observations outputs (size: _nVar < _nObs >)

Referenced by ClassImp(), and getObservationVector().