File indexing completed on 2024-04-06 12:14:45
0001 #ifndef Geometry_HcalCommonData_HcalTopologyMode_H
0002 #define Geometry_HcalCommonData_HcalTopologyMode_H
0003
0004 #include "FWCore/Utilities/interface/Exception.h"
0005 #include <map>
0006 #include <string>
0007 #include <algorithm>
0008
0009 template <typename T>
0010 class StringToEnumParser {
0011 std::map<std::string, T> enumMap;
0012
0013 public:
0014 StringToEnumParser(void);
0015
0016 T parseString(const std::string &value) {
0017 typename std::map<std::string, T>::const_iterator iValue = enumMap.find(value);
0018 if (iValue == enumMap.end())
0019 throw cms::Exception("Configuration") << "the value " << value << " is not defined.";
0020
0021 return iValue->second;
0022 }
0023 };
0024
0025 namespace HcalTopologyMode {
0026 enum Mode { LHC = 0, H2 = 1, SLHC = 2, H2HE = 3 };
0027
0028 enum TriggerMode {
0029 TriggerMode_2009 = 0,
0030 TriggerMode_2016 = 1,
0031 TriggerMode_2018legacy = 2,
0032 TriggerMode_2017 = 3,
0033 TriggerMode_2017plan1 = 4,
0034 TriggerMode_2018 = 5,
0035 TriggerMode_2021 = 6
0036 };
0037 }
0038
0039 #endif