Setup Minimizer configuration on creation, reset the previous one on destruction. More...
#include <ProfileLikelihood.h>
Public Member Functions | |
MinimizerSentry (const std::string &algo, double tolerance) | |
~MinimizerSentry () | |
Private Attributes | |
std::string | minimizerAlgoBackup |
double | minimizerTollBackup |
std::string | minimizerTypeBackup |
Setup Minimizer configuration on creation, reset the previous one on destruction.
Definition at line 26 of file ProfileLikelihood.h.
ProfileLikelihood::MinimizerSentry::MinimizerSentry | ( | const std::string & | algo, |
double | tolerance | ||
) |
Definition at line 82 of file ProfileLikelihood.cc.
References algo, gather_cfg::cout, and UserOptions_cff::idx.
: minimizerTypeBackup(ROOT::Math::MinimizerOptions::DefaultMinimizerType()), minimizerAlgoBackup(ROOT::Math::MinimizerOptions::DefaultMinimizerAlgo()), minimizerTollBackup(ROOT::Math::MinimizerOptions::DefaultTolerance()) { ROOT::Math::MinimizerOptions::SetDefaultTolerance(tolerance); if (minimizerAlgo.find(",") != std::string::npos) { size_t idx = minimizerAlgo.find(","); std::string type = minimizerAlgo.substr(0,idx), algo = minimizerAlgo.substr(idx+1); if (verbose > 1) std::cout << "Set default minimizer to " << type << ", algorithm " << algo << std::endl; ROOT::Math::MinimizerOptions::SetDefaultMinimizer(type.c_str(), algo.c_str()); } else { if (verbose > 1) std::cout << "Set default minimizer to " << minimizerAlgo << std::endl; ROOT::Math::MinimizerOptions::SetDefaultMinimizer(minimizerAlgo.c_str()); } }
ProfileLikelihood::MinimizerSentry::~MinimizerSentry | ( | ) |
Definition at line 99 of file ProfileLikelihood.cc.
{ ROOT::Math::MinimizerOptions::SetDefaultTolerance(minimizerTollBackup); ROOT::Math::MinimizerOptions::SetDefaultMinimizer(minimizerTypeBackup.c_str(),minimizerAlgoBackup.empty() ? 0 : minimizerAlgoBackup.c_str()); }
std::string ProfileLikelihood::MinimizerSentry::minimizerAlgoBackup [private] |
Definition at line 31 of file ProfileLikelihood.h.
double ProfileLikelihood::MinimizerSentry::minimizerTollBackup [private] |
Definition at line 32 of file ProfileLikelihood.h.
std::string ProfileLikelihood::MinimizerSentry::minimizerTypeBackup [private] |
Definition at line 31 of file ProfileLikelihood.h.