CMS 3D CMS Logo

HGCalGeometryMode.h
Go to the documentation of this file.
1 #ifndef Geometry_HGCalCommonData_HGCalGeometryMode_H
2 #define Geometry_HGCalCommonData_HGCalGeometryMode_H
3 
4 #include <algorithm>
5 #include <map>
6 #include <string>
9 
10 template <typename T>
12  std::map<std::string, T> enumMap;
13 
14 public:
16 
18  typename std::map<std::string, T>::const_iterator itr = enumMap.find(value);
19  if (itr == enumMap.end())
20  throw cms::Exception("Configuration") << "the value " << value << " is not defined.";
21  return itr->second;
22  }
23 };
24 
25 namespace HGCalGeometryMode {
26  enum GeometryMode {
27  Square = 0,
28  Hexagon = 1,
30  Hexagon8 = 3,
32  Trapezoid = 5,
40  };
41 
42  enum WaferMode { Polyhedra = 0, ExtrudedPolygon = 1 };
43 
44  // Gets Geometry mode
45  GeometryMode getGeometryMode(const char* s, const DDsvalues_type& sv);
47  // Gets wafer mode
48  WaferMode getGeometryWaferMode(const char* s, const DDsvalues_type& sv);
49 
51 }; // namespace HGCalGeometryMode
52 
53 #endif
T parseString(const std::string &value)
WaferMode getGeometryWaferMode(const char *s, const DDsvalues_type &sv)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
std::map< std::string, T > enumMap
GeometryMode getGeometryMode(const char *s, const DDsvalues_type &sv)
Definition: value.py:1
long double T