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::TCalibration Class Reference
Uranie / Calibration v4.9.0
/* @license-end */
URANIE::Calibration::TCalibration Class Referenceabstract

Description of the class TCalibration. More...

#include <TCalibration.h>

Inheritance diagram for URANIE::Calibration::TCalibration:
Collaboration diagram for URANIE::Calibration::TCalibration:

Public Member Functions

Constructor and Destructor
 TCalibration (URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run, int ns=1, Option_t *option="")
 Default constructor with the runner argument: it contains the assessor to be used.
 
 TCalibration (URANIE::DataServer::TDataServer *tds, void(*fcn)(Double_t *, Double_t *), const char *varexpinput, const char *varexpoutput, int ns=1, Option_t *option="")
 Default Calibration constructor with the function argument: it contains the assessor to be used.
 
 TCalibration (URANIE::DataServer::TDataServer *tds, const char *fcn, const char *varexpinput, const char *varexpoutput, int ns=1, Option_t *option="")
 Default Calibration constructor with the function argument: it contains the assessor to be used.
 
 TCalibration (URANIE::DataServer::TDataServer *tds, URANIE::Launcher::TCode *fcode, int ns=1, const char *option="")
 Default Calibration constructor with the code argument: it contains the assessor to be used.
 
virtual ~TCalibration ()
 Default destructor.
 
Initialisation methods
virtual void setDistanceAndReference (const char *funcName, URANIE::DataServer::TDataServer *tdsRef, const char *input, const char *reference, const char *weight="")
 Set the distance function and some needed informations.
 
virtual void setDistanceAndReference (URANIE::Calibration::TDistanceFunction *distFunc, URANIE::DataServer::TDataServer *tdsRef, const char *input, const char *reference, const char *weight="")
 Set the distance function and some needed informations.
 
launching method
void estimateParameters (Option_t *option="")
 
void estimateCustomResidues (string resName, int n_theta, double *theta)
 
void checkReference (URANIE::DataServer::TDataServer *tdsRef, const char *input, const char *output, const char *weight)
 Check the consistency of the formation provided.
 
drawing method
virtual void drawParameters (TString sTitre, const char *variable="*", const char *select="1>0", Option_t *option="")
 
void drawResidues (TString sTitre, const char *variable="*", const char *select="1>0", Option_t *option="")
 
Printing Log
void setLog ()
 
void unsetLog ()
 
void changeLog ()
 
Bool_t getLog ()
 
virtual void printLog (Option_t *option="")
 

Protected Member Functions

Internal methods
virtual void computeParameters (Option_t *option="")=0
 internal method in which the estimation is performed for all inheriting classes
 
virtual void checktdsParContent ()=0
 
void checkCanvasCreation (bool newcan)
 Create a canvas if needed.
 
void initInputs ()
 Initialise some common inputs.
 
void initResults (vector< string > *ParsedLines)
 Initialise some common inputs.
 
void computeAPosterioriForDistribution ()
 Compute the a posteriori residual for many-solutions method.
 
Parse the option
virtual void parseOption (Option_t *option="")
 Read the possible options.
 

attributes

enum  ELauncher { kCode , kFunction , kRun , kUnknown }
 
URANIE::DataServer::TDataServer * _tdsPar
 TDS containing parameters properties (parameters that should be calibrated)
 
URANIE::DataServer::TDataServer * _tdsObs
 TDS containing observations used for calibration.
 
URANIE::DataServer::TDataServer * _tdsEval
 TDS containing a priori / a posteriori evaluations.
 
ELauncher _nLauncher
 The type of launcher.
 
TString _sFunctionName
 The Name of the evaluatuor.
 
TString _sEI
 The Name of input.
 
TString _sEO
 The Name of output.
 
URANIE::Launcher::TCode * _code
 The tcode.
 
URANIE::Relauncher::TRun * _run
 Pointer to the runner to be used.
 
void(* _pFunction )(double *, double *)
 Function pointer.
 
vector< URANIE::DataServer::TStochasticAttribute * > _vatt
 internal vector of stochastic attribute for some methods
 
URANIE::Calibration::TDistanceFunction_dFunc
 Pointer to chosen distance function.
 
URANIE::DataServer::TDSNtupleD * _evTuple
 Pointer to the eval ntuple.
 
TList * _listOfParameters
 List of the parameters to be calibrated.
 
TCanvas * _canvas
 Canvas object to deal with.
 
