Documentation / Manuel développeur
Modules disponibles
Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,  ![]() |
Uranie / Optimizer
v4.10.0
|
Description of the class TOptimizer. More...
#include <TOptimizer.h>


Public Types | |
| enum | EOptimType { kMinimizeCode, kMinimizeFunction, kSumOfSquare } |
| enum | EOptimMethod { kMigrad, kSimplex, kCombined, kScan } |
Public Member Functions | |
Constructor and Destructor | |
| TOptimizer (URANIE::DataServer::TDataServer *tds, URANIE::Launcher::TCode *code) | |
| Constructor with a dataserver. More... | |
| TOptimizer (URANIE::DataServer::TDataServer *tds, void(*fcn)(Double_t *, Double_t *), TString sinput, TString soutput) | |
| Constructor by a TDataServer, a function and list of input and output (optional) More... | |
| TOptimizer (URANIE::DataServer::TDataServer *tds, const char *fcn, TString sinput="", TString soutput="") | |
| Constructor by a TDataServer, a function name and list of input and output (optional) More... | |
| virtual | ~TOptimizer () |
| Default destructor. More... | |
Set/Get parameters | |
| void | setTolerance (Double_t dtol) |
| Set the tolerance parameter. More... | |
| Double_t | getTolerance () |
| Get the tolerance parameter. More... | |
| void | setMaxIterations (Int_t nmax) |
| Set the maximum number of iterations. More... | |
| Int_t | getMaxIterations () |
| Get the maximum number of iterations. More... | |
| void | setMaxFunctionCalls (Int_t nmax) |
| Set the maximum number of evaluations. More... | |
| Int_t | getMaxFunctionCalls () |
| Get the maximum numbers of evaluations. More... | |
Set/Get the method of Optimization | |
These classe is a wrapper with the TMinuit library interfaced in ROOT which contains several algorithm of optimization :
| |
| void | setMethod (EOptimMethod method=kMigrad) |
| Select the algorithm of optimization. More... | |
| EOptimMethod | getMethod () |
| Return the algorithm of optimization. More... | |
| EOptimType | getOptimType () |
| Return the type of optimization. More... | |
| void | setPrintLevel (int level) |
| Set the print Level of Debug between \( [1, 5]\). More... | |
| int | getPrintLevel () const |
| Get the print Level of Debug between \( [1, 5]\). More... | |
Manipulate the code | |
| virtual void | init (Option_t *option="") |
| Init phase of the code. More... | |
| virtual void | optimize (Option_t *option="") |
| Runs phase of the code (TMinuit2) More... | |
| virtual void | terminate (Option_t *option="") |
| Terminates phase of the code. More... | |
| virtual void | clean (Option_t *option="") |
| Cleans the working directory of the code. More... | |
Manipulate the Objectives | |
In the case of calibration of code, we can define one or several "Objectives" to specify the criteria to minimize. The criteria to minimize is a sum of weighted objectives: \[ C = \sum_{i=1}^{nO}{\omega_i Obj_{i}} \] By default, all added objectives are "active" and the weight \( \omega = 1.0\). | |
| void | addObjective (TString name, URANIE::DataServer::TDataServer *tds, TString ystar, URANIE::Launcher::TOutputFile *outfile, TString yhat, Double_t weight=1.0) |
| Add the objective in the TOptimizer object : Sum of square of the error. More... | |
| void | addObjective (TString name, URANIE::DataServer::TDataServer *tds, TString ystar, TString sigma, URANIE::Launcher::TOutputFile *outfile, TString yhat, Double_t alpha=1.0) |
| Add the objective in the TOptimizer object : Sum of square of the weighted error. More... | |
| void | unactiveObjective (TString name) |
| Unactive the objective given by these name. More... | |
| void | activeObjective (TString name) |
| Active the objective given by these name. More... | |
| void | invertObjectives () |
| Invert the state of all the objectives. More... | |
| vector< URANIE::Optimizer::TObjective *> | getObjectives () |
| get the vector containing the objectives More... | |
| void | addOutputVariable (TString soutput) |
| Add input and output variables. More... | |
| void | selectCost (TString scost) |
| Select an cost in the Output string. More... | |
| TString | getSelectedCost () |
| Get the selected Select an cost in the Output string. More... | |
Manipulate the parameters | |
At any time, we can change the state of the parameters; it can be fix to the default value or it can be variable in these range. | |
| void | fixParameter (TString name) |
| Fix the parameter given by these name to the default value. More... | |
| void | unfixParameter (TString name) |
| Unfix the parameter given by these name. More... | |
| void | invertParameters () |
| Invert the state of all the parameters. More... | |
Printing Log | |
| void | printState (Option_t *option="") |
| Print the state of the algorithm of optimization. More... | |
| virtual void | printLog (Option_t *option="") |
Private Attributes | |
| Bool_t | _bsave |
| Saves all the computation files in each directory. More... | |
| Bool_t | _bclean |
| Cleans the Working Directory before running the code. More... | |
| Int_t | _nPrintLevel |
| The level of Debg between \( [1, 5]\) without test. More... | |
| URANIE::DataServer::TDataServer * | _tds |
| Int_t | _nMaxIterations |
| Pointer vers un TDS. More... | |
| Int_t | _nMaxFunctionCalls |
| The max number to call the code/function. More... | |
| Double_t | _dTolerance |
| The tolerance parameter. More... | |
| vector< TObjective * > | _objectives |
| vector of objectives More... | |
| TMethodCall * | _fMethodCall |
| Pointer to MethodCall in case of interpreted function. More... | |
| void(* | _fMethod )(Double_t *, Double_t *) |
| TString | _sFunctionName |
| A pointer for the analytical function. More... | |
| EOptimType | _optimProblem |
| Function name. More... | |
| EOptimMethod | _optimMethod |
| The method of optimisation. More... | |
| TString | _sInput |
| The string of input attributes. More... | |
| TString | _sOutput |
| The string of output attributes (the number must be equal to 1) More... | |
| TString | _sCost |
| The name od the selected cost (the number must be equal to 1) More... | |
Detailed Description
Description of the class TOptimizer.
To be written by the developper.
Member Enumeration Documentation
◆ EOptimMethod
◆ EOptimType
Constructor & Destructor Documentation
◆ TOptimizer() [1/3]
| URANIE::Optimizer::TOptimizer::TOptimizer | ( | URANIE::DataServer::TDataServer * | tds, |
| URANIE::Launcher::TCode * | code | ||
| ) |
Constructor with a dataserver.
Referenced by ClassImp().
◆ TOptimizer() [2/3]
| URANIE::Optimizer::TOptimizer::TOptimizer | ( | URANIE::DataServer::TDataServer * | tds, |
| void(*)(Double_t *, Double_t *) | fcn, | ||
| TString | sinput, | ||
| TString | soutput | ||
| ) |
Constructor by a TDataServer, a function and list of input and output (optional)
◆ TOptimizer() [3/3]
| URANIE::Optimizer::TOptimizer::TOptimizer | ( | URANIE::DataServer::TDataServer * | tds, |
| const char * | fcn, | ||
| TString | sinput = "", |
||
| TString | soutput = "" |
||
| ) |
Constructor by a TDataServer, a function name and list of input and output (optional)
◆ ~TOptimizer()
|
virtual |
Default destructor.
Referenced by ClassImp().
Member Function Documentation
◆ activeObjective()
| void URANIE::Optimizer::TOptimizer::activeObjective | ( | TString | name | ) |
Active the objective given by these name.
Referenced by ClassImp().
◆ addObjective() [1/2]
| void URANIE::Optimizer::TOptimizer::addObjective | ( | TString | name, |
| URANIE::DataServer::TDataServer * | tds, | ||
| TString | ystar, | ||
| URANIE::Launcher::TOutputFile * | outfile, | ||
| TString | yhat, | ||
| Double_t | weight = 1.0 |
||
| ) |
Add the objective in the TOptimizer object : Sum of square of the error.
The objective is computed with formula
\[ obj = \alpha \sum_{i=1}^{n}{(y^{\star}_{i} - \hat{y}_{i})^{2}} \]
- Parameters
-
name (TString) the name of the TObjective tds (TDataServer *) The pointer of the TDataServer object which contains the attribute \( y^{\star}\) ystar (TString) the name of the \( y^{\star}\) attribute outfile (TOutputFile *) The pointer of the TOutputFile object which contains the attribute \( \hat{y}\) yhat (TString) the name of the \( \hat{y}\) attribute weight (Double_t) The weight of the objective [1.0]
Referenced by ClassImp().
◆ addObjective() [2/2]
| void URANIE::Optimizer::TOptimizer::addObjective | ( | TString | name, |
| URANIE::DataServer::TDataServer * | tds, | ||
| TString | ystar, | ||
| TString | sigma, | ||
| URANIE::Launcher::TOutputFile * | outfile, | ||
| TString | yhat, | ||
| Double_t | alpha = 1.0 |
||
| ) |
Add the objective in the TOptimizer object : Sum of square of the weighted error.
The objective is computed with formula
\[ obj = \alpha \sum_{i=1}^{n}{\frac{(y^{\star}_{i} - \hat{y}_{i})^{2}}{\sigma_{i}^{2}}} \]
- Parameters
-
name (TString) the name of the TObjective tds (TDataServer *) The pointer of the TDataServer object which contains the attribute \( y^{\star}\) ystar (TString) the name of the \( y^{\star}\) attribute sigma (TString) the name of the weight \( \sigma\) attribute outfile (TOutputFile *) The pointer of the TOutputFile object which contains the attribute \( \hat{y}\) yhat (TString) the name of the \( \hat{y}\) attribute alpha (Double_t) The weight of the objective [1.0]
◆ addOutputVariable()
| void URANIE::Optimizer::TOptimizer::addOutputVariable | ( | TString | soutput | ) |
Add input and output variables.
Add output attributes defined from other attributes
- Parameters
-
soutput (TString): list of output variable to be created
Referenced by ClassImp().
◆ clean()
|
virtual |
Cleans the working directory of the code.
Referenced by ClassImp().
◆ fixParameter()
| void URANIE::Optimizer::TOptimizer::fixParameter | ( | TString | name | ) |
Fix the parameter given by these name to the default value.
Referenced by ClassImp().
◆ getMaxFunctionCalls()
|
inline |
Get the maximum numbers of evaluations.
References _nMaxFunctionCalls.
◆ getMaxIterations()
|
inline |
Get the maximum number of iterations.
References _nMaxIterations.
◆ getMethod()
|
inline |
Return the algorithm of optimization.
References _optimMethod.
◆ getObjectives()
|
inline |
get the vector containing the objectives
References _objectives.
◆ getOptimType()
|
inline |
Return the type of optimization.
References _optimProblem.
◆ getPrintLevel()
|
inline |
Get the print Level of Debug between \( [1, 5]\).
References _nPrintLevel.
◆ getSelectedCost()
|
inline |
Get the selected Select an cost in the Output string.
References _sCost.
◆ getTolerance()
|
inline |
Get the tolerance parameter.
References _dTolerance.
◆ init()
|
virtual |
Init phase of the code.
Referenced by ClassImp().
◆ invertObjectives()
| void URANIE::Optimizer::TOptimizer::invertObjectives | ( | ) |
Invert the state of all the objectives.
Referenced by ClassImp().
◆ invertParameters()
| void URANIE::Optimizer::TOptimizer::invertParameters | ( | ) |
Invert the state of all the parameters.
Then, fixed parameters became "variable" attribute and vice versa.
Referenced by ClassImp().
◆ optimize()
|
virtual |
Runs phase of the code (TMinuit2)
Referenced by ClassImp().
◆ printLog()
|
virtual |
Referenced by ClassImp().
◆ printState()
| void URANIE::Optimizer::TOptimizer::printState | ( | Option_t * | option = "" | ) |
Print the state of the algorithm of optimization.
Referenced by ClassImp().
◆ selectCost()
| void URANIE::Optimizer::TOptimizer::selectCost | ( | TString | scost | ) |
Select an cost in the Output string.
Referenced by ClassImp().
◆ setMaxFunctionCalls()
|
inline |
Set the maximum number of evaluations.
References _nMaxFunctionCalls.
◆ setMaxIterations()
|
inline |
Set the maximum number of iterations.
References _nMaxIterations.
◆ setMethod()
|
inline |
Select the algorithm of optimization.
◆ setPrintLevel()
|
inline |
Set the print Level of Debug between \( [1, 5]\).
References _nPrintLevel.
◆ setTolerance()
|
inline |
Set the tolerance parameter.
◆ terminate()
|
virtual |
Terminates phase of the code.
Referenced by ClassImp().
◆ unactiveObjective()
| void URANIE::Optimizer::TOptimizer::unactiveObjective | ( | TString | name | ) |
Unactive the objective given by these name.
Referenced by ClassImp().
◆ unfixParameter()
| void URANIE::Optimizer::TOptimizer::unfixParameter | ( | TString | name | ) |
Unfix the parameter given by these name.
These parameter became a "variable" attribute
Referenced by ClassImp().
Member Data Documentation
◆ _bclean
|
private |
Cleans the Working Directory before running the code.
Referenced by ClassImp().
◆ _bsave
|
private |
Saves all the computation files in each directory.
Referenced by ClassImp().
◆ _dTolerance
|
private |
The tolerance parameter.
Referenced by ClassImp(), and getTolerance().
◆ _fMethod
|
private |
Referenced by ClassImp().
◆ _fMethodCall
|
private |
Pointer to MethodCall in case of interpreted function.
◆ _nMaxFunctionCalls
|
private |
The max number to call the code/function.
Referenced by ClassImp(), getMaxFunctionCalls(), and setMaxFunctionCalls().
◆ _nMaxIterations
|
private |
Pointer vers un TDS.
The max number of iterations
Referenced by ClassImp(), getMaxIterations(), and setMaxIterations().
◆ _nPrintLevel
|
private |
The level of Debg between \( [1, 5]\) without test.
Referenced by ClassImp(), getPrintLevel(), and setPrintLevel().
◆ _objectives
|
private |
vector of objectives
Referenced by ClassImp(), and getObjectives().
◆ _optimMethod
|
private |
The method of optimisation.
Referenced by ClassImp(), and getMethod().
◆ _optimProblem
|
private |
◆ _sCost
|
private |
The name od the selected cost (the number must be equal to 1)
Referenced by ClassImp(), and getSelectedCost().
◆ _sFunctionName
|
private |
A pointer for the analytical function.
Referenced by ClassImp().
◆ _sInput
|
private |
The string of input attributes.
Referenced by ClassImp().
◆ _sOutput
|
private |
The string of output attributes (the number must be equal to 1)
Referenced by ClassImp().
◆ _tds
|
private |
Referenced by ClassImp().
