Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:50:02

0001 #include "Geometry/MuonNumbering/interface/MuonGeometryConstants.h"
0002 
0003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0004 #include "FWCore/Utilities/interface/Exception.h"
0005 
0006 //#define EDM_ML_DEBUG
0007 
0008 int MuonGeometryConstants::getValue(const std::string& name) const {
0009 #ifdef EDM_ML_DEBUG
0010   edm::LogVerbatim("MuonGeom") << "about to look for ... " << name << std::endl;
0011 #endif
0012   if (namesAndValues_.empty())
0013     throw cms::Exception("GeometryBuildFailure", "MuonGeometryConstants does not have requested value for " + name);
0014 
0015   std::map<std::string, int>::const_iterator findIt = namesAndValues_.find(name);
0016   if (findIt == namesAndValues_.end())
0017     throw cms::Exception("GeometryBuildFailure", "MuonGeometryConstants does not have requested value for " + name);
0018 
0019 #ifdef EDM_ML_DEBUG
0020   edm::LogVerbatim("MuonGeom") << "MuonGeometryConstants::Value for " << name << " is " << findIt->second;
0021 #endif
0022   return findIt->second;
0023 }
0024 
0025 void MuonGeometryConstants::addValue(const std::string& name, const int& value) { namesAndValues_[name] = value; }
0026 
0027 #include "FWCore/Utilities/interface/typelookup.h"
0028 
0029 TYPELOOKUP_DATA_REG(MuonGeometryConstants);