File indexing completed on 2024-04-06 12:15:18
0001 #ifndef Geometry_MuonNumbering_MuonGeometryConstants_h
0002 #define Geometry_MuonNumbering_MuonGeometryConstants_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
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