template<class Function>
class fit::RootMinuitCommands< Function >
Definition at line 50 of file RootMinuitCommands.h.
template<typename Function >
Definition at line 108 of file RootMinuitCommands.h.
References runTheMatrix::cmssw_base, tkAlTrackRefitSequence_cff::commands, edm::errors::Configuration, gather_cfg::cout, ztail::d, fit::RootMinuitCommand::doubleArgs, MillePedeFileConverter_cfg::e, fit::parameter_t::err, Exception, f, FrontierConditions_GlobalTag_cff::file, fit::parameter_t::fixed, alignBH_cfg::fixed, mps_fire::i, dqmiolumiharvest::j, join(), kFix, kMigrad, kMinimize, kParameter, kPrintAll, kRelease, kSet, dqmdumpme::last, mps_splice::line, fit::parameter_t::max, fit::parameter_t::min, eostools::move(), fit::RootMinuitCommand::name, fit::RootMinuitCommand::print(), alignCSCRings::s, fit::RootMinuitCommand::stringArgs, and fit::parameter_t::val.
110 string cmssw_release_base = std::getenv(
"CMSSW_RELEASE_BASE");
111 string cmssw_base = std::getenv(
"CMSSW_BASE");
112 vector<string> directories;
113 directories.reserve(3);
114 directories.emplace_back(
".");
115 if (!cmssw_release_base.empty()) {
116 directories.emplace_back(cmssw_release_base +
"/src");
118 if (!cmssw_base.empty()) {
119 directories.emplace_back(cmssw_base +
"/src");
122 for (
auto const&
d : directories) {
129 if (!file.is_open()) {
131 <<
"RootMinuitCommands: can't open file: " << fileName
135 cout <<
">>> configuration file: " << fileName << endl;
139 while (getline(file, line)) {
141 if (line.size() == 0)
143 char last = *line.rbegin();
144 if (!(last >=
'0' && last <=
'z'))
145 line.erase(line.end() - 1);
146 boost::char_separator<char> sep(
" ");
148 tokenizer::iterator
i = tokens.begin(),
e = tokens.end();
149 if (tokens.begin() == tokens.end())
151 if (*(i->begin()) !=
'#') {
155 <<
errorHeader() <<
"please, declare all parameter before all other minuit commands.\n";
162 tokenizer::iterator
j =
i;
166 if (fixed ==
"fixed")
168 else if (fixed ==
"free")
172 <<
errorHeader() <<
"fix parameter option unknown: " << *i <<
"\n" 173 <<
"valid options are: fixed, free.\n";
177 pars_.push_back(std::make_pair(name, par));
181 cout <<
">>> " <<
kParameter <<
" " << name <<
" " << par.val <<
" [" << par.min <<
", " << par.max <<
"]," 182 <<
" err: " << par.err << endl;
188 com.stringArgs.push_back(arg);
195 }
else if (*i ==
kSet) {
200 com.stringArgs.push_back(arg);
224 cout <<
">>> end configuration" << endl;
std::string errorHeader() const
boost::tokenizer< boost::char_separator< char > > tokenizer
double par(const std::string &name)
std::vector< command > commands_
std::string nextToken(typename tokenizer::iterator &i, const typename tokenizer::iterator &end) const
bool fixed(const std::string &name)
double string2double(const std::string &str) const
std::map< std::string, size_t > parIndices_
static std::string join(char **cmd)
RootMinuitCommand command