File indexing completed on 2024-04-06 11:56:06
0001 #include "Alignment/CommonAlignment/interface/AlignableMap.h"
0002
0003 #include "FWCore/Utilities/interface/Exception.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005
0006
0007 align::Alignables& AlignableMap::get(const std::string& name) { return theStore[name]; }
0008
0009
0010 align::Alignables& AlignableMap::find(const std::string& name) {
0011 typename Container::iterator o = theStore.find(name);
0012
0013 if (theStore.end() == o) {
0014 std::ostringstream knownKeys;
0015 for (auto it = theStore.begin(); it != theStore.end(); ++it) {
0016 knownKeys << (it != theStore.begin() ? ", " : "") << it->first;
0017 }
0018
0019 throw cms::Exception("AlignableMapError") << "Cannot find an object of name " << name << " in AlignableMap, "
0020 << "know only " << knownKeys.str() << ".";
0021 }
0022
0023 return o->second;
0024 }
0025
0026
0027 void AlignableMap::dump(void) const {
0028 edm::LogInfo("AlignableMap") << "Printing out AlignSetup: ";
0029 for (typename Container::const_iterator it = theStore.begin(); it != theStore.end(); ++it) {
0030 edm::LogVerbatim("AlignableMap") << it->first << std::endl;
0031 }
0032 }