Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:08

0001 #ifndef Geometry_TrackerNumberingBuilder_CmsTrackerStringToEnum_H
0002 #define Geometry_TrackerNumberingBuilder_CmsTrackerStringToEnum_H
0003 
0004 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
0005 #include <string>
0006 #include <map>
0007 /**
0008  * Builds map between Det type and an enum
0009  */
0010 class CmsTrackerStringToEnum {
0011 public:
0012   typedef std::map<std::string, GeometricDet::GeometricEnumType> MapEnumType;
0013   typedef std::map<GeometricDet::GeometricEnumType, std::string> ReverseMapEnumType;
0014 
0015   GeometricDet::GeometricEnumType type(std::string const&) const;
0016   std::string const& name(GeometricDet::GeometricEnumType) const;
0017 
0018 private:
0019   static MapEnumType const& map() { return m_impl._map; }
0020   static ReverseMapEnumType const& reverseMap() { return m_impl._reverseMap; }
0021 
0022   // a quick fix
0023   struct Impl {
0024     Impl();
0025     MapEnumType _map;
0026     ReverseMapEnumType _reverseMap;
0027   };
0028 
0029   static const Impl m_impl;
0030 };
0031 #endif