CMS 3D CMS Logo

CmsTrackerStringToEnum.cc
Go to the documentation of this file.
2 
4 
6  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("FullTracker", GeometricDet::Tracker));
7 
8  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelBarrel", GeometricDet::PixelBarrel));
9  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelBarrelLayer", GeometricDet::layer));
10  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelBarrelLadder", GeometricDet::ladder));
11  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelBarrelDet", GeometricDet::DetUnit));
12 
13  _map.insert(
14  std::pair<std::string, GeometricDet::GeometricEnumType>("PixelPhase1Barrel", GeometricDet::PixelPhase1Barrel));
15 
16  _map.insert(
17  std::pair<std::string, GeometricDet::GeometricEnumType>("PixelPhase2Barrel", GeometricDet::PixelPhase2Barrel));
18 
19  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("Phase2OTBarrel", GeometricDet::OTPhase2Barrel));
20  _map.insert(
21  std::pair<std::string, GeometricDet::GeometricEnumType>("Phase2OTBarrelLayer", GeometricDet::OTPhase2Layer));
22  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("Phase2OTBarrelPanel", GeometricDet::panel));
23  _map.insert(
24  std::pair<std::string, GeometricDet::GeometricEnumType>("Phase2OTBarrelStack", GeometricDet::OTPhase2Stack));
25 
26  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelEndcapSubDet", GeometricDet::PixelEndCap));
27  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelEndcapDisk", GeometricDet::disk));
28  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelEndcapPanel", GeometricDet::panel));
29  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelEndcapDet", GeometricDet::DetUnit));
30 
31  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelPhase1EndcapSubDet",
33  _map.insert(
34  std::pair<std::string, GeometricDet::GeometricEnumType>("PixelPhase1EndcapDisk", GeometricDet::PixelPhase1Disk));
35 
36  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelPhase2EndcapSubDet",
38  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelPhase2EndcapFullDisk",
40  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelPhase2EndcapReducedDisk",
42  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("PixelPhase2EndcapTDRDisk",
44 
45  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("Phase2OTEndcap", GeometricDet::OTPhase2EndCap));
46  _map.insert(
47  std::pair<std::string, GeometricDet::GeometricEnumType>("Phase2OTEndcapDisk", GeometricDet::OTPhase2Wheel));
48  _map.insert(
49  std::pair<std::string, GeometricDet::GeometricEnumType>("Phase2OTEndcapStack", GeometricDet::OTPhase2Stack));
50 
51  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TIB", GeometricDet::TIB));
52  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TIBLayer", GeometricDet::layer));
53  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TIBString", GeometricDet::strng));
54  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TIBGluedDet", GeometricDet::mergedDet));
55  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TIBDet", GeometricDet::DetUnit));
56 
57  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TID", GeometricDet::TID));
58  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TIDWheel", GeometricDet::wheel));
59  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TIDRing", GeometricDet::ring));
60  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TIDGluedDet", GeometricDet::mergedDet));
61  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TIDDet", GeometricDet::DetUnit));
62 
63  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TOB", GeometricDet::TOB));
64  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TOBLayer", GeometricDet::layer));
65  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TOBRod", GeometricDet::rod));
66  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TOBGluedDet", GeometricDet::mergedDet));
67  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TOBDet", GeometricDet::DetUnit));
68 
69  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TEC", GeometricDet::TEC));
70  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TECWheel", GeometricDet::wheel));
71  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TECPetal", GeometricDet::petal));
72  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TECRing", GeometricDet::ring));
73  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TECGluedDet", GeometricDet::mergedDet));
74  _map.insert(std::pair<std::string, GeometricDet::GeometricEnumType>("TECDet", GeometricDet::DetUnit));
75 
76  //
77  // build reverse map
78  //
79 
80  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::Tracker, "Tracker"));
81  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::PixelBarrel, "PixelBarrel"));
82  _reverseMap.insert(
83  std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::PixelPhase1Barrel, "PixelBarrel"));
84  _reverseMap.insert(
85  std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::PixelPhase2Barrel, "PixelBarrel"));
86  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::PixelEndCap, "PixelEndCap"));
87  _reverseMap.insert(
88  std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::PixelPhase1EndCap, "PixelEndCap"));
89  _reverseMap.insert(
90  std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::PixelPhase2EndCap, "PixelEndCap"));
91  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::TIB, "TIB"));
92  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::TID, "TID"));
93  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::TOB, "TOB"));
94  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::TEC, "TEC"));
95  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::layer, "layer"));
96  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::OTPhase2Barrel, "TOB"));
97  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::OTPhase2Layer, "layer"));
98  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::wheel, "Wheel"));
99  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::OTPhase2EndCap, "TID"));
100  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::OTPhase2Wheel, "Wheel"));
101  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::OTPhase2Stack, "Stack"));
102  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::strng, "String"));
103  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::rod, "Rod"));
104  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::petal, "Petal"));
105  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::ring, "Ring"));
106  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::ladder, "Ladder"));
107  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::mergedDet, "GluedDet"));
108  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::DetUnit, "DetUnit"));
109  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::disk, "Disk"));
110  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::PixelPhase1Disk, "Disk"));
111  _reverseMap.insert(
112  std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::PixelPhase2FullDisk, "Disk"));
113  _reverseMap.insert(
114  std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::PixelPhase2ReducedDisk, "Disk"));
115  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::PixelPhase2TDRDisk, "Disk"));
116  _reverseMap.insert(std::pair<GeometricDet::GeometricEnumType, std::string>(GeometricDet::panel, "Panel"));
117  //
118  // done
119  //
120 }
121 
123  MapEnumType::const_iterator p = map().find(s);
124  if (p != map().end())
125  return p->second;
126  return GeometricDet::unknown;
127 }
128 
130  static std::string const u("Unknown");
131  ReverseMapEnumType::const_iterator p = reverseMap().find(t);
132  if (p != reverseMap().end())
133  return p->second;
134  return u;
135 }
GeometricDet::OTPhase2Layer
Definition: GeometricDet.h:73
CmsTrackerStringToEnum::name
std::string const & name(GeometricDet::GeometricEnumType) const
Definition: CmsTrackerStringToEnum.cc:129
GeometricDet::PixelEndCap
Definition: GeometricDet.h:52
CmsTrackerStringToEnum::type
GeometricDet::GeometricEnumType type(std::string const &) const
Definition: CmsTrackerStringToEnum.cc:122
GeometricDet::PixelPhase2ReducedDisk
Definition: GeometricDet.h:79
GeometricDet::petal
Definition: GeometricDet.h:61
GeometricDet::rod
Definition: GeometricDet.h:60
GeometricDet::TID
Definition: GeometricDet.h:54
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
GeometricDet::DetUnit
Definition: GeometricDet.h:65
GeometricDet::ladder
Definition: GeometricDet.h:63
GeometricDet::PixelBarrel
Definition: GeometricDet.h:51
GeometricDet::OTPhase2Barrel
Definition: GeometricDet.h:72
GeometricDet::ring
Definition: GeometricDet.h:62
CmsTrackerStringToEnum::Impl::_reverseMap
ReverseMapEnumType _reverseMap
Definition: CmsTrackerStringToEnum.h:26
GeometricDet::wheel
Definition: GeometricDet.h:58
GeometricDet::Tracker
Definition: GeometricDet.h:50
CmsTrackerStringToEnum::m_impl
static const Impl m_impl
Definition: CmsTrackerStringToEnum.h:29
alignCSCRings.s
s
Definition: alignCSCRings.py:92
GeometricDet::PixelPhase1Disk
Definition: GeometricDet.h:70
CmsTrackerStringToEnum::Impl::_map
MapEnumType _map
Definition: CmsTrackerStringToEnum.h:25
GeometricDet::PixelPhase1EndCap
Definition: GeometricDet.h:69
GeometricDet::mergedDet
Definition: GeometricDet.h:64
GeometricDet::PixelPhase2Barrel
Definition: GeometricDet.h:75
mps_fire.end
end
Definition: mps_fire.py:242
GeometricDet::disk
Definition: GeometricDet.h:66
CmsTrackerStringToEnum.h
GeometricDet::PixelPhase2TDRDisk
Definition: GeometricDet.h:80
GeometricDet::unknown
Definition: GeometricDet.h:49
GeometricDet::GeometricEnumType
enum GeometricDet::GDEnumType GeometricEnumType
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GeometricDet::PixelPhase2EndCap
Definition: GeometricDet.h:76
GeometricDet::PixelPhase1Barrel
Definition: GeometricDet.h:68
GeometricDet::OTPhase2EndCap
Definition: GeometricDet.h:71
GeometricDet::TIB
Definition: GeometricDet.h:53
GeometricDet::panel
Definition: GeometricDet.h:67
GeometricDet::OTPhase2Wheel
Definition: GeometricDet.h:77
GeometricDet::OTPhase2Stack
Definition: GeometricDet.h:74
GeometricDet::PixelPhase2FullDisk
Definition: GeometricDet.h:78
GeometricDet::TOB
Definition: GeometricDet.h:55
GeometricDet::layer
Definition: GeometricDet.h:57
CmsTrackerStringToEnum::map
static MapEnumType const & map()
Definition: CmsTrackerStringToEnum.h:19
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
CmsTrackerStringToEnum::reverseMap
static ReverseMapEnumType const & reverseMap()
Definition: CmsTrackerStringToEnum.h:20
GeometricDet::TEC
Definition: GeometricDet.h:56
CmsTrackerStringToEnum::Impl::Impl
Impl()
Definition: CmsTrackerStringToEnum.cc:5
GeometricDet::strng
Definition: GeometricDet.h:59
CmsTrackerStringToEnum::Impl
Definition: CmsTrackerStringToEnum.h:23