TObjArray * _drawingGarbageCollector
 Garbage collector for prints.
 
int _nSam
 The number of sample in a posteriori distributions.
 
int _nObs
 The number of observations in the reference database.
 
int _nIterMax
 The maximum number of iteration allowed (meaning total number of code estimation is _nIterMax * _nObs)
 
int _nPar
 Dimension of the parameters.
 
int _nVar
 Dimension of the output and references to be compared with.
 
int _nSeed
 The seed of the random generator.
 
TString _sMethodName
 The method name.
 
TString _referenceName
 The reference name.
 
TString _outputName
 The output name.
 
vector< string > _vrefName
 The reference names.
 
vector< string > _voutName
 The output names.
 
TString _weightName
 The weight name.
 
TMatrixD _mObsCovMat
 Observation Covariance matrix.
 
bool _buseMatrix
 Use matrix instead of vectors in the Distance Function.
 
bool _bsaveAll
 Whether all evaluations should be saved, not only a priori and a posteriori.
 
bool _bdontKeepAgreement
 Remove the agreement attribute from the tdsPar object.
 
bool _buseMode
 Use Mode instead of Mean.
 
Bool_t _blog
 Boolean for edit the log.
 

Setting and Getting attributs

Int_t getID ()
 
void setSeed (UInt_t nval)
 Set the seed of the random generator if one is used.
 
UInt_t getSeed ()
 Get the seed of the random generator if one is used.
 
const char * getMethodName ()
 Get the method name.
 
void setObservationCovarianceMatrix (TMatrixD &mat)
 Set the observatiton covariance matrix.
 
URANIE::Calibration::TDistanceFunctiongetDistanceFunction ()
 Return the distance function.
 
Int_t getNPar ()
 Get the number of parameters to be calibrated.
 
URANIE::DataServer::TDataServer * getEvaluationTDS ()
 Get the tds in which evaluation will be performed.
 
void setMethodName (const char *str)
 Set the Method name.
 

Detailed Description

Description of the class TCalibration.

Member Enumeration Documentation

◆ ELauncher

Enumerator
kCode 
kFunction 
kRun 
kUnknown 

Constructor & Destructor Documentation

◆ TCalibration() [1/4]

URANIE::Calibration::TCalibration::TCalibration ( URANIE::DataServer::TDataServer *  tds,
URANIE::Relauncher::TRun *  run,
int  ns = 1,
Option_t *  option = "" 
)

Default constructor with the runner argument: it contains the assessor to be used.

Parameters
tds: the dataserver that contains no data but only one attribute per parameter to be calibrated
run: the runner that contains the assessor to be used on the reference data
ns: number of sample to be generated (depending on the method)
option: see parseOption below

Referenced by ClassImp().

◆ TCalibration() [2/4]

URANIE::Calibration::TCalibration::TCalibration ( URANIE::DataServer::TDataServer *  tds,
void(*)(Double_t *, Double_t *)  fcn,
const char *  varexpinput,
const char *  varexpoutput,
int  ns = 1,
Option_t *  option = "" 
)

Default Calibration constructor with the function argument: it contains the assessor to be used.

Parameters
tds: the dataserver that contains no data but only one attribute per parameter to be calibrated
fcn: the pointer to a function
ns: number of sample to be generated (depending on the method)
varexpinput: the input variable for the function in the correct order (both input and parameters)
varexpoutput: the output of the function in the correct order

◆ TCalibration() [3/4]

URANIE::Calibration::TCalibration::TCalibration ( URANIE::DataServer::TDataServer *  tds,
const char *  fcn,
const char *  varexpinput,
const char *  varexpoutput,
int  ns = 1,
Option_t *  option = "" 
)

Default Calibration constructor with the function argument: it contains the assessor to be used.

Parameters
tds: the dataserver that contains no data but only one attribute per parameter to be calibrated
fcn: the name of the function
ns: number of sample to be generated (depending on the method)
varexpinput: the input variable for the function in the correct order (both input and parameters)
varexpoutput: the output of the function in the correct order

◆ TCalibration() [4/4]

URANIE::Calibration::TCalibration::TCalibration ( URANIE::DataServer::TDataServer *  tds,
URANIE::Launcher::TCode *  fcode,
int  ns = 1,
const char *  option = "" 
)

Default Calibration constructor with the code argument: it contains the assessor to be used.

