CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalStringToEnumParser< T > Class Template Reference

#include <HGCalGeometryMode.h>

Public Member Functions

template<>
 HGCalStringToEnumParser ()
 
 HGCalStringToEnumParser (void)
 
template<>
 HGCalStringToEnumParser ()
 
T parseString (const std::string &value)
 

Private Attributes

std::map< std::string, TenumMap
 

Detailed Description

template<typename T>
class HGCalStringToEnumParser< T >

Definition at line 11 of file HGCalGeometryMode.h.

Constructor & Destructor Documentation

◆ HGCalStringToEnumParser() [1/3]

template<typename T>
HGCalStringToEnumParser< T >::HGCalStringToEnumParser ( void  )

◆ HGCalStringToEnumParser() [2/3]

Definition at line 5 of file HGCalGeometryMode.cc.

References HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8CalibCell, HGCalGeometryMode::Hexagon8Cassette, HGCalGeometryMode::Hexagon8File, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::Hexagon8Module, HGCalGeometryMode::HexagonFull, HGCalGeometryMode::Square, HGCalGeometryMode::Trapezoid, HGCalGeometryMode::TrapezoidCassette, HGCalGeometryMode::TrapezoidFile, and HGCalGeometryMode::TrapezoidModule.

5  {
6  enumMap["HGCalGeometryMode::Square"] = HGCalGeometryMode::Square;
7  enumMap["HGCalGeometryMode::Hexagon"] = HGCalGeometryMode::Hexagon;
8  enumMap["HGCalGeometryMode::HexagonFull"] = HGCalGeometryMode::HexagonFull;
9  enumMap["HGCalGeometryMode::Hexagon8"] = HGCalGeometryMode::Hexagon8;
10  enumMap["HGCalGeometryMode::Hexagon8Full"] = HGCalGeometryMode::Hexagon8Full;
11  enumMap["HGCalGeometryMode::Trapezoid"] = HGCalGeometryMode::Trapezoid;
12  enumMap["HGCalGeometryMode::Hexagon8File"] = HGCalGeometryMode::Hexagon8File;
13  enumMap["HGCalGeometryMode::TrapezoidFile"] = HGCalGeometryMode::TrapezoidFile;
14  enumMap["HGCalGeometryMode::Hexagon8Module"] = HGCalGeometryMode::Hexagon8Module;
15  enumMap["HGCalGeometryMode::TrapezoidModule"] = HGCalGeometryMode::TrapezoidModule;
16  enumMap["HGCalGeometryMode::Hexagon8Cassette"] = HGCalGeometryMode::Hexagon8Cassette;
17  enumMap["HGCalGeometryMode::TrapezoidCassette"] = HGCalGeometryMode::TrapezoidCassette;
18  enumMap["HGCalGeometryMode::Hexagon8CalibCell"] = HGCalGeometryMode::Hexagon8CalibCell;
19 }
std::map< std::string, T > enumMap

◆ HGCalStringToEnumParser() [3/3]

Definition at line 22 of file HGCalGeometryMode.cc.

References HGCalGeometryMode::ExtrudedPolygon, and HGCalGeometryMode::Polyhedra.

22  {
23  enumMap["HGCalGeometryMode::Polyhedra"] = HGCalGeometryMode::Polyhedra;
24  enumMap["HGCalGeometryMode::ExtrudedPolygon"] = HGCalGeometryMode::ExtrudedPolygon;
25 }
std::map< std::string, T > enumMap

Member Function Documentation

◆ parseString()

template<typename T>
T HGCalStringToEnumParser< T >::parseString ( const std::string &  value)
inline

Definition at line 17 of file HGCalGeometryMode.h.

References HGCalStringToEnumParser< T >::enumMap.

Referenced by HGCalGeometryMode::getGeometryMode(), and HGCalGeometryMode::getGeometryWaferMode().

17  {
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  }
std::map< std::string, T > enumMap
Definition: value.py:1

Member Data Documentation

◆ enumMap

template<typename T>
std::map<std::string, T> HGCalStringToEnumParser< T >::enumMap
private

Definition at line 12 of file HGCalGeometryMode.h.

Referenced by HGCalStringToEnumParser< T >::parseString().