/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Geometry/HGCalCommonData/interface/HGCalGeometryMode.h
55 строк
1 KB
Sunanda
Add afew new modes to enable cog computation for wafers as default for the future V19 version of HGCal
03 июл 2024, 10:03
03 июл 2024, 10:03
69c5983
Код
Авторство
О чём код?
#ifndef Geometry_HGCalCommonData_HGCalGeometryMode_H #define Geometry_HGCalCommonData_HGCalGeometryMode_H #include <algorithm> #include <map> #include <string> #include "DetectorDescription/Core/interface/DDsvalues.h" #include "FWCore/Utilities/interface/Exception.h" template <typename T> class HGCalStringToEnumParser { std::map<std::string, T> enumMap; public: HGCalStringToEnumParser(void); T parseString(const std::string& value) { typename std::map<std::string, T>::const_iterator itr = enumMap.find(value); if (itr == enumMap.end()) throw cms::Exception("Configuration") << "the value " << value << " is not defined."; return itr->second; } }; namespace HGCalGeometryMode { enum GeometryMode { Square = 0, Hexagon = 1, HexagonFull = 2, Hexagon8 = 3, Hexagon8Full = 4, Trapezoid = 5, Hexagon8File = 6, TrapezoidFile = 7, Hexagon8Module = 8, TrapezoidModule = 9, Hexagon8Cassette = 10, TrapezoidCassette = 11, Hexagon8CalibCell = 12, TrapezoidFineCell = 13, Hexagon8FineCell = 14, }; enum WaferMode { Polyhedra = 0, ExtrudedPolygon = 1 }; // Gets Geometry mode GeometryMode getGeometryMode(const char* s, const DDsvalues_type& sv); GeometryMode getGeometryMode(const std::string& s); // Gets wafer mode WaferMode getGeometryWaferMode(const char* s, const DDsvalues_type& sv); WaferMode getGeometryWaferMode(std::string& s); }; // namespace HGCalGeometryMode #endif