#include <HybridMinimizer.h>
Public Types | |
enum | EMinimizerType { kMigrad, kSimplex, kCombined, kScan, kFumili } |
Public Member Functions | |
virtual void | Clear () |
virtual bool | Contour (unsigned int i, unsigned int j, unsigned int &npoints, double *xi, double *xj) |
virtual double | Correlation (unsigned int i, unsigned int j) const |
virtual double | CovMatrix (unsigned int i, unsigned int j) const |
virtual int | CovMatrixStatus () const |
virtual double | Edm () const |
return expected distance reached from the minimum More... | |
virtual const double * | Errors () const |
return errors at the minimum More... | |
virtual bool | GetCovMatrix (double *cov) const |
virtual bool | GetHessianMatrix (double *h) const |
virtual bool | GetMinosError (unsigned int i, double &errLow, double &errUp, int=0) |
virtual double | GlobalCC (unsigned int i) const |
virtual bool | Hesse () |
HybridMinimizer (EMinimizerType type=kMigrad) | |
HybridMinimizer (const char *type) | |
virtual const double * | MinGradient () const |
return pointer to gradient values at the minimum More... | |
virtual bool | Minimize () |
virtual double | MinValue () const |
return minimum function value More... | |
virtual unsigned int | NCalls () const |
number of function calls to reach the minimum More... | |
virtual unsigned int | NDim () const |
virtual unsigned int | NFree () const |
virtual void | PrintResults () |
print result of minimization More... | |
virtual bool | ProvidesError () const |
minimizer provides error and error matrix More... | |
virtual bool | Scan (unsigned int i, unsigned int &nstep, double *x, double *y, double xmin=0, double xmax=0) |
virtual bool | SetFixedVariable (unsigned int, const std::string &, double) |
set fixed variable (override if minimizer supports them ) More... | |
virtual void | SetFunction (const ROOT::Math::IMultiGenFunction &func) |
set the function to minimize More... | |
virtual void | SetFunction (const ROOT::Math::IMultiGradFunction &func) |
set gradient the function to minimize More... | |
virtual bool | SetLimitedVariable (unsigned int ivar, const std::string &name, double val, double step, double, double) |
set upper/lower limited variable (override if minimizer supports them ) More... | |
virtual bool | SetLowerLimitedVariable (unsigned int ivar, const std::string &name, double val, double step, double lower) |
set lower limit variable (override if minimizer supports them ) More... | |
void | SetMinimizerType (EMinimizerType type) |
virtual bool | SetUpperLimitedVariable (unsigned int ivar, const std::string &name, double val, double step, double upper) |
set upper limit variable (override if minimizer supports them ) More... | |
virtual bool | SetVariable (unsigned int ivar, const std::string &name, double val, double step) |
set free variable More... | |
virtual bool | SetVariableValue (unsigned int ivar, double val) |
set variable More... | |
virtual bool | SetVariableValues (const double *val) |
const ROOT::Minuit2::MnUserParameterState & | State () |
return the minimizer state (containing values, step size , etc..) More... | |
virtual int | VariableIndex (const std::string &name) const |
virtual std::string | VariableName (unsigned int ivar) const |
get name of variables (override if minimizer support storing of variable names) More... | |
virtual const double * | X () const |
return pointer to X values at the minimum More... | |
virtual | ~HybridMinimizer () |
Protected Member Functions | |
bool | ExamineMinimum (const ROOT::Minuit2::FunctionMinimum &min) |
examine the minimum result More... | |
virtual const ROOT::Minuit2::FCNBase * | GetFCN () const |
virtual const ROOT::Minuit2::ModularFunctionMinimizer * | GetMinimizer () const |
virtual void | SetMinimizer (ROOT::Minuit2::ModularFunctionMinimizer *m) |
Private Member Functions | |
HybridMinimizer (const HybridMinimizer &) | |
HybridMinimizer & | operator= (const HybridMinimizer &rhs) |
Private Attributes | |
unsigned int | fDim |
std::vector< double > | fErrors |
ROOT::Minuit2::ModularFunctionMinimizer * | fMinimizer |
ROOT::Minuit2::FunctionMinimum * | fMinimum |
ROOT::Minuit2::FCNBase * | fMinuitFCN |
ROOT::Minuit2::MnUserParameterState | fState |
bool | fUseFumili |
std::vector< double > | fValues |
Definition at line 45 of file HybridMinimizer.h.
PSFitter::HybridMinimizer::HybridMinimizer | ( | EMinimizerType | type = kMigrad | ) |
Default constructor
Definition at line 73 of file HybridMinimizer.cc.
References SetMinimizerType().
PSFitter::HybridMinimizer::HybridMinimizer | ( | const char * | type | ) |
Constructor with a char (used by PM)
Definition at line 84 of file HybridMinimizer.cc.
References HLT_25ns10e33_v2_cff::algoType, kCombined, kFumili, kMigrad, kScan, kSimplex, SetMinimizerType(), AlCaHLTBitMon_QueryRunRegistry::string, and create_public_lumi_plots::transform.
|
virtual |
Destructor (no operations)
Definition at line 138 of file HybridMinimizer.cc.
References fMinimizer, fMinimum, and fMinuitFCN.
|
private |
Copy constructor
Definition at line 146 of file HybridMinimizer.cc.
|
virtual |
Definition at line 160 of file HybridMinimizer.cc.
References fMinimum, and fState.
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
virtual |
find the contour points (xi,xj) of the function for parameter i and j around the minimum The contour will be find for value of the function = Min + ErrorUp();
Definition at line 845 of file HybridMinimizer.cc.
References assert(), fMinimum, fMinuitFCN, fState, i, npoints, PSFitter::RestoreGlobalPrintLevel(), mps_fire::result, and PSFitter::TurnOffPrintInfoLevel().
|
virtual |
return correlation coefficient between variable i and j. If the variable is fixed or const the return value is zero
Definition at line 614 of file HybridMinimizer.cc.
References funct::abs(), fDim, fState, relval_2017::k, cmsLHEtoEOSManager::l, mathSSE::sqrt(), and tmp.
|
virtual |
return covariance matrix elements if the variable is fixed or const the value is zero The ordering of the variables is the same as in errors and parameter value. This is different from the direct interface of Minuit2 or TMinuit where the values were obtained only to variable parameters
Definition at line 547 of file HybridMinimizer.cc.
References fDim, fState, relval_2017::k, and cmsLHEtoEOSManager::l.
|
virtual |
return the status of the covariance matrix status = -1 : not available (inversion failed or Hesse failed) status = 0 : available but not positive defined status = 1 : covariance only approximate status = 2 : full matrix but forced pos def status = 3 : full accurate matrix
Definition at line 955 of file HybridMinimizer.cc.
References fMinimum, and fState.
|
inlinevirtual |
return expected distance reached from the minimum
Definition at line 136 of file HybridMinimizer.h.
References fState.
|
virtual |
return errors at the minimum
Definition at line 527 of file HybridMinimizer.cc.
References assert(), fDim, fErrors, fState, and i.
|
protected |
examine the minimum result
study the function minimum
Definition at line 411 of file HybridMinimizer.cc.
References HLT_25ns10e33_v2_cff::debugLevel, visualization-live-secondInstance_cfg::msg, PrintResults(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by Minimize().
|
virtual |
Fill the passed array with the covariance matrix elements if the variable is fixed or const the value is zero. The array will be filled as cov[i *ndim + j] The ordering of the variables is the same as in errors and parameter value. This is different from the direct interface of Minuit2 or TMinuit where the values were obtained only to variable parameters
Definition at line 558 of file HybridMinimizer.cc.
References fDim, fState, i, j, relval_2017::k, cmsLHEtoEOSManager::l, and visualization-live-secondInstance_cfg::m.
|
inlineprotectedvirtual |
Definition at line 274 of file HybridMinimizer.h.
References fMinuitFCN.
Referenced by Minimize().
|
virtual |
Fill the passed array with the Hessian matrix elements The Hessian matrix is the matrix of the second derivatives and is the inverse of the covariance matrix If the variable is fixed or const the values for that variables are zero. The array will be filled as h[i *ndim + j]
Definition at line 585 of file HybridMinimizer.cc.
References fDim, fState, i, j, relval_2017::k, cmsLHEtoEOSManager::l, and visualization-live-secondInstance_cfg::m.
|
inlineprotectedvirtual |
Definition at line 270 of file HybridMinimizer.h.
References fMinimizer.
Referenced by Minimize().
|
virtual |
get the minos error for parameter i, return false if Minos failed A minimizaiton must be performed befre, return false if no minimization has been done In case of Minos failed the status error is updated as following status += 10 * minosStatus where the minos status is: status = 1 : maximum number of function calls exceeded when running for lower error status = 2 : maximum number of function calls exceeded when running for upper error status = 3 : new minimum found when running for lower error status = 4 : new minimum found when running for upper error status = 5 : any other failure
Definition at line 642 of file HybridMinimizer.cc.
References assert(), HLT_25ns10e33_v2_cff::debugLevel, fMinimum, fMinuitFCN, fState, bookConverter::max, hlt_dqm_clientPB-live_cfg::me, PSFitter::RestoreGlobalPrintLevel(), g4TestOverlap_cfg::Tolerance, PSFitter::TurnOffPrintInfoLevel(), and up.
|
virtual |
get global correlation coefficient for the variable i. This is a number between zero and one which gives the correlation between the i-th variable and that linear combination of all other variables which is most strongly correlated with i. If the variable is fixed or const the return value is zero
Definition at line 628 of file HybridMinimizer.cc.
References fDim, fState, and relval_2017::k.
|
virtual |
perform a full calculation of the Hessian matrix for error calculation If a valid minimum exists the calculation is done on the minimum point otherwise is performed in the current set values of parameters Status code of minimizer is updated according to the following convention (in case Hesse failed) status += 100*hesseStatus where hesse status is: status = 1 : hesse failed status = 2 : matrix inversion failed status = 3 : matrix is not pos defined
Definition at line 893 of file HybridMinimizer.cc.
References fMinimum, fMinuitFCN, fState, PSFitter::RestoreGlobalPrintLevel(), and PSFitter::TurnOffPrintInfoLevel().
|
inlinevirtual |
return pointer to gradient values at the minimum
Definition at line 142 of file HybridMinimizer.h.
|
virtual |
method to perform the minimization. Return false in case the minimization did not converge. In this case a status code different than zero is set (retrieved by the derived method Minimizer::Status() )"
status = 1 : Covariance was made pos defined status = 2 : Hesse is invalid status = 3 : Edm is above max status = 4 : Reached call limit status = 5 : Any other failure
Definition at line 303 of file HybridMinimizer.cc.
References assert(), ExamineMinimum(), fMinimum, fMinuitFCN, fState, GetFCN(), GetMinimizer(), min(), convertSQLiteXML::ok, PSFitter::RestoreGlobalPrintLevel(), g4TestOverlap_cfg::Tolerance, and PSFitter::TurnOffPrintInfoLevel().
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
inlinevirtual |
return minimum function value
Definition at line 133 of file HybridMinimizer.h.
References fState.
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
inlinevirtual |
number of function calls to reach the minimum
Definition at line 145 of file HybridMinimizer.h.
References fState.
|
inlinevirtual |
this is <= Function().NDim() which is the total number of variables (free+ constrained ones)
Definition at line 149 of file HybridMinimizer.h.
References fDim.
|
inlinevirtual |
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the total
Definition at line 153 of file HybridMinimizer.h.
References fState.
|
private |
Assignment operator
Definition at line 152 of file HybridMinimizer.cc.
|
virtual |
print result of minimization
return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const;
Definition at line 477 of file HybridMinimizer.cc.
References fMinimum.
Referenced by ExamineMinimum().
|
inlinevirtual |
minimizer provides error and error matrix
Definition at line 156 of file HybridMinimizer.h.
|
virtual |
scan a parameter i around the minimum. A minimization must have been done before, return false if it is not the case
Definition at line 787 of file HybridMinimizer.cc.
References fMinuitFCN, fState, i, PSFitter::RestoreGlobalPrintLevel(), mps_fire::result, and PSFitter::TurnOffPrintInfoLevel().
|
virtual |
set fixed variable (override if minimizer supports them )
Definition at line 224 of file HybridMinimizer.cc.
References funct::abs(), fState, SetVariable(), and relval_parameters_module::step.
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
virtual |
set the function to minimize
Definition at line 267 of file HybridMinimizer.cc.
References fDim, fMinuitFCN, and fUseFumili.
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
virtual |
set gradient the function to minimize
Definition at line 285 of file HybridMinimizer.cc.
References fDim, fMinuitFCN, and fUseFumili.
|
virtual |
set upper/lower limited variable (override if minimizer supports them )
Definition at line 217 of file HybridMinimizer.cc.
References fState, and SetVariable().
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
virtual |
set lower limit variable (override if minimizer supports them )
Definition at line 201 of file HybridMinimizer.cc.
References fState, and SetVariable().
|
inlineprotectedvirtual |
Definition at line 272 of file HybridMinimizer.h.
References fMinimizer, and visualization-live-secondInstance_cfg::m.
Referenced by SetMinimizerType().
void PSFitter::HybridMinimizer::SetMinimizerType | ( | EMinimizerType | type | ) |
Definition at line 106 of file HybridMinimizer.cc.
References fMinimizer, fUseFumili, kCombined, kFumili, kMigrad, kScan, kSimplex, and SetMinimizer().
Referenced by PulseShapeFitOOTPileupCorrection::fit(), and HybridMinimizer().
|
virtual |
set upper limit variable (override if minimizer supports them )
Definition at line 208 of file HybridMinimizer.cc.
References fState, and SetVariable().
|
virtual |
set free variable
Definition at line 171 of file HybridMinimizer.cc.
References fState, relval_parameters_module::step, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by SetFixedVariable(), SetLimitedVariable(), SetLowerLimitedVariable(), and SetUpperLimitedVariable().
|
virtual |
set variable
Definition at line 250 of file HybridMinimizer.cc.
References fState.
|
virtual |
Definition at line 257 of file HybridMinimizer.cc.
References fState, and gen::n.
|
inline |
return the minimizer state (containing values, step size , etc..)
Definition at line 262 of file HybridMinimizer.h.
References fState.
|
virtual |
get index of variable given a variable given a name return -1 if variable is not found
Definition at line 243 of file HybridMinimizer.cc.
References fState.
|
virtual |
get name of variables (override if minimizer support storing of variable names)
Definition at line 236 of file HybridMinimizer.cc.
References fState, and AlCaHLTBitMon_QueryRunRegistry::string.
|
virtual |
return pointer to X values at the minimum
Definition at line 511 of file HybridMinimizer.cc.
References assert(), fDim, fState, fValues, and i.
Referenced by svgfig.Curve.Sample::__repr__(), and PulseShapeFitOOTPileupCorrection::fit().
|
private |
Definition at line 281 of file HybridMinimizer.h.
Referenced by Correlation(), CovMatrix(), Errors(), GetCovMatrix(), GetHessianMatrix(), GlobalCC(), NDim(), SetFunction(), and X().
|
mutableprivate |
Definition at line 290 of file HybridMinimizer.h.
Referenced by Errors().
|
private |
Definition at line 286 of file HybridMinimizer.h.
Referenced by GetMinimizer(), SetMinimizer(), SetMinimizerType(), and ~HybridMinimizer().
|
private |
Definition at line 288 of file HybridMinimizer.h.
Referenced by Clear(), Contour(), CovMatrixStatus(), GetMinosError(), Hesse(), Minimize(), PrintResults(), and ~HybridMinimizer().
|
private |
Definition at line 287 of file HybridMinimizer.h.
Referenced by Contour(), GetFCN(), GetMinosError(), Hesse(), Minimize(), Scan(), SetFunction(), and ~HybridMinimizer().
|
private |
Definition at line 284 of file HybridMinimizer.h.
Referenced by Clear(), Contour(), Correlation(), CovMatrix(), CovMatrixStatus(), Edm(), Errors(), GetCovMatrix(), GetHessianMatrix(), GetMinosError(), GlobalCC(), Hesse(), Minimize(), MinValue(), NCalls(), NFree(), Scan(), SetFixedVariable(), SetLimitedVariable(), SetLowerLimitedVariable(), SetUpperLimitedVariable(), SetVariable(), SetVariableValue(), SetVariableValues(), State(), VariableIndex(), VariableName(), and X().
|
private |
Definition at line 282 of file HybridMinimizer.h.
Referenced by SetFunction(), and SetMinimizerType().
|
mutableprivate |
Definition at line 289 of file HybridMinimizer.h.
Referenced by X().