#include <HybridMinimizer.h>
Public Types | |
enum | EMinimizerType { kMigrad, kSimplex, kCombined, kScan, kFumili } |
Public Member Functions | |
void | Clear () override |
bool | Contour (unsigned int i, unsigned int j, unsigned int &npoints, double *xi, double *xj) override |
double | Correlation (unsigned int i, unsigned int j) const override |
double | CovMatrix (unsigned int i, unsigned int j) const override |
int | CovMatrixStatus () const override |
double | Edm () const override |
return expected distance reached from the minimum More... | |
const double * | Errors () const override |
return errors at the minimum More... | |
bool | GetCovMatrix (double *cov) const override |
bool | GetHessianMatrix (double *h) const override |
bool | GetMinosError (unsigned int i, double &errLow, double &errUp, int=0) override |
double | GlobalCC (unsigned int i) const override |
bool | Hesse () override |
HybridMinimizer (EMinimizerType type=kMigrad) | |
HybridMinimizer (const char *type) | |
const double * | MinGradient () const override |
return pointer to gradient values at the minimum More... | |
bool | Minimize () override |
double | MinValue () const override |
return minimum function value More... | |
unsigned int | NCalls () const override |
number of function calls to reach the minimum More... | |
unsigned int | NDim () const override |
unsigned int | NFree () const override |
void | PrintResults () override |
print result of minimization More... | |
bool | ProvidesError () const override |
minimizer provides error and error matrix More... | |
bool | Scan (unsigned int i, unsigned int &nstep, double *x, double *y, double xmin=0, double xmax=0) override |
bool | SetFixedVariable (unsigned int, const std::string &, double) override |
set fixed variable (override if minimizer supports them ) More... | |
void | SetFunction (const ROOT::Math::IMultiGenFunction &func) override |
set the function to minimize More... | |
void | SetFunction (const ROOT::Math::IMultiGradFunction &func) override |
set gradient the function to minimize More... | |
bool | SetLimitedVariable (unsigned int ivar, const std::string &name, double val, double step, double, double) override |
set upper/lower limited variable (override if minimizer supports them ) More... | |
bool | SetLowerLimitedVariable (unsigned int ivar, const std::string &name, double val, double step, double lower) override |
set lower limit variable (override if minimizer supports them ) More... | |
void | SetMinimizerType (EMinimizerType type) |
bool | SetUpperLimitedVariable (unsigned int ivar, const std::string &name, double val, double step, double upper) override |
set upper limit variable (override if minimizer supports them ) More... | |
bool | SetVariable (unsigned int ivar, const std::string &name, double val, double step) override |
set free variable More... | |
bool | SetVariableValue (unsigned int ivar, double val) override |
set variable More... | |
bool | SetVariableValues (const double *val) override |
const ROOT::Minuit2::MnUserParameterState & | State () |
return the minimizer state (containing values, step size , etc..) More... | |
int | VariableIndex (const std::string &name) const override |
std::string | VariableName (unsigned int ivar) const override |
get name of variables (override if minimizer support storing of variable names) More... | |
const double * | X () const override |
return pointer to X values at the minimum More... | |
~HybridMinimizer () override | |
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 70 of file HybridMinimizer.cc.
References SetMinimizerType().
PSFitter::HybridMinimizer::HybridMinimizer | ( | const char * | type | ) |
Constructor with a char (used by PM)
Definition at line 76 of file HybridMinimizer.cc.
References createfilelist::int, kCombined, kFumili, kMigrad, kScan, kSimplex, SetMinimizerType(), AlCaHLTBitMon_QueryRunRegistry::string, and HcalDetIdTransform::transform().
|
override |
Destructor (no operations)
Definition at line 129 of file HybridMinimizer.cc.
References fMinimizer, fMinimum, and fMinuitFCN.
|
private |
Copy constructor
Definition at line 139 of file HybridMinimizer.cc.
|
override |
Definition at line 150 of file HybridMinimizer.cc.
References fMinimum, and fState.
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
override |
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 860 of file HybridMinimizer.cc.
References fMinimum, fMinuitFCN, fState, mps_fire::i, npoints, PSFitter::RestoreGlobalPrintLevel(), mps_fire::result, and PSFitter::TurnOffPrintInfoLevel().
|
override |
return correlation coefficient between variable i and j. If the variable is fixed or const the return value is zero
Definition at line 615 of file HybridMinimizer.cc.
References funct::abs(), fDim, fState, dqmdumpme::k, cmsLHEtoEOSManager::l, mathSSE::sqrt(), and createJobs::tmp.
|
override |
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 542 of file HybridMinimizer.cc.
References fDim, fState, dqmdumpme::k, and cmsLHEtoEOSManager::l.
|
override |
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 975 of file HybridMinimizer.cc.
References fMinimum, and fState.
|
inlineoverride |
return expected distance reached from the minimum
Definition at line 134 of file HybridMinimizer.h.
References hcaldqm::quantity::fState, and X.
|
override |
return errors at the minimum
Definition at line 521 of file HybridMinimizer.cc.
References fDim, fErrors, fState, and mps_fire::i.
|
protected |
examine the minimum result
study the function minimum
Definition at line 405 of file HybridMinimizer.cc.
References HLT_2018_cff::debugLevel, mps_check::msg, PrintResults(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by Minimize().
|
override |
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 557 of file HybridMinimizer.cc.
References fDim, fState, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, cmsLHEtoEOSManager::l, and visualization-live-secondInstance_cfg::m.
|
inlineprotectedvirtual |
Definition at line 267 of file HybridMinimizer.h.
References min().
Referenced by Minimize().
|
override |
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, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, cmsLHEtoEOSManager::l, and visualization-live-secondInstance_cfg::m.
|
inlineprotectedvirtual |
Definition at line 263 of file HybridMinimizer.h.
Referenced by Minimize().
|
override |
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 650 of file HybridMinimizer.cc.
References HLT_2018_cff::debugLevel, fMinimum, fMinuitFCN, fState, LaserClient_cfi::low, SiStripPI::max, hlt_dqm_clientPB-live_cfg::me, PSFitter::RestoreGlobalPrintLevel(), g4SimHits_cfi::Tolerance, PSFitter::TurnOffPrintInfoLevel(), and up.
|
override |
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 634 of file HybridMinimizer.cc.
References fDim, fState, and dqmdumpme::k.
|
override |
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 907 of file HybridMinimizer.cc.
References fMinimum, fMinuitFCN, fState, PSFitter::RestoreGlobalPrintLevel(), and PSFitter::TurnOffPrintInfoLevel().
|
inlineoverride |
return pointer to gradient values at the minimum
Definition at line 140 of file HybridMinimizer.h.
|
override |
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 295 of file HybridMinimizer.cc.
References ExamineMinimum(), fMinimum, fMinuitFCN, fState, GetFCN(), GetMinimizer(), min(), convertSQLiteXML::ok, PSFitter::RestoreGlobalPrintLevel(), g4SimHits_cfi::Tolerance, and PSFitter::TurnOffPrintInfoLevel().
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
inlineoverride |
return minimum function value
Definition at line 131 of file HybridMinimizer.h.
References hcaldqm::quantity::fState.
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
inlineoverride |
number of function calls to reach the minimum
Definition at line 143 of file HybridMinimizer.h.
References hcaldqm::quantity::fState.
|
inlineoverride |
this is <= Function().NDim() which is the total number of variables (free+ constrained ones)
Definition at line 147 of file HybridMinimizer.h.
|
inlineoverride |
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the total
Definition at line 151 of file HybridMinimizer.h.
References hcaldqm::quantity::fState.
|
private |
Assignment operator
Definition at line 143 of file HybridMinimizer.cc.
|
override |
print result of minimization
return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const;
Definition at line 470 of file HybridMinimizer.cc.
References fMinimum.
Referenced by ExamineMinimum().
|
inlineoverride |
minimizer provides error and error matrix
Definition at line 154 of file HybridMinimizer.h.
References h, mps_fire::i, dqmiolumiharvest::j, npoints, hybridSuperClusters_cfi::xi, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.
|
override |
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 803 of file HybridMinimizer.cc.
References fMinuitFCN, fState, mps_fire::i, PSFitter::RestoreGlobalPrintLevel(), mps_fire::result, and PSFitter::TurnOffPrintInfoLevel().
|
override |
set fixed variable (override if minimizer supports them )
Definition at line 216 of file HybridMinimizer.cc.
References funct::abs(), fState, and SetVariable().
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
override |
set the function to minimize
Definition at line 259 of file HybridMinimizer.cc.
References fDim, fMinuitFCN, TrackCollections2monitor_cff::func, and fUseFumili.
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
override |
set gradient the function to minimize
Definition at line 277 of file HybridMinimizer.cc.
References fDim, fMinuitFCN, TrackCollections2monitor_cff::func, and fUseFumili.
|
override |
set upper/lower limited variable (override if minimizer supports them )
Definition at line 207 of file HybridMinimizer.cc.
References fState, and SetVariable().
Referenced by PulseShapeFitOOTPileupCorrection::fit().
|
override |
set lower limit variable (override if minimizer supports them )
Definition at line 189 of file HybridMinimizer.cc.
References fState, and SetVariable().
|
inlineprotectedvirtual |
Definition at line 265 of file HybridMinimizer.h.
References visualization-live-secondInstance_cfg::m.
Referenced by SetMinimizerType().
void PSFitter::HybridMinimizer::SetMinimizerType | ( | EMinimizerType | type | ) |
Definition at line 97 of file HybridMinimizer.cc.
References fMinimizer, fUseFumili, kCombined, kFumili, kMigrad, kScan, kSimplex, and SetMinimizer().
Referenced by PulseShapeFitOOTPileupCorrection::fit(), and HybridMinimizer().
|
override |
set upper limit variable (override if minimizer supports them )
Definition at line 198 of file HybridMinimizer.cc.
References fState, and SetVariable().
|
override |
set free variable
Definition at line 161 of file HybridMinimizer.cc.
References fState, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by SetFixedVariable(), SetLimitedVariable(), SetLowerLimitedVariable(), and SetUpperLimitedVariable().
|
override |
set variable
Definition at line 241 of file HybridMinimizer.cc.
References fState.
|
override |
Definition at line 249 of file HybridMinimizer.cc.
References fState, and dqmiodumpmetadata::n.
|
inline |
return the minimizer state (containing values, step size , etc..)
Definition at line 256 of file HybridMinimizer.h.
References hcaldqm::quantity::fState.
|
override |
get index of variable given a variable given a name return -1 if variable is not found
Definition at line 235 of file HybridMinimizer.cc.
References fState.
|
override |
get name of variables (override if minimizer support storing of variable names)
Definition at line 228 of file HybridMinimizer.cc.
References fState, and AlCaHLTBitMon_QueryRunRegistry::string.
|
override |
return pointer to X values at the minimum
Definition at line 504 of file HybridMinimizer.cc.
References fDim, fState, fValues, and mps_fire::i.
Referenced by svgfig.Curve.Sample::__repr__(), and PulseShapeFitOOTPileupCorrection::fit().
|
private |
Definition at line 273 of file HybridMinimizer.h.
Referenced by Correlation(), CovMatrix(), Errors(), GetCovMatrix(), GetHessianMatrix(), GlobalCC(), SetFunction(), and X().
|
mutableprivate |
Definition at line 282 of file HybridMinimizer.h.
Referenced by Errors().
|
private |
Definition at line 278 of file HybridMinimizer.h.
Referenced by SetMinimizerType(), and ~HybridMinimizer().
|
private |
Definition at line 280 of file HybridMinimizer.h.
Referenced by Clear(), Contour(), CovMatrixStatus(), GetMinosError(), Hesse(), Minimize(), PrintResults(), and ~HybridMinimizer().
|
private |
Definition at line 279 of file HybridMinimizer.h.
Referenced by Contour(), GetMinosError(), Hesse(), Minimize(), Scan(), SetFunction(), and ~HybridMinimizer().
|
private |
Definition at line 276 of file HybridMinimizer.h.
Referenced by Clear(), Contour(), Correlation(), CovMatrix(), CovMatrixStatus(), Errors(), GetCovMatrix(), GetHessianMatrix(), GetMinosError(), GlobalCC(), Hesse(), Minimize(), Scan(), SetFixedVariable(), SetLimitedVariable(), SetLowerLimitedVariable(), SetUpperLimitedVariable(), SetVariable(), SetVariableValue(), SetVariableValues(), VariableIndex(), VariableName(), and X().
|
private |
Definition at line 274 of file HybridMinimizer.h.
Referenced by SetFunction(), and SetMinimizerType().
|
mutableprivate |
Definition at line 281 of file HybridMinimizer.h.
Referenced by X().