CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
PSFitter::HybridMinimizer Class Reference

#include <HybridMinimizer.h>

Inheritance diagram for PSFitter::HybridMinimizer:

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 (const char *type)
 
 HybridMinimizer (EMinimizerType type=kMigrad)
 
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 &)
 
HybridMinimizeroperator= (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
 

Detailed Description

Definition at line 44 of file HybridMinimizer.h.

Member Enumeration Documentation

◆ EMinimizerType

Enumerator
kMigrad 
kSimplex 
kCombined 
kScan 
kFumili 

Definition at line 46 of file HybridMinimizer.h.

Constructor & Destructor Documentation

◆ HybridMinimizer() [1/3]

PSFitter::HybridMinimizer::HybridMinimizer ( EMinimizerType  type = kMigrad)

Default constructor

Definition at line 74 of file HybridMinimizer.cc.

78  : Minimizer(), fDim(0), fMinimizer(nullptr), fMinuitFCN(nullptr), fMinimum(nullptr) {

◆ HybridMinimizer() [2/3]

PSFitter::HybridMinimizer::HybridMinimizer ( const char *  type)

Constructor with a char (used by PM)

Definition at line 80 of file HybridMinimizer.cc.

98  {
99  // Set minimizer algorithm type

◆ ~HybridMinimizer()

PSFitter::HybridMinimizer::~HybridMinimizer ( )
override

Destructor (no operations)

Definition at line 133 of file HybridMinimizer.cc.

140  : ROOT::Math::Minimizer() {
141  // Implementation of copy constructor.

◆ HybridMinimizer() [3/3]

PSFitter::HybridMinimizer::HybridMinimizer ( const HybridMinimizer )
private

Copy constructor

Definition at line 143 of file HybridMinimizer.cc.

144  {
145  // Implementation of assignment operator.

Member Function Documentation

◆ Clear()

void PSFitter::HybridMinimizer::Clear ( )
override

Definition at line 154 of file HybridMinimizer.cc.

Referenced by PulseShapeFitOOTPileupCorrection::fit().

◆ Contour()

bool PSFitter::HybridMinimizer::Contour ( unsigned int  i,
unsigned int  j,
unsigned int &  npoints,
double *  xi,
double *  xj 
)
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 861 of file HybridMinimizer.cc.

861  {
862  edm::LogError("HybridMinimizer::Contour") << " no function minimum existing. Must minimize function before";
863  return false;
864  }
865 
866  if (!fMinimum->IsValid()) {
867  edm::LogError("HybridMinimizer::Contour") << "Invalid function minimum";
868  return false;
869  }
871 
872  fMinuitFCN->SetErrorDef(ErrorDef());
873  // if error def has been changed update it in FunctionMinimum
874  if (ErrorDef() != fMinimum->Up())
875  fMinimum->SetErrorDef(ErrorDef());
876 
877  // switch off Minuit2 printing (for level of 0,1)
878  int prev_level = (PrintLevel() <= 1) ? TurnOffPrintInfoLevel() : -2;
879 
880  //MnPrint::SetLevel(PrintLevel());
881 
882  // set the precision if needed
883  if (Precision() > 0)
884  fState.SetPrecision(Precision());
885 
886  // eventually one should specify tolerance in contours
887  MnContours contour(*fMinuitFCN, *fMinimum, Strategy());
888 
889  if (prev_level > -2)
890  RestoreGlobalPrintLevel(prev_level);
891 
892  std::vector<std::pair<double, double> > result = contour(ipar, jpar, npoints);
893  if (result.size() != npoints) {
894  edm::LogError("HybridMinimizer::Contour") << " Invalid result from MnContours";
895  return false;
896  }
897  for (unsigned int i = 0; i < npoints; ++i) {
898  x[i] = result[i].first;
899  y[i] = result[i].second;
900  }
901 
902  return true;
903  }
904 
905  bool HybridMinimizer::Hesse() {
906  // find Hessian (full second derivative calculations)

◆ Correlation()

double PSFitter::HybridMinimizer::Correlation ( unsigned int  i,
unsigned int  j 
) const
override

return correlation coefficient between variable i and j. If the variable is fixed or const the return value is zero

Definition at line 616 of file HybridMinimizer.cc.

632  {
633  // get global correlation coefficient for the parameter i. This is a number between zero and one which gives

◆ CovMatrix()

double PSFitter::HybridMinimizer::CovMatrix ( unsigned int  i,
unsigned int  j 
) const
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 543 of file HybridMinimizer.cc.

555  {
556  // get value of covariance matrices

◆ CovMatrixStatus()

int PSFitter::HybridMinimizer::CovMatrixStatus ( ) const
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 976 of file HybridMinimizer.cc.

981  {
982  // case a function minimum is available
983  if (fMinimum->HasAccurateCovar())
984  return 3;
985  else if (fMinimum->HasMadePosDefCovar())
986  return 2;
987  else if (fMinimum->HasValidCovariance())
988  return 1;
989  else if (fMinimum->HasCovariance())
990  return 0;
991  return -1;
992  } else {
993  // case fMinimum is not available - use state information
994  return fState.CovarianceStatus();
995  }
996  return 0;
997  }
998 
999 } // namespace PSFitter

References fMinimum.

◆ Edm()

double PSFitter::HybridMinimizer::Edm ( ) const
inlineoverride

return expected distance reached from the minimum

Definition at line 133 of file HybridMinimizer.h.

134 { return fState.Edm(); }

◆ Errors()

const double * PSFitter::HybridMinimizer::Errors ( ) const
override

return errors at the minimum

Definition at line 522 of file HybridMinimizer.cc.

529  {
530  const MinuitParameter &par = paramsObj[i];
531  if (par.IsFixed() || par.IsConst())
532  fErrors[i] = 0;
533  else
534  fErrors[i] = par.Error();
535  }
536 
537  return &fErrors.front();
538  }
539 
540  double HybridMinimizer::CovMatrix(unsigned int i, unsigned int j) const {
541  // get value of covariance matrices (transform from external to internal indices)

References fErrors, and mps_fire::i.

◆ ExamineMinimum()

bool PSFitter::HybridMinimizer::ExamineMinimum ( const ROOT::Minuit2::FunctionMinimum &  min)
protected

examine the minimum result

study the function minimum

Definition at line 407 of file HybridMinimizer.cc.

409  {
410  /*
411  const std::vector<ROOT::Minuit2::MinimumState>& iterationStates = min.States();
412  std::cout << "Number of iterations " << iterationStates.size() << std::endl;
413  for (unsigned int i = 0; i < iterationStates.size(); ++i) {
414  //std::cout << iterationStates[i] << std::endl;
415  const ROOT::Minuit2::MinimumState & st = iterationStates[i];
416  std::cout << "----------> Iteration " << i << std::endl;
417  int pr = std::cout.precision(12);
418  std::cout << " FVAL = " << st.Fval() << " Edm = " << st.Edm() << " Nfcn = " << st.NFcn() << std::endl;
419  std::cout.precision(pr);
420  std::cout << " Error matrix change = " << st.Error().Dcovar() << std::endl;
421  std::cout << " Parameters : ";
422  // need to transform from internal to external
423  for (int j = 0; j < st.size() ; ++j) std::cout << " p" << j << " = " << fState.Int2ext( j, st.Vec()(j) );
424  std::cout << std::endl;
425  }
426 */
427  }
428 
429  fStatus = 0;
430  std::string txt;
431  if (min.HasMadePosDefCovar()) {
432  txt = "Covar was made pos def";
433  fStatus = 1;
434  }
435  if (min.HesseFailed()) {
436  txt = "Hesse is not valid";
437  fStatus = 2;
438  }
439  if (min.IsAboveMaxEdm()) {
440  txt = "Edm is above max";
441  fStatus = 3;
442  }
443  if (min.HasReachedCallLimit()) {
444  txt = "Reached call limit";
445  fStatus = 4;
446  }
447 
448  bool validMinimum = min.IsValid();
449  if (validMinimum) {
450  // print a warning message in case something is not ok
451  if (fStatus != 0 && debugLevel > 0)
452  edm::LogInfo("HybridMinimizer::Minimize") << txt;
453  } else {
454  // minimum is not valid when state is not valid and edm is over max or has passed call limits
455  if (fStatus == 0) {
456  // this should not happen
457  txt = "unknown failure";
458  fStatus = 5;
459  }
460  edm::LogInfo("HybridMinimizer::Minimize").format("Minimization did NOT converge, {}", txt);
461  }
462 
463  if (debugLevel >= 1)
464  PrintResults();
465  return validMinimum;
466  }
467 
469  // print results of minimization

◆ GetCovMatrix()

bool PSFitter::HybridMinimizer::GetCovMatrix ( double *  cov) const
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 558 of file HybridMinimizer.cc.

559  {
560  if (fState.Parameter(i).IsFixed() || fState.Parameter(i).IsConst()) {
561  for (unsigned int j = 0; j < fDim; ++j) {
562  cov[i * fDim + j] = 0;
563  }
564  } else {
565  unsigned int l = fState.IntOfExt(i);
566  for (unsigned int j = 0; j < fDim; ++j) {
567  // could probably speed up this loop (if needed)
568  int k = i * fDim + j;
569  if (fState.Parameter(j).IsFixed() || fState.Parameter(j).IsConst())
570  cov[k] = 0;
571  else {
572  // need to transform from external to internal indices)
573  // for taking care of the removed fixed row/columns in the Minuit2 representation
574  unsigned int m = fState.IntOfExt(j);
575  cov[k] = fState.Covariance()(l, m);
576  }
577  }
578  }
579  }
580  return true;
581  }
582 
583  bool HybridMinimizer::GetHessianMatrix(double *hess) const {
584  // get value of Hessian matrix

References fDim, fState, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, cmsLHEtoEOSManager::l, and visualization-live-secondInstance_cfg::m.

◆ GetFCN()

virtual const ROOT::Minuit2::FCNBase* PSFitter::HybridMinimizer::GetFCN ( ) const
inlineprotectedvirtual

Definition at line 266 of file HybridMinimizer.h.

References fMinuitFCN.

◆ GetHessianMatrix()

bool PSFitter::HybridMinimizer::GetHessianMatrix ( double *  h) const
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 586 of file HybridMinimizer.cc.

588  {
589  if (fState.Parameter(i).IsFixed() || fState.Parameter(i).IsConst()) {
590  for (unsigned int j = 0; j < fDim; ++j) {
591  hess[i * fDim + j] = 0;
592  }
593  } else {
594  unsigned int l = fState.IntOfExt(i);
595  for (unsigned int j = 0; j < fDim; ++j) {
596  // could probably speed up this loop (if needed)
597  int k = i * fDim + j;
598  if (fState.Parameter(j).IsFixed() || fState.Parameter(j).IsConst())
599  hess[k] = 0;
600  else {
601  // need to transform from external to internal indices)
602  // for taking care of the removed fixed row/columns in the Minuit2 representation
603  unsigned int m = fState.IntOfExt(j);
604  hess[k] = fState.Hessian()(l, m);
605  }
606  }
607  }
608  }
609 
610  return true;
611  }
612 
613  double HybridMinimizer::Correlation(unsigned int i, unsigned int j) const {
614  // get correlation between parameter i and j

References fDim, fState, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, cmsLHEtoEOSManager::l, and visualization-live-secondInstance_cfg::m.

◆ GetMinimizer()

virtual const ROOT::Minuit2::ModularFunctionMinimizer* PSFitter::HybridMinimizer::GetMinimizer ( ) const
inlineprotectedvirtual

Definition at line 262 of file HybridMinimizer.h.

References fMinimizer.

◆ GetMinosError()

bool PSFitter::HybridMinimizer::GetMinosError ( unsigned int  i,
double &  errLow,
double &  errUp,
int  runopt = 0 
)
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 651 of file HybridMinimizer.cc.

661  {
662  return false;
663  }
664 
665  int debugLevel = PrintLevel();
666  // internal minuit messages
667  //MnPrint::SetLevel(debugLevel);
668 
669  // to run minos I need function minimum class
670  // redo minimization from current state
671  // ROOT::Minuit2::FunctionMinimum min =
672  // GetMinimizer()->Minimize(*GetFCN(),fState, ROOT::Minuit2::MnStrategy(strategy), MaxFunctionCalls(), Tolerance());
673  // fState = min.UserState();
674  if (fMinimum == nullptr) {
675  edm::LogError("HybridMinimizer::GetMinosErrors") << " failed - no function minimum existing";
676  return false;
677  }
678 
679  if (!fMinimum->IsValid()) {
680  edm::LogError("HybridMinimizer::MINOS") << " failed due to invalid function minimum";
681  return false;
682  }
683 
684  fMinuitFCN->SetErrorDef(ErrorDef());
685  // if error def has been changed update it in FunctionMinimum
686  if (ErrorDef() != fMinimum->Up())
687  fMinimum->SetErrorDef(ErrorDef());
688 
689  // switch off Minuit2 printing
690  int prev_level = (PrintLevel() <= 0) ? TurnOffPrintInfoLevel() : -2;
691 
692  // set the precision if needed
693  if (Precision() > 0)
694  fState.SetPrecision(Precision());
695 
696  ROOT::Minuit2::MnMinos minos(*fMinuitFCN, *fMinimum);
697 
698  // run MnCross
699  MnCross low;
700  MnCross up;
701  int maxfcn = MaxFunctionCalls();
702  double tol = Tolerance();
703 
704  // const char * par_name = fState.Name(i);
705 
706  // now input tolerance for migrad calls inside Minos (MnFunctionCross)
707  // before it was fixed to 0.05
708  // cut off too small tolerance (they are not needed)
709  tol = std::max(tol, 0.01);
710 
711  /*
712  if (PrintLevel() >=1) {
713  // print the real number of maxfcn used (defined in MnMinos)
714  int maxfcn_used = maxfcn;
715  if (maxfcn_used == 0) {
716  int nvar = fState.VariableParameters();
717  maxfcn_used = 2*(nvar+1)*(200 + 100*nvar + 5*nvar*nvar);
718  }
719 // std::cout << "HybridMinimizer::GetMinosError for parameter " << i << " " << par_name
720 // << " using max-calls " << maxfcn_used << ", tolerance " << tol << std::endl;
721  }
722  */
723 
724  if (runLower)
725  low = minos.Loval(i, maxfcn, tol);
726  if (runUpper)
727  up = minos.Upval(i, maxfcn, tol);
728 
729  ROOT::Minuit2::MinosError me(i, fMinimum->UserState().Value(i), low, up);
730 
731  if (prev_level > -2)
732  RestoreGlobalPrintLevel(prev_level);
733 
734  // debug result of Minos
735  // print error message in Minos
736 
737  if (debugLevel >= 1) {
738  /*
739  if (runLower) {
740  if (!me.LowerValid() )
741  std::cout << "Minos: Invalid lower error for parameter " << par_name << std::endl;
742  if(me.AtLowerLimit())
743  std::cout << "Minos: Parameter : " << par_name << " is at Lower limit."<<std::endl;
744  if(me.AtLowerMaxFcn())
745  std::cout << "Minos: Maximum number of function calls exceeded when running for lower error" <<std::endl;
746  if(me.LowerNewMin() )
747  std::cout << "Minos: New Minimum found while running Minos for lower error" <<std::endl;
748 
749  if (debugLevel > 1) std::cout << "Minos: Lower error for parameter " << par_name << " : " << me.Lower() << std::endl;
750 
751  }
752  if (runUpper) {
753  if (!me.UpperValid() )
754  std::cout << "Minos: Invalid upper error for parameter " << par_name << std::endl;
755  if(me.AtUpperLimit())
756  std::cout << "Minos: Parameter " << par_name << " is at Upper limit."<<std::endl;
757  if(me.AtUpperMaxFcn())
758  std::cout << "Minos: Maximum number of function calls exceeded when running for upper error" <<std::endl;
759  if(me.UpperNewMin() )
760  std::cout << "Minos: New Minimum found while running Minos for upper error" <<std::endl;
761 
762  if (debugLevel > 1) std::cout << "Minos: Upper error for parameter " << par_name << " : " << me.Upper() << std::endl;
763  }
764 */
765  }
766 
767  bool lowerInvalid = (runLower && !me.LowerValid());
768  bool upperInvalid = (runUpper && !me.UpperValid());
769  int mstatus = 0;
770  if (lowerInvalid || upperInvalid) {
771  // set status accroding to bit
772  // bit 1: lower invalid Minos errors
773  // bit 2: uper invalid Minos error
774  // bit 3: invalid because max FCN
775  // bit 4 : invalid because a new minimum has been found
776  if (lowerInvalid) {
777  mstatus |= 1;
778  if (me.AtLowerMaxFcn())
779  mstatus |= 4;
780  if (me.LowerNewMin())
781  mstatus |= 8;
782  }
783  if (upperInvalid) {
784  mstatus |= 3;
785  if (me.AtUpperMaxFcn())
786  mstatus |= 4;
787  if (me.UpperNewMin())
788  mstatus |= 8;
789  }
790  //std::cout << "Error running Minos for parameter " << i << std::endl;
791  fStatus += 10 * mstatus;
792  }
793 
794  errLow = me.Lower();
795  errUp = me.Upper();
796 
797  bool isValid = (runLower && me.LowerValid()) || (runUpper && me.UpperValid());
798  return isValid;
799  }
800 
801  bool HybridMinimizer::Scan(unsigned int ipar, unsigned int &nstep, double *x, double *y, double xmin, double xmax) {
802  // scan a parameter (variable) around the minimum value

◆ GlobalCC()

double PSFitter::HybridMinimizer::GlobalCC ( unsigned int  i) const
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 635 of file HybridMinimizer.cc.

648  {
649  // return the minos error for parameter i

◆ Hesse()

bool PSFitter::HybridMinimizer::Hesse ( )
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 908 of file HybridMinimizer.cc.

911  {
912  edm::LogError("HybridMinimizer::Hesse") << "FCN function has not been set";
913  return false;
914  }
915 
916  int strategy = Strategy();
917  int maxfcn = MaxFunctionCalls();
918 
919  // switch off Minuit2 printing
920  int prev_level = (PrintLevel() <= 0) ? TurnOffPrintInfoLevel() : -2;
921 
922  //MnPrint::SetLevel(PrintLevel());
923 
924  // set the precision if needed
925  if (Precision() > 0)
926  fState.SetPrecision(Precision());
927 
928  ROOT::Minuit2::MnHesse hesse(strategy);
929 
930  // case when function minimum exists
931  if (fMinimum) {
932  // run hesse and function minimum will be updated with Hesse result
933  hesse(*fMinuitFCN, *fMinimum, maxfcn);
934  fState = fMinimum->UserState();
935  }
936 
937  else {
938  // run Hesse on point stored in current state (independent of function minimum validity)
939  // (x == 0)
940  fState = hesse(*fMinuitFCN, fState, maxfcn);
941  }
942 
943  if (prev_level > -2)
944  RestoreGlobalPrintLevel(prev_level);
945 
946  if (PrintLevel() >= 3) {
947  // std::cout << "State returned from Hesse " << std::endl;
948  // std::cout << fState << std::endl;
949  }
950 
951  if (!fState.HasCovariance()) {
952  // if false means error is not valid and this is due to a failure in Hesse
953  if (PrintLevel() > 0)
954  edm::LogInfo("HybridMinimizer::Hesse") << "Hesse failed ";
955  // update minimizer error status
956  int hstatus = 4;
957  // information on error state can be retrieved only if fMinimum is available
958  if (fMinimum) {
959  if (fMinimum->Error().HesseFailed())
960  hstatus = 1;
961  if (fMinimum->Error().InvertFailed())
962  hstatus = 2;
963  else if (!(fMinimum->Error().IsPosDef()))
964  hstatus = 3;
965  }
966  fStatus += 100 * hstatus;
967  return false;
968  }
969 
970  return true;
971  }
972 
974  // return status of covariance matrix

◆ MinGradient()

const double* PSFitter::HybridMinimizer::MinGradient ( ) const
inlineoverride

return pointer to gradient values at the minimum

Definition at line 139 of file HybridMinimizer.h.

140 { return nullptr; } // not available in Minuit2

◆ Minimize()

bool PSFitter::HybridMinimizer::Minimize ( )
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 297 of file HybridMinimizer.cc.

297  {
298  edm::LogError("HybridMinimizer::Minimize") << "FCN function has not been set";
299  return false;
300  }
301 
302  assert(GetMinimizer() != nullptr);
303 
304  // delete result of previous minimization
305  if (fMinimum)
306  delete fMinimum;
307  fMinimum = nullptr;
308 
309  int maxfcn = MaxFunctionCalls();
310  double tol = Tolerance();
311  int strategyLevel = Strategy();
312  fMinuitFCN->SetErrorDef(ErrorDef());
313 
314  /*
315  if (PrintLevel() >=1) {
316  // print the real number of maxfcn used (defined in ModularFuncitonMinimizer)
317  int maxfcn_used = maxfcn;
318  if (maxfcn_used == 0) {
319  int nvar = fState.VariableParameters();
320  maxfcn_used = 200 + 100*nvar + 5*nvar*nvar;
321  }
322 // std::cout << "HybridMinimizer: Minimize with max-calls " << maxfcn_used
323 // << " convergence for edm < " << tol << " strategy "
324 // << strategyLevel << std::endl;
325  }
326  */
327 
328  // internal minuit messages
329  //MnPrint::SetLevel(PrintLevel()); // MnPrint::SetLevel is not a static method anymore. Using it requires an object to exist
330 
331  // switch off Minuit2 printing
332  int prev_level = (PrintLevel() <= 0) ? TurnOffPrintInfoLevel() : -2;
333 
334  // set the precision if needed
335  if (Precision() > 0)
336  fState.SetPrecision(Precision());
337 
338  // set strategy and add extra options if needed
339  ROOT::Minuit2::MnStrategy strategy(strategyLevel);
340  ROOT::Math::IOptions *minuit2Opt = ROOT::Math::MinimizerOptions::FindDefault("Minuit2");
341  if (minuit2Opt) {
342  // set extra strategy options
343  int nGradCycles = strategy.GradientNCycles();
344  int nHessCycles = strategy.HessianNCycles();
345  int nHessGradCycles = strategy.HessianGradientNCycles();
346 
347  double gradTol = strategy.GradientTolerance();
348  double gradStepTol = strategy.GradientStepTolerance();
349  double hessStepTol = strategy.HessianStepTolerance();
350  double hessG2Tol = strategy.HessianG2Tolerance();
351 
352  minuit2Opt->GetValue("GradientNCycles", nGradCycles);
353  minuit2Opt->GetValue("HessianNCycles", nHessCycles);
354  minuit2Opt->GetValue("HessianGradientNCycles", nHessGradCycles);
355 
356  minuit2Opt->GetValue("GradientTolerance", gradTol);
357  minuit2Opt->GetValue("GradientStepTolerance", gradStepTol);
358  minuit2Opt->GetValue("HessianStepTolerance", hessStepTol);
359  minuit2Opt->GetValue("HessianG2Tolerance", hessG2Tol);
360 
361  strategy.SetGradientNCycles(nGradCycles);
362  strategy.SetHessianNCycles(nHessCycles);
363  strategy.SetHessianGradientNCycles(nHessGradCycles);
364 
365  strategy.SetGradientTolerance(gradTol);
366  strategy.SetGradientStepTolerance(gradStepTol);
367  strategy.SetHessianStepTolerance(hessStepTol);
368  strategy.SetHessianG2Tolerance(hessStepTol);
369 
370  if (PrintLevel() > 0) {
371  // std::cout << "HybridMinimizer::Minuit - Changing default stratgey options" << std::endl;
372  minuit2Opt->Print();
373  }
374  }
375 
376  const ROOT::Minuit2::FCNGradientBase *gradFCN = dynamic_cast<const ROOT::Minuit2::FCNGradientBase *>(fMinuitFCN);
377  if (gradFCN != nullptr) {
378  // use gradient
379  //SetPrintLevel(3);
380  ROOT::Minuit2::FunctionMinimum min = GetMinimizer()->Minimize(*gradFCN, fState, strategy, maxfcn, tol);
381  fMinimum = new ROOT::Minuit2::FunctionMinimum(min);
382  } else {
383  ROOT::Minuit2::FunctionMinimum min = GetMinimizer()->Minimize(*GetFCN(), fState, strategy, maxfcn, tol);
384  fMinimum = new ROOT::Minuit2::FunctionMinimum(min);
385  }
386 
387  // check if Hesse needs to be run
388  if (fMinimum->IsValid() && IsValidError() && fMinimum->State().Error().Dcovar() != 0) {
389  // run Hesse (Hesse will add results in the last state of fMinimum
390  ROOT::Minuit2::MnHesse hesse(strategy);
391  hesse(*fMinuitFCN, *fMinimum, maxfcn);
392  }
393 
394  // -2 is the highest low invalid value for gErrorIgnoreLevel
395  if (prev_level > -2)
396  RestoreGlobalPrintLevel(prev_level);
397 
398  fState = fMinimum->UserState();
399  bool ok = ExamineMinimum(*fMinimum);
400  //fMinimum = 0;
401  return ok;
402  }
403 
404  bool HybridMinimizer::ExamineMinimum(const ROOT::Minuit2::FunctionMinimum &min) {

Referenced by PulseShapeFitOOTPileupCorrection::fit().

◆ MinValue()

double PSFitter::HybridMinimizer::MinValue ( ) const
inlineoverride

return minimum function value

Definition at line 130 of file HybridMinimizer.h.

131 { return fState.Fval(); }

Referenced by PulseShapeFitOOTPileupCorrection::fit().

◆ NCalls()

unsigned int PSFitter::HybridMinimizer::NCalls ( ) const
inlineoverride

number of function calls to reach the minimum

Definition at line 142 of file HybridMinimizer.h.

143 { return fState.NFcn(); }

◆ NDim()

unsigned int PSFitter::HybridMinimizer::NDim ( ) const
inlineoverride

this is <= Function().NDim() which is the total number of variables (free+ constrained ones)

Definition at line 146 of file HybridMinimizer.h.

147 { return fDim; }

◆ NFree()

unsigned int PSFitter::HybridMinimizer::NFree ( ) const
inlineoverride

number of free variables (real dimension of the problem) this is <= Function().NDim() which is the total

Definition at line 150 of file HybridMinimizer.h.

151 { return fState.VariableParameters(); }

◆ operator=()

HybridMinimizer & PSFitter::HybridMinimizer::operator= ( const HybridMinimizer rhs)
private

Assignment operator

Definition at line 147 of file HybridMinimizer.cc.

151  {
152  // delete the state in case of consecutive minimizations

◆ PrintResults()

void PSFitter::HybridMinimizer::PrintResults ( )
override

print result of minimization

return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const;

Definition at line 471 of file HybridMinimizer.cc.

472  {
473  // valid minimum
474  /*
475  std::cout << "HybridMinimizer : Valid minimum - status = " << fStatus << std::endl;
476  int pr = std::cout.precision(18);
477  std::cout << "FVAL = " << fState.Fval() << std::endl;
478  std::cout << "Edm = " << fState.Edm() << std::endl;
479  std::cout.precision(pr);
480  std::cout << "Nfcn = " << fState.NFcn() << std::endl;
481  for (unsigned int i = 0; i < fState.MinuitParameters().size(); ++i) {
482  const MinuitParameter & par = fState.Parameter(i);
483  std::cout << par.Name() << "\t = " << par.Value() << "\t ";
484  if (par.IsFixed() ) std::cout << "(fixed)" << std::endl;
485  else if (par.IsConst() ) std::cout << "(const)" << std::endl;
486  else if (par.HasLimits() )
487  std::cout << "+/- " << par.Error() << "\t(limited)"<< std::endl;
488  else
489  std::cout << "+/- " << par.Error() << std::endl;
490  }
491 */
492  } else {
493  /*
494  std::cout << "HybridMinimizer : Invalid Minimum - status = " << fStatus << std::endl;
495  std::cout << "FVAL = " << fState.Fval() << std::endl;
496  std::cout << "Edm = " << fState.Edm() << std::endl;
497  std::cout << "Nfcn = " << fState.NFcn() << std::endl;
498 */
499  }
500  }
501 
502  const double *HybridMinimizer::X() const {
503  // return values at minimum

◆ ProvidesError()

bool PSFitter::HybridMinimizer::ProvidesError ( ) const
inlineoverride

minimizer provides error and error matrix

Definition at line 153 of file HybridMinimizer.h.

154 { return true; }

◆ Scan()

bool PSFitter::HybridMinimizer::Scan ( unsigned int  i,
unsigned int &  nstep,
double *  x,
double *  y,
double  xmin = 0,
double  xmax = 0 
)
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 804 of file HybridMinimizer.cc.

807  {
808  edm::LogError("HybridMinimizer::Scan") << " Function must be set before using Scan";
809  return false;
810  }
811 
812  if (ipar > fState.MinuitParameters().size()) {
813  edm::LogError("HybridMinimizer::Scan") << " Invalid number. Minimizer variables must be set before using Scan";
814  return false;
815  }
816 
817  // switch off Minuit2 printing
818  int prev_level = (PrintLevel() <= 0) ? TurnOffPrintInfoLevel() : -2;
819 
820  //MnPrint::SetLevel(PrintLevel());
821 
822  // set the precision if needed
823  if (Precision() > 0)
824  fState.SetPrecision(Precision());
825 
826  MnParameterScan scan(*fMinuitFCN, fState.Parameters());
827  double amin = scan.Fval(); // fcn value of the function before scan
828 
829  // first value is param value
830  std::vector<std::pair<double, double> > result = scan(ipar, nstep - 1, xmin, xmax);
831 
832  if (prev_level > -2)
833  RestoreGlobalPrintLevel(prev_level);
834 
835  if (result.size() != nstep) {
836  edm::LogError("HybridMinimizer::Scan") << " Invalid result from MnParameterScan";
837  return false;
838  }
839  // sort also the returned points in x
840  std::sort(result.begin(), result.end());
841 
842  for (unsigned int i = 0; i < nstep; ++i) {
843  x[i] = result[i].first;
844  y[i] = result[i].second;
845  }
846 
847  // what to do if a new minimum has been found ?
848  // use that as new minimum
849  if (scan.Fval() < amin) {
850  if (PrintLevel() > 0)
851  edm::LogInfo("HybridMinimizer::Scan") << "A new minimum has been found";
852  fState.SetValue(ipar, scan.Parameters().Value(ipar));
853  }
854 
855  return true;
856  }
857 
858  bool HybridMinimizer::Contour(unsigned int ipar, unsigned int jpar, unsigned int &npoints, double *x, double *y) {
859  // contour plot for parameter i and j

◆ SetFixedVariable()

bool PSFitter::HybridMinimizer::SetFixedVariable ( unsigned int  ivar,
const std::string &  name,
double  val 
)
override

set fixed variable (override if minimizer supports them )

Definition at line 218 of file HybridMinimizer.cc.

219  : 0.1;
220  if (!SetVariable(ivar, name, val, step)) {
221  ivar = fState.Index(name);
222  }
223  fState.Fix(ivar);
224  return true;
225  }
226 
227  std::string HybridMinimizer::VariableName(unsigned int ivar) const {
228  // return the variable name

References fState, and Skims_PA_cff::name.

Referenced by PulseShapeFitOOTPileupCorrection::fit().

◆ SetFunction() [1/2]

void PSFitter::HybridMinimizer::SetFunction ( const ROOT::Math::IMultiGenFunction &  func)
override

set the function to minimize

Definition at line 261 of file HybridMinimizer.cc.

263  {
264  fMinuitFCN = new ROOT::Minuit2::FCNAdapter<ROOT::Math::IMultiGenFunction>(func, ErrorDef());
265  } else {
266  // for Fumili the fit method function interface is required
267  const ROOT::Math::FitMethodFunction *fcnfunc = dynamic_cast<const ROOT::Math::FitMethodFunction *>(&func);
268  if (!fcnfunc) {
269  edm::LogError("HybridMinimizer::SetFunction") << "HybridMinimizer: Wrong Fit method function for Fumili";
270  return;
271  }
272  fMinuitFCN = new ROOT::Minuit2::FumiliFCNAdapter<ROOT::Math::FitMethodFunction>(*fcnfunc, fDim, ErrorDef());
273  }
274  }
275 
276  void HybridMinimizer::SetFunction(const ROOT::Math::IMultiGradFunction &func) {
277  // set function to be minimized

References fMinuitFCN, and TrackCollections2monitor_cff::func.

Referenced by PulseShapeFitOOTPileupCorrection::fit().

◆ SetFunction() [2/2]

void PSFitter::HybridMinimizer::SetFunction ( const ROOT::Math::IMultiGradFunction &  func)
override

set gradient the function to minimize

Definition at line 279 of file HybridMinimizer.cc.

281  {
282  fMinuitFCN = new ROOT::Minuit2::FCNGradAdapter<ROOT::Math::IMultiGradFunction>(func, ErrorDef());
283  } else {
284  // for Fumili the fit method function interface is required
285  const ROOT::Math::FitMethodGradFunction *fcnfunc = dynamic_cast<const ROOT::Math::FitMethodGradFunction *>(&func);
286  if (!fcnfunc) {
287  edm::LogError("HybridMinimizer::SetFunction") << "HybridMinimizer: Wrong Fit method function for Fumili";
288  return;
289  }
290  fMinuitFCN = new ROOT::Minuit2::FumiliFCNAdapter<ROOT::Math::FitMethodGradFunction>(*fcnfunc, fDim, ErrorDef());
291  }
292  }
293 
295  // perform the minimization

References fMinuitFCN, and TrackCollections2monitor_cff::func.

◆ SetLimitedVariable()

bool PSFitter::HybridMinimizer::SetLimitedVariable ( unsigned int  ivar,
const std::string &  name,
double  val,
double  step,
double  lower,
double  upper 
)
override

set upper/lower limited variable (override if minimizer supports them )

Definition at line 209 of file HybridMinimizer.cc.

215  {
216  // add a fixed variable

Referenced by PulseShapeFitOOTPileupCorrection::fit().

◆ SetLowerLimitedVariable()

bool PSFitter::HybridMinimizer::SetLowerLimitedVariable ( unsigned int  ivar,
const std::string &  name,
double  val,
double  step,
double  lower 
)
override

set lower limit variable (override if minimizer supports them )

Definition at line 191 of file HybridMinimizer.cc.

198  {

◆ SetMinimizer()

virtual void PSFitter::HybridMinimizer::SetMinimizer ( ROOT::Minuit2::ModularFunctionMinimizer *  m)
inlineprotectedvirtual

Definition at line 264 of file HybridMinimizer.h.

References fMinimizer, and visualization-live-secondInstance_cfg::m.

Referenced by SetMinimizerType().

◆ SetMinimizerType()

void PSFitter::HybridMinimizer::SetMinimizerType ( EMinimizerType  type)

Definition at line 101 of file HybridMinimizer.cc.

105  {
106  case kMigrad:
107  //std::cout << "HybridMinimizer: minimize using MIGRAD " << std::endl;
108  SetMinimizer(new ROOT::Minuit2::VariableMetricMinimizer());
109  return;
110  case kSimplex:
111  //std::cout << "HybridMinimizer: minimize using SIMPLEX " << std::endl;
112  SetMinimizer(new ROOT::Minuit2::SimplexMinimizer());
113  return;
114  case kCombined:
115  SetMinimizer(new ROOT::Minuit2::CombinedMinimizer());
116  return;
117  case kScan:
118  SetMinimizer(new ROOT::Minuit2::ScanMinimizer());
119  return;
120  case kFumili:
121  SetMinimizer(new ROOT::Minuit2::FumiliMinimizer());
122  fUseFumili = true;
123  return;
124  default:
125  //migrad minimizer
126  SetMinimizer(new ROOT::Minuit2::VariableMetricMinimizer());
127  }
128  }
129 
131  // Destructor implementation.

References fUseFumili, kCombined, kFumili, kMigrad, kScan, kSimplex, and SetMinimizer().

Referenced by PulseShapeFitOOTPileupCorrection::fit().

◆ SetUpperLimitedVariable()

bool PSFitter::HybridMinimizer::SetUpperLimitedVariable ( unsigned int  ivar,
const std::string &  name,
double  val,
double  step,
double  upper 
)
override

set upper limit variable (override if minimizer supports them )

Definition at line 200 of file HybridMinimizer.cc.

207  {

◆ SetVariable()

bool PSFitter::HybridMinimizer::SetVariable ( unsigned int  ivar,
const std::string &  name,
double  val,
double  step 
)
override

set free variable

Definition at line 165 of file HybridMinimizer.cc.

171  {
172  edm::LogInfo("HybridMinimizer::SetVariable")
173  .format("Parameter {} has zero or invalid step size - consider it as constant", name);
174  fState.Add(name, val);
175  } else
176  fState.Add(name, val, step);
177 
178  unsigned int minuit2Index = fState.Index(name);
179  if (minuit2Index != ivar) {
180  edm::LogInfo("HybridMinimizer::SetVariable").format("Wrong index used for the variable {} {}", name, minuit2Index);
181  return false;
182  }
183  fState.RemoveLimits(ivar);
184 
185  return true;
186  }
187 
189  unsigned int ivar, const std::string &name, double val, double step, double lower) {

References fState, Skims_PA_cff::name, and heppy_batch::val.

◆ SetVariableValue()

bool PSFitter::HybridMinimizer::SetVariableValue ( unsigned int  ivar,
double  val 
)
override

set variable

Definition at line 243 of file HybridMinimizer.cc.

248  {
249  // set value for variable ivar (only for existing parameters)

◆ SetVariableValues()

bool PSFitter::HybridMinimizer::SetVariableValues ( const double *  val)
override

Definition at line 251 of file HybridMinimizer.cc.

258  {
259  // set function to be minimized

◆ State()

const ROOT::Minuit2::MnUserParameterState& PSFitter::HybridMinimizer::State ( )
inline

return the minimizer state (containing values, step size , etc..)

Definition at line 255 of file HybridMinimizer.h.

◆ VariableIndex()

int PSFitter::HybridMinimizer::VariableIndex ( const std::string &  name) const
override

get index of variable given a variable given a name return -1 if variable is not found

Definition at line 237 of file HybridMinimizer.cc.

240  {
241  // set value for variable ivar (only for existing parameters)

◆ VariableName()

std::string PSFitter::HybridMinimizer::VariableName ( unsigned int  ivar) const
override

get name of variables (override if minimizer support storing of variable names)

Definition at line 230 of file HybridMinimizer.cc.

234  {
235  // return the variable index

◆ X()

const double * PSFitter::HybridMinimizer::X ( ) const
override

return pointer to X values at the minimum

Definition at line 505 of file HybridMinimizer.cc.

512  {
513  fValues[i] = paramsObj[i].Value();
514  }
515 
516  return &fValues.front();
517  }
518 
519  const double *HybridMinimizer::Errors() const {
520  // return error at minimum (set to zero for fixed and constant params)

References fValues, and mps_fire::i.

Referenced by svgfig.Curve.Sample::__repr__(), and PulseShapeFitOOTPileupCorrection::fit().

Member Data Documentation

◆ fDim

unsigned int PSFitter::HybridMinimizer::fDim
private

Definition at line 272 of file HybridMinimizer.h.

Referenced by GetCovMatrix(), and GetHessianMatrix().

◆ fErrors

std::vector<double> PSFitter::HybridMinimizer::fErrors
mutableprivate

Definition at line 281 of file HybridMinimizer.h.

Referenced by Errors().

◆ fMinimizer

ROOT::Minuit2::ModularFunctionMinimizer* PSFitter::HybridMinimizer::fMinimizer
private

Definition at line 277 of file HybridMinimizer.h.

Referenced by GetMinimizer(), and SetMinimizer().

◆ fMinimum

ROOT::Minuit2::FunctionMinimum* PSFitter::HybridMinimizer::fMinimum
private

Definition at line 279 of file HybridMinimizer.h.

Referenced by CovMatrixStatus().

◆ fMinuitFCN

ROOT::Minuit2::FCNBase* PSFitter::HybridMinimizer::fMinuitFCN
private

Definition at line 278 of file HybridMinimizer.h.

Referenced by GetFCN(), and SetFunction().

◆ fState

ROOT::Minuit2::MnUserParameterState PSFitter::HybridMinimizer::fState
private

Definition at line 275 of file HybridMinimizer.h.

Referenced by GetCovMatrix(), GetHessianMatrix(), SetFixedVariable(), and SetVariable().

◆ fUseFumili

bool PSFitter::HybridMinimizer::fUseFumili
private

Definition at line 273 of file HybridMinimizer.h.

Referenced by SetMinimizerType().

◆ fValues

std::vector<double> PSFitter::HybridMinimizer::fValues
mutableprivate

Definition at line 280 of file HybridMinimizer.h.

Referenced by X().

npoints
static const int npoints
Definition: NuclearInteractionFTFSimulator.h:38
DDAxes::y
PSFitter::HybridMinimizer::SetVariable
bool SetVariable(unsigned int ivar, const std::string &name, double val, double step) override
set free variable
Definition: HybridMinimizer.cc:165
mps_fire.i
i
Definition: mps_fire.py:428
METSignificanceParams_cfi.jpar
jpar
Definition: METSignificanceParams_cfi.py:19
PSFitter::HybridMinimizer::kFumili
Definition: HybridMinimizer.h:46
PSFitter::HybridMinimizer::PrintResults
void PrintResults() override
print result of minimization
Definition: HybridMinimizer.cc:471
PSFitter::HybridMinimizer::kCombined
Definition: HybridMinimizer.h:46
step
step
Definition: StallMonitor.cc:94
min
T min(T a, T b)
Definition: MathUtil.h:58
PSFitter::HybridMinimizer::CovMatrixStatus
int CovMatrixStatus() const override
Definition: HybridMinimizer.cc:976
PSFitter::HybridMinimizer::~HybridMinimizer
~HybridMinimizer() override
Definition: HybridMinimizer.cc:133
PSFitter::HybridMinimizer::fValues
std::vector< double > fValues
Definition: HybridMinimizer.h:280
PSFitter::HybridMinimizer::GetMinimizer
virtual const ROOT::Minuit2::ModularFunctionMinimizer * GetMinimizer() const
Definition: HybridMinimizer.h:262
PSFitter::HybridMinimizer::Correlation
double Correlation(unsigned int i, unsigned int j) const override
Definition: HybridMinimizer.cc:616
cms::cuda::assert
assert(be >=bs)
HLT_FULL_cff.debugLevel
debugLevel
Definition: HLT_FULL_cff.py:88192
DDAxes::x
PSFitter::HybridMinimizer::GetHessianMatrix
bool GetHessianMatrix(double *h) const override
Definition: HybridMinimizer.cc:586
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
PSFitter::HybridMinimizer::Errors
const double * Errors() const override
return errors at the minimum
Definition: HybridMinimizer.cc:522
PSFitter::HybridMinimizer::SetFunction
void SetFunction(const ROOT::Math::IMultiGenFunction &func) override
set the function to minimize
Definition: HybridMinimizer.cc:261
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
PSFitter::HybridMinimizer::fMinimum
ROOT::Minuit2::FunctionMinimum * fMinimum
Definition: HybridMinimizer.h:279
PSFitter::TurnOffPrintInfoLevel
int TurnOffPrintInfoLevel()
Definition: HybridMinimizer.cc:69
PSFitter::HybridMinimizer::fState
ROOT::Minuit2::MnUserParameterState fState
Definition: HybridMinimizer.h:275
PSFitter::HybridMinimizer::GetFCN
virtual const ROOT::Minuit2::FCNBase * GetFCN() const
Definition: HybridMinimizer.h:266
PSFitter::HybridMinimizer::X
const double * X() const override
return pointer to X values at the minimum
Definition: HybridMinimizer.cc:505
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
PSFitter::HybridMinimizer::SetLowerLimitedVariable
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 )
Definition: HybridMinimizer.cc:191
PSFitter::RestoreGlobalPrintLevel
void RestoreGlobalPrintLevel(int)
Definition: HybridMinimizer.cc:71
dqmdumpme.k
k
Definition: dqmdumpme.py:60
sistrip::SpyUtilities::isValid
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
Definition: SiStripSpyUtilities.cc:124
PSFitter::HybridMinimizer::fDim
unsigned int fDim
Definition: HybridMinimizer.h:272
PSFitter::HybridMinimizer::SetMinimizer
virtual void SetMinimizer(ROOT::Minuit2::ModularFunctionMinimizer *m)
Definition: HybridMinimizer.h:264
PSFitter::HybridMinimizer::Scan
bool Scan(unsigned int i, unsigned int &nstep, double *x, double *y, double xmin=0, double xmax=0) override
Definition: HybridMinimizer.cc:804
PSFitter::HybridMinimizer::Hesse
bool Hesse() override
Definition: HybridMinimizer.cc:908
PSFitter::HybridMinimizer::Minimize
bool Minimize() override
Definition: HybridMinimizer.cc:297
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
PSFitter::HybridMinimizer::fMinuitFCN
ROOT::Minuit2::FCNBase * fMinuitFCN
Definition: HybridMinimizer.h:278
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
PSFitter::HybridMinimizer::kScan
Definition: HybridMinimizer.h:46
PSFitter::HybridMinimizer::fErrors
std::vector< double > fErrors
Definition: HybridMinimizer.h:281
PSFitter::HybridMinimizer::fMinimizer
ROOT::Minuit2::ModularFunctionMinimizer * fMinimizer
Definition: HybridMinimizer.h:277
PSFitter::HybridMinimizer::kMigrad
Definition: HybridMinimizer.h:46
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
PSFitter::HybridMinimizer::EMinimizerType
EMinimizerType
Definition: HybridMinimizer.h:46
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
g4SimHits_cfi.Tolerance
Tolerance
Definition: g4SimHits_cfi.py:98
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
PSFitter::HybridMinimizer::CovMatrix
double CovMatrix(unsigned int i, unsigned int j) const override
Definition: HybridMinimizer.cc:543
PSFitter::HybridMinimizer::kSimplex
Definition: HybridMinimizer.h:46
heppy_batch.val
val
Definition: heppy_batch.py:351
PSFitter::HybridMinimizer::VariableName
std::string VariableName(unsigned int ivar) const override
get name of variables (override if minimizer support storing of variable names)
Definition: HybridMinimizer.cc:230
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
mps_fire.result
result
Definition: mps_fire.py:311
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
PSFitter::HybridMinimizer::fUseFumili
bool fUseFumili
Definition: HybridMinimizer.h:273
edm::Log
Definition: MessageLogger.h:70
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52
up
Definition: BitonicSort.h:7
PSFitter::HybridMinimizer::Contour
bool Contour(unsigned int i, unsigned int j, unsigned int &npoints, double *xi, double *xj) override
Definition: HybridMinimizer.cc:861
PSFitter::HybridMinimizer::ExamineMinimum
bool ExamineMinimum(const ROOT::Minuit2::FunctionMinimum &min)
examine the minimum result
Definition: HybridMinimizer.cc:407