Parameters
tds: the dataserver that contains no data but only one attribute per parameter to be calibrated
code: the code object that will be runned
ns: number of sample to be generated (depending on the method)

◆ ~TCalibration()

virtual URANIE::Calibration::TCalibration::~TCalibration ( )
virtual

Default destructor.

Referenced by ClassImp().

Member Function Documentation

◆ changeLog()

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

References _blog.

◆ checkCanvasCreation()

void URANIE::Calibration::TCalibration::checkCanvasCreation ( bool  newcan)
protected

Create a canvas if needed.

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

◆ checkReference()

void URANIE::Calibration::TCalibration::checkReference ( URANIE::DataServer::TDataServer *  tdsRef,
const char *  input,
const char *  output,
const char *  weight 
)

Check the consistency of the formation provided.

Referenced by ClassImp().

◆ checktdsParContent()

virtual void URANIE::Calibration::TCalibration::checktdsParContent ( )
protectedpure virtual

◆ computeAPosterioriForDistribution()

void URANIE::Calibration::TCalibration::computeAPosterioriForDistribution ( )
protected

Compute the a posteriori residual for many-solutions method.

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

◆ computeParameters()

virtual void URANIE::Calibration::TCalibration::computeParameters ( Option_t *  option = "")
protectedpure virtual

internal method in which the estimation is performed for all inheriting classes

Implemented in URANIE::Calibration::TLinearBayesian, URANIE::Calibration::TMetropHasting, URANIE::Calibration::TMinimisation, URANIE::Calibration::TPMCABC, and URANIE::Calibration::TRejectionABC.

Referenced by ClassImp().

◆ drawParameters()

virtual void URANIE::Calibration::TCalibration::drawParameters ( TString  sTitre,
const char *  variable = "*",
const char *  select = "1>0",
Option_t *  option = "" 
)
virtual

brief Draws the parameters (only skeleton, at this level it is empty)

Parameters
sTitretitle of the plots if specified
variablelist of variables that should be plotted
selectselection pattern, if this is requested and possible
optionpossible option for this plot

Reimplemented in URANIE::Calibration::TLinearBayesian, and URANIE::Calibration::TMetropHasting.

Referenced by ClassImp().

◆ drawResidues()

void URANIE::Calibration::TCalibration::drawResidues ( TString  sTitre,
const char *  variable = "*",
const char *  select = "1>0",
Option_t *  option = "" 
)

brief Draws the residuals meaning the difference between the reference and the estimation a priori and a posteriori Depending whether the method use point-wise or distribution-wise the apriori and a posteriori estimatiton are :

  • from a single point for TMinimisation: initialisaiton for a priori and result for a posteriori
  • the mode and mean for TLinearBayesian as the hypothesis are gaussian prior and analytical posterior
  • the mode from TMetropHasting for a prior and the mean_of the a posteriorie parameters distributions, or the MAP (mode a posteriori) estimated from an internal smoothing
    Parameters
    sTitretitle of the plots if specified
    variablelist of variables that should be plotted
    selectselection pattern, if this is requested (on the number of events from the reference for instance or with respect to input value for diagnostic)
    optionpossible option for this plot
  • "nonewcanvas": don't create a new canvas, but use the one active
  • "apriori": draw only a priori residuals (default is both)
  • "aposteriori": draw only a posteriori residuals (default is both)
  • "vertical" : if there are several parameters to be shown put them on top of another instead of side by side

Referenced by ClassImp().

◆ estimateCustomResidues()

void URANIE::Calibration::TCalibration::estimateCustomResidues ( string  resName,
int  n_theta,
double *  theta 
)

Referenced by ClassImp().

◆ estimateParameters()

void URANIE::Calibration::TCalibration::estimateParameters ( Option_t *  option = "")

Referenced by ClassImp().

◆ getDistanceFunction()

URANIE::Calibration::TDistanceFunction * URANIE::Calibration::TCalibration::getDistanceFunction ( )
inline

Return the distance function.

References _dFunc.

◆ getEvaluationTDS()

URANIE::DataServer::TDataServer * URANIE::Calibration::TCalibration::getEvaluationTDS ( )
inline

Get the tds in which evaluation will be performed.

References _tdsEval.

◆ getID()

Int_t URANIE::Calibration::TCalibration::getID ( )
inline

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

◆ getLog()

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

References _blog.

◆ getMethodName()

const char * URANIE::Calibration::TCalibration::getMethodName ( )
inline

