File indexing completed on 2022-04-20 11:33:52
0001 #ifndef Geometry_HGCalCommonData_HGCalGeometryMode_H
0002 #define Geometry_HGCalCommonData_HGCalGeometryMode_H
0003
0004 #include <algorithm>
0005 #include <map>
0006 #include <string>
0007 #include "FWCore/Utilities/interface/Exception.h"
0008
0009 template <typename T>
0010 class HGCalStringToEnumParser {
0011 std::map<std::string, T> enumMap;
0012
0013 public:
0014 HGCalStringToEnumParser(void);
0015
0016 T parseString(const std::string &value) {
0017 typename std::map<std::string, T>::const_iterator itr = enumMap.find(value);
0018 if (itr == enumMap.end())
0019 throw cms::Exception("Configuration") << "the value " << value << " is not defined.";
0020 return itr->second;
0021 }
0022 };
0023
0024 namespace HGCalGeometryMode {
0025 enum GeometryMode {
0026 Square = 0,
0027 Hexagon = 1,
0028 HexagonFull = 2,
0029 Hexagon8 = 3,
0030 Hexagon8Full = 4,
0031 Trapezoid = 5,
0032 Hexagon8File = 6,
0033 TrapezoidFile = 7,
0034 Hexagon8Module = 8,
0035 TrapezoidModule = 9,
0036 Hexagon8Cassette = 10,
0037 TrapezoidCassette = 11,
0038 };
0039 enum WaferMode { Polyhedra = 0, ExtrudedPolygon = 1 };
0040 }
0041
0042 #endif