Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:48:55

0001 #ifndef Geometry_MuonNumbering_MuonGeometryConstants_h
0002 #define Geometry_MuonNumbering_MuonGeometryConstants_h
0003 
0004 /** \class MuonGeometryConstants
0005  *
0006  * this class reads the constant section of
0007  * the muon-numbering xml-file
0008  *  
0009  * \author Sunanda Banerjee
0010  *  modified by:
0011  *   Taken from MuonDDDConstants
0012  *
0013  */
0014 
0015 #include <string>
0016 #include <map>
0017 #include <iostream>
0018 #include "CondFormats/Serialization/interface/Serializable.h"
0019 
0020 class MuonGeometryConstants {
0021 public:
0022   MuonGeometryConstants() {}
0023 
0024   int getValue(const std::string& name) const;
0025   void addValue(const std::string& name, const int& value);
0026   unsigned size() const { return namesAndValues_.size(); }
0027   std::pair<std::string, int> getEntry(const unsigned int k) const {
0028     auto itr = namesAndValues_.begin();
0029     for (unsigned int i = 0; i < k; ++i)
0030       ++itr;
0031     if (k < size())
0032       return std::pair<std::string, int>(itr->first, itr->second);
0033     else
0034       return std::pair<std::string, int>("Not Found", 0);
0035   }
0036 
0037 private:
0038   std::map<std::string, int> namesAndValues_;
0039   COND_SERIALIZABLE;
0040 };
0041 
0042 #endif