Get the method name.

References _sMethodName.

◆ getNPar()

Int_t URANIE::Calibration::TCalibration::getNPar ( )
inline

Get the number of parameters to be calibrated.

Returns
The number of parameters ( _nPar )

References _nPar.

◆ getSeed()

UInt_t URANIE::Calibration::TCalibration::getSeed ( )
inline

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

References _nSeed.

◆ initInputs()

void URANIE::Calibration::TCalibration::initInputs ( )
protected

Initialise some common inputs.

Referenced by ClassImp().

◆ initResults()

void URANIE::Calibration::TCalibration::initResults ( vector< string > *  ParsedLines)
protected

Initialise some common inputs.

Referenced by ClassImp().

◆ parseOption()

virtual void URANIE::Calibration::TCalibration::parseOption ( Option_t *  option = "")
protectedvirtual

Read the possible options.

Possible options are (common to all methods)

  • "savealleval": keep all estimation in the _tdsEval (Extremely dangerous as it will keep _nIter branches with _nObs estimations. This option might slow down the process.
  • "usematrix" : option use to specify that computation is done with matrices instead of vector<vector<double> >. Shoud be used only if one is using an home-made TDistanceFunction

Reimplemented in URANIE::Calibration::TMetropHasting, and URANIE::Calibration::TMinimisation.

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

◆ printLog()

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

◆ setDistanceAndReference() [1/2]

virtual void URANIE::Calibration::TCalibration::setDistanceAndReference ( const char *  funcName,
URANIE::DataServer::TDataServer *  tdsRef,
const char *  input,
const char *  reference,
const char *  weight = "" 
)
virtual

Set the distance function and some needed informations.

Parameters
funcNamename of the distance function chosen among the already implemented ones:
  • "LS" for least square
  • "weighterLS" for weighted least square
  • "relativeLS" for relative least square
  • "L1" for L1 norm
  • "Mahalanobis" for Mahalanobis distance function
tdsRef: the dataserver that contains all needed information detailled below
  • input: the input attributes used of the assessors in run
  • reference: the reference attributes that will be used to compared the newly done estimations for every iterations
  • weight: a weight to reweight every event, one-by-one (an experimental uncertainty for instance)

Reimplemented in URANIE::Calibration::TLinearBayesian, and URANIE::Calibration::TMetropHasting.

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

◆ setDistanceAndReference() [2/2]

virtual void URANIE::Calibration::TCalibration::setDistanceAndReference ( URANIE::Calibration::TDistanceFunction distFunc,
URANIE::DataServer::TDataServer *  tdsRef,
const char *  input,
const char *  reference,
const char *  weight = "" 
)
virtual

Set the distance function and some needed informations.

Parameters
distFunca pointer to a TDistanceFunction object (not usual, recommended only when dealing with a home-made distance unction compiled on the spot)
tdsRef: the dataserver that contains all needed information detailled below
  • input: the input attributes used of the assessors in run
  • reference: the reference attributes that will be used to compared the newly done estimations for every iterations
  • weight: a weight to reweight every event, one-by-one (an experimental uncertainty for instance)

Reimplemented in URANIE::Calibration::TLinearBayesian, and URANIE::Calibration::TMetropHasting.

◆ setLog()

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

References _blog.

◆ setMethodName()

void URANIE::Calibration::TCalibration::setMethodName ( const char *  str)
inlineprotected

◆ setObservationCovarianceMatrix()

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

Set the observatiton covariance matrix.

Parameters
mat: a _nObs * _nObs covariance matrix

Referenced by ClassImp().

◆ setSeed()

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

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

References _nSeed.

◆ unsetLog()

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

References _blog.

Member Data Documentation

◆ _bdontKeepAgreement

bool URANIE::Calibration::TCalibration::_bdontKeepAgreement
protected

Remove the agreement attribute from the tdsPar object.

Referenced by ClassImp().

◆ _blog

◆ _bsaveAll

bool URANIE::Calibration::TCalibration::_bsaveAll
protected

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

Referenced by ClassImp().

◆ _buseMatrix

bool URANIE::Calibration::TCalibration::_buseMatrix
protected

Use matrix instead of vectors in the Distance Function.

Referenced by ClassImp().

◆ _buseMode

bool URANIE::Calibration::TCalibration::_buseMode
protected

Use Mode instead of Mean.

Referenced by ClassImp().

◆ _canvas

TCanvas* URANIE::Calibration::TCalibration::_canvas
protected

Canvas object to deal with.

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

◆ _code

URANIE::Launcher::TCode* URANIE::Calibration::TCalibration::_code

The tcode.

Referenced by ClassImp().

◆ _dFunc

◆ _drawingGarbageCollector

TObjArray* URANIE::Calibration::TCalibration::_drawingGarbageCollector
protected

Garbage collector for prints.

Referenced by ClassImp(), and ClassImp().

◆ _evTuple

URANIE::DataServer::TDSNtupleD* URANIE::Calibration::TCalibration::_evTuple
protected

Pointer to the eval ntuple.

Referenced by ClassImp().

◆ _listOfParameters

TList* URANIE::Calibration::TCalibration::_listOfParameters
protected

◆ _mObsCovMat

TMatrixD URANIE::Calibration::TCalibration::_mObsCovMat
protected

Observation Covariance matrix.

Referenced by ClassImp(), and ClassImp().

◆ _nIterMax

int URANIE::Calibration::TCalibration::_nIterMax
protected

The maximum number of iteration allowed (meaning total number of code estimation is _nIterMax * _nObs)

Referenced by ClassImp(), ClassImp(), and URANIE::Calibration::TRejectionABC::computeParameters().

◆ _nLauncher

ELauncher URANIE::Calibration::TCalibration::_nLauncher

The type of launcher.

Referenced by ClassImp().

◆ _nObs

int URANIE::Calibration::TCalibration::_nObs
protected

The number of observations in the reference database.

Referenced by ClassImp(), and ClassImp().

◆ _nPar

◆ _nSam

int URANIE::Calibration::TCalibration::_nSam
protected

The number of sample in a posteriori distributions.

Referenced by ClassImp(), ClassImp(), ClassImp(), ClassImp(), ClassImp(), and URANIE::Calibration::TRejectionABC::computeParameters().

◆ _nSeed

int URANIE::Calibration::TCalibration::_nSeed
protected

The seed of the random generator.

Referenced by ClassImp(), ClassImp(), ClassImp(), ClassImp(), getSeed(), setSeed(), and URANIE::Calibration::TABC::setUpABC().

◆ _nVar

int URANIE::Calibration::TCalibration::_nVar
protected

Dimension of the output and references to be compared with.

Referenced by ClassImp().

◆ _outputName

TString URANIE::Calibration::TCalibration::_outputName
protected

The output name.

Referenced by ClassImp().

◆ _pFunction

void(* URANIE::Calibration::TCalibration::_pFunction) (double *, double *)

Function pointer.

Referenced by ClassImp().

◆ _referenceName

TString URANIE::Calibration::TCalibration::_referenceName
protected

The reference name.

Referenced by ClassImp().

◆ _run

URANIE::Relauncher::TRun* URANIE::Calibration::TCalibration::_run

Pointer to the runner to be used.

Referenced by ClassImp().

◆ _sEI

TString URANIE::Calibration::TCalibration::_sEI

The Name of input.

Referenced by ClassImp().

◆ _sEO

TString URANIE::Calibration::TCalibration::_sEO

The Name of output.

Referenced by ClassImp().

◆ _sFunctionName

TString URANIE::Calibration::TCalibration::_sFunctionName

The Name of the evaluatuor.

Referenced by ClassImp().

◆ _sMethodName

TString URANIE::Calibration::TCalibration::_sMethodName
protected

The method name.

Referenced by ClassImp(), ClassImp(), ClassImp(), getMethodName(), and setMethodName().

◆ _tdsEval

URANIE::DataServer::TDataServer* URANIE::Calibration::TCalibration::_tdsEval

TDS containing a priori / a posteriori evaluations.

Referenced by ClassImp(), ClassImp(), ClassImp(), and getEvaluationTDS().

◆ _tdsObs

URANIE::DataServer::TDataServer* URANIE::Calibration::TCalibration::_tdsObs

TDS containing observations used for calibration.

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

◆ _tdsPar

◆ _vatt

vector<URANIE::DataServer::TStochasticAttribute*> URANIE::Calibration::TCalibration::_vatt

internal vector of stochastic attribute for some methods

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

◆ _voutName

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

The output names.

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

◆ _vrefName

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

The reference names.

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

◆ _weightName

TString URANIE::Calibration::TCalibration::_weightName
protected

The weight name.

Referenced by ClassImp().