CMS 3D CMS Logo

MTDTopologyMode.h
Go to the documentation of this file.
1 #ifndef Geometry_MTDCommonData_MTDTopologyMode_H
2 #define Geometry_MTDCommonData_MTDTopologyMode_H
3 
5 #include <map>
6 #include <string>
7 #include <algorithm>
8 
11 
12 namespace MTDTopologyMode {
13 
14  enum class Mode {
15  undefined = 0,
16  tile = 1,
17  bar = 2,
18  barzflat = 3,
19  barphiflat = 4,
20  btlv1etlv4 = 5,
21  btlv1etlv5 = 6,
22  btlv2etlv5 = 7
23  };
24 
26 
29  inline BTLDetId::CrysLayout crysLayoutFromTopoMode(const int& topoMode) {
30  if (topoMode < 0 || topoMode > static_cast<int>(Mode::btlv2etlv5)) {
31  throw cms::Exception("UnknownMTDtopoMode") << "Unknown MTD topology mode " << topoMode;
32  } else if (topoMode <= static_cast<int>(BTLDetId::CrysLayout::barphiflat)) {
33  return static_cast<BTLDetId::CrysLayout>(topoMode);
34  } else if (topoMode < static_cast<int>(Mode::btlv2etlv5)) {
36  } else {
38  }
39  }
40 
43  inline ETLDetId::EtlLayout etlLayoutFromTopoMode(const int& topoMode) {
44  if (topoMode < 0 || topoMode > static_cast<int>(Mode::btlv2etlv5)) {
45  throw cms::Exception("UnknownMTDtopoMode") << "Unknown MTD topology mode " << topoMode;
46  } else if (topoMode <= static_cast<int>(BTLDetId::CrysLayout::barphiflat)) {
48  } else if (topoMode == static_cast<int>(Mode::btlv1etlv4)) {
50  } else {
52  }
53  }
54 
55 } // namespace MTDTopologyMode
56 
57 #endif // Geometry_MTDCommonData_MTDTopologyMode_H
CrysLayout
Definition: BTLDetId.h:46
Mode MTDStringToEnumParser(const std::string &)
ETLDetId::EtlLayout etlLayoutFromTopoMode(const int &topoMode)
BTLDetId::CrysLayout crysLayoutFromTopoMode(const int &topoMode)