Documentation / Manuel développeur
Modules disponibles
Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,  
Uranie / Calibration v4.9.0
|
Description of the class TDistanceFunction. More...
#include <TDistanceFunction.h>
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 |
Default destructor.
Referenced by ClassImp().
Member Function Documentation
◆ addCodeLauncherOpt()
|
inline |
add options to the already of the code launcher
References _codeLauncherOpt.
◆ changeCodeLauncherOpt()
|
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()
|
inline |
References _blog.
◆ dumpAllDataservers()
|
inline |
References _dumpAllTds.
◆ 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
-
theta value of the parameters to be tested (dimension _nPDar) res output 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()
|
protected |
Get the data either the reference one, or the estimated one for a given parameter configuration.
- Parameters
-
reference boolean by default set to false.
Referenced by ClassImp(), and setUseMatrix().
◆ getLog()
|
inline |
References _blog.
◆ getObservationMatrix()
|
inline |
◆ getObservationVector()
|
inline |
Return the observation vector of vector.
References _buseMatrix, and _yObs.
◆ getSaveAllEvaluation()
|
inline |
Check the value of the saveAll option.
References _bsaveAll.
◆ 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()
|
inline |
References _keepParValue.
◆ localeval()
|
protectedpure virtual |
Use the reference and the newly obtained estimations to compute a distance.
- Parameters
-
res output 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 |
Referenced by ClassImp().
◆ runConfiguration()
void URANIE::Calibration::TDistanceFunction::runConfiguration | ( | double * | theta | ) |
Runs the code provided on the reference input to get estimations.
- Parameters
-
theta value 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()
|
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()
|
inline |
Choose whether every evaluations should be kept (might slown down the process)
References _bsaveAll.
Referenced by ClassImp().
◆ setSeed()
|
inline |
Set the seed of the random generator if one is used.
References _nSeed.
◆ setUseMatrix()
|
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()
|
inline |
References _blog.
Member Data Documentation
◆ _allData
URANIE::DataServer::TDSNtupleD* URANIE::Calibration::TDistanceFunction::_allData |
pointer toward the reference dataserver
Referenced by ClassImp().
◆ _baprioriSet
|
protected |
Whether apriori is set to evaluator.
Referenced by ClassImp().
◆ _bdumpDetails
|
protected |
Dump the details in Distance Computation.
Referenced by dumpDetails().
◆ _blog
|
protected |
Boolean to decide if the log information is shown or not.
Referenced by changeLog(), ClassImp(), getLog(), setLog(), and unsetLog().
◆ _boolNoise
|
protected |
Whether noise is add to the output.
Referenced by ClassImp().
◆ _bsaveAll
|
protected |
Whether all evaluations should be saved, not only a priori and a posteriori.
Referenced by ClassImp(), getSaveAllEvaluation(), and setSaveAllEvaluations().
◆ _buseMatrix
|
protected |
Use matrix instead of vectors.
Referenced by ClassImp(), getObservationMatrix(), getObservationVector(), getUseMatrix(), and setUseMatrix().
◆ _code
|
protected |
Referenced by ClassImp().
◆ _codeLauncherOpt
|
protected |
Option for code launcher.
Referenced by addCodeLauncherOpt(), changeCodeLauncherOpt(), and ClassImp().
◆ _dumpAllTds
|
protected |
dump all tested dataserver;
Referenced by ClassImp(), and dumpAllDataservers().
◆ _funcName
|
protected |
Referenced by ClassImp().
◆ _icalc
|
protected |
Calcul iterator;.
Referenced by ClassImp().
◆ _iobs
|
protected |
◆ _ivar
|
protected |
Referenced by ClassImp().
◆ _keepParValue
|
protected |
Keep the parameters values in runner case.
Referenced by ClassImp(), and keepParametersValue().
◆ _listOfParameters
|
protected |
list of parameters
Referenced by ClassImp().
◆ _mObsCovMat
|
protected |
Observation Covariance matrix.
Referenced by ClassImp().
◆ _mSigma
|
protected |
Vector of variance of errors.
Referenced by ClassImp().
◆ _myExp
|
protected |
Vector of tested values (size: _nVar <_nObs>)
Referenced by ClassImp().
◆ _myObs
|
protected |
Vector of observations outputs (size: _nVar < _nObs >)
Referenced by ClassImp(), and getObservationMatrix().
◆ _nObs
|
protected |
Number of observations.
Referenced by ClassImp().
◆ _nPar
|
protected |
Number of Parameters;.
Referenced by ClassImp().
◆ _nSeed
|
protected |
The seed of the random generator.
Referenced by ClassImp(), and setSeed().
◆ _nVar
|
protected |
Number of variables;.
Referenced by ClassImp().
◆ _obsWeights
|
protected |
Vector of observation weights outputs (size: _nObs)
◆ _pFunction
|
protected |
Function pointer.
Referenced by ClassImp().
◆ _rand
|
protected |
The random generator.
Referenced by ClassImp().
◆ _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
|
protected |
Referenced by ClassImp().
◆ _varexpinput
|
protected |
Referenced by ClassImp().
◆ _varexpoutput
|
protected |
Referenced by ClassImp().
◆ _varWeights
|
protected |
Vector of variable weights (size: _nVar)
Referenced by ClassImp().
◆ _voutName
|
protected |
Vector of output name.
Referenced by ClassImp().
◆ _vparName
|
protected |
Vector of parameters name.
Referenced by ClassImp().
◆ _vParValues
|
protected |
Referenced by ClassImp().
◆ _vrefName
|
protected |
Vector of reference name.
Referenced by ClassImp().
◆ _yExp
|
protected |
Vector of tested values (size: _nVar <_nObs>)
Referenced by ClassImp().
◆ _yObs
|
protected |
Vector of observations outputs (size: _nVar < _nObs >)
Referenced by ClassImp(), and getObservationVector().