CMS 3D CMS Logo

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

#include <HcalTopologyMode.h>

Public Member Functions

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

Private Attributes

std::map< std::string, TenumMap
 

Detailed Description

template<typename T>
class StringToEnumParser< T >

Definition at line 10 of file HcalTopologyMode.h.

Constructor & Destructor Documentation

◆ StringToEnumParser() [1/3]

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

◆ StringToEnumParser() [2/3]

Definition at line 4 of file HcalTopologyMode.cc.

4  {
5  enumMap["HcalTopologyMode::LHC"] = HcalTopologyMode::LHC;
6  enumMap["HcalTopologyMode::H2"] = HcalTopologyMode::H2;
7  enumMap["HcalTopologyMode::SLHC"] = HcalTopologyMode::SLHC;
8  enumMap["HcalTopologyMode::H2HE"] = HcalTopologyMode::H2HE;
9 }

References HcalTopologyMode::H2, HcalTopologyMode::H2HE, HcalTopologyMode::LHC, and HcalTopologyMode::SLHC.

◆ StringToEnumParser() [3/3]

Definition at line 12 of file HcalTopologyMode.cc.

12  {
13  enumMap["HcalTopologyMode::TriggerMode_2009"] = HcalTopologyMode::TriggerMode_2009;
14  enumMap["HcalTopologyMode::TriggerMode_2016"] = HcalTopologyMode::TriggerMode_2016;
15  enumMap["HcalTopologyMode::TriggerMode_2017"] = HcalTopologyMode::TriggerMode_2017;
16  enumMap["HcalTopologyMode::TriggerMode_2017plan1"] = HcalTopologyMode::TriggerMode_2017plan1;
17  enumMap["HcalTopologyMode::TriggerMode_2018"] = HcalTopologyMode::TriggerMode_2018;
18  enumMap["HcalTopologyMode::TriggerMode_2021"] = HcalTopologyMode::TriggerMode_2021;
19 }

References HcalTopologyMode::TriggerMode_2009, HcalTopologyMode::TriggerMode_2016, HcalTopologyMode::TriggerMode_2017, HcalTopologyMode::TriggerMode_2017plan1, HcalTopologyMode::TriggerMode_2018, and HcalTopologyMode::TriggerMode_2021.

Member Function Documentation

◆ parseString()

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

Definition at line 16 of file HcalTopologyMode.h.

16  {
17  typename std::map<std::string, T>::const_iterator iValue = enumMap.find(value);
18  if (iValue == enumMap.end())
19  throw cms::Exception("Configuration") << "the value " << value << " is not defined.";
20 
21  return iValue->second;
22  }

References StringToEnumParser< T >::enumMap.

Member Data Documentation

◆ enumMap

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

Definition at line 11 of file HcalTopologyMode.h.

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

HcalTopologyMode::TriggerMode_2009
Definition: HcalTopologyMode.h:29
HcalTopologyMode::LHC
Definition: HcalTopologyMode.h:26
HcalTopologyMode::TriggerMode_2021
Definition: HcalTopologyMode.h:35
HcalTopologyMode::TriggerMode_2016
Definition: HcalTopologyMode.h:30
HcalTopologyMode::TriggerMode_2017
Definition: HcalTopologyMode.h:32
HcalTopologyMode::TriggerMode_2017plan1
Definition: HcalTopologyMode.h:33
HcalTopologyMode::H2HE
Definition: HcalTopologyMode.h:26
StringToEnumParser::enumMap
std::map< std::string, T > enumMap
Definition: HcalTopologyMode.h:11
HcalTopologyMode::SLHC
Definition: HcalTopologyMode.h:26
HcalTopologyMode::H2
Definition: HcalTopologyMode.h:26
value
Definition: value.py:1
HcalTopologyMode::TriggerMode_2018
Definition: HcalTopologyMode.h:34
cms::Exception
Definition: Exception.h:70