30 using AlignablesMap = std::map<std::string, align::Alignables>;
31 AlignablesMap alisMap;
32 for (align::Alignables::const_iterator iA = alignables.begin(); iA != alignables.end(); ++iA) {
44 const AlignablesMap::iterator itTec = alisMap.find(
"TECEndcap");
45 for (AlignablesMap::iterator it = alisMap.begin(); it != alisMap.end(); ++it) {
50 if (itTec != alisMap.end())
62 std::ostringstream
name;
65 if (!globalParameters.
empty()) {
67 << globalParameters.
getParameterNames().size() <<
" global parameters" << std::endl;
72 LogDebug(
"PrintParameters") <<
indent_ <<
" global parameter is now:" << std::endl;
77 for (align::Alignables::const_iterator iter = alignables.begin(); iter != alignables.end(); ++iter) {
86 << localParameters.
getParameterNames().size() <<
" local parameters" << std::endl;
90 LogDebug(
"PrintParameters") <<
indent_ <<
" parameters to apply:" << std::endl;
98 std::vector<std::string> parameterSetNames;
100 if ((*iter)->size() > 0 && !parameterSetNames.empty())
117 for (std::vector<std::string>::iterator iter = globalParameterNames.begin(); iter != globalParameterNames.end();
122 if (subLocalSet.
empty()) {
124 localSet.
copyFrom(globalSet, (*iter));
132 localSet.
copyFrom(globalSet, (*iter));
149 for (std::vector<std::string>::iterator iter = parameterNames.begin(); iter != parameterNames.end(); ++iter) {
151 LogDebug(
"PropagateParameters") <<
indent_ <<
" - adding parameter " << (*iter) << std::endl;
157 std::vector<std::string> pSetNames;
159 for (std::vector<std::string>::const_iterator it = pSetNames.begin(); it != pSetNames.end(); ++it) {
162 if (rootName.compare(0, rootName.length(), globalRoot) == 0) {
164 LogDebug(
"PropagateParameters") <<
indent_ <<
" - skipping PSet " << (*it) <<
" from global " << globalName
168 LogDebug(
"PropagateParameters") <<
indent_ <<
" - skipping top-level PSet " << (*it) <<
" global " << globalName
173 LogDebug(
"PropagateParameters") <<
indent_ <<
" - skipping PSet " << (*it) <<
" not fitting into global "
174 << globalName << std::endl;
178 throw cms::Exception(
"BadConfig") <<
"Unknown parameter set name " << rootName;
182 LogDebug(
"PropagateParameters") <<
indent_ <<
" - adding PSet " << (*it) <<
" global " << globalName
202 std::vector<std::string> parameterSetNames;
217 unsigned int nFittingPsets = 0;
221 for (std::vector<std::string>::iterator iter = pNames.begin(); iter != pNames.end(); ++iter) {
227 if (numberString.empty()) {
232 size_t pos = numberString.find_first_of(
'_', lastPos);
233 while (std::string::npos !=
pos || std::string::npos != lastPos) {
234 const std::string digit(numberString.substr(lastPos,
pos - lastPos));
236 bool isDigit = !digit.empty();
237 for (std::string::const_iterator dIt = digit.begin(); dIt != digit.end(); ++dIt) {
244 <<
"[MisalignmentScenarioBuilder::getParameterSet_] "
245 <<
"Expect only numbers, separated by '_' after " <<
levelName <<
" in " << *iter << std::endl;
250 if (atoi(digit.c_str()) == iComponent) {
256 lastPos = numberString.find_first_not_of(
'_',
pos);
257 pos = numberString.find_first_of(
'_', lastPos);
261 if (nFittingPsets > 1) {
262 throw cms::Exception(
"BadConfig") <<
"[MisalignmentScenarioBuilder::getParameterSet_] "
263 <<
"Found " << nFittingPsets <<
" PSet for " <<
levelName <<
" " << iComponent
282 for (std::vector<std::string>::iterator iter = parameterNames.begin(); iter != parameterNames.end(); ++iter) {
319 if (
root ==
"DTSector")
321 else if (
root ==
"CSCSector")
323 else if (
root ==
"Muon")
340 const auto lastChar = parameterSetName.length() - 1;
341 if (parameterSetName[lastChar] ==
's') {
342 result = parameterSetName.substr(0, lastChar);
346 for (
auto ichar = lastChar; ichar != 0; --ichar) {
347 if (!isdigit(parameterSetName[ichar])) {
348 result = parameterSetName.substr(0, ichar + 1);
354 LogDebug(
"PrintParameters") <<
"Name was " << parameterSetName <<
", root is " <<
result;