CMS 3D CMS Logo

CmsMTDStringToEnum.cc
Go to the documentation of this file.
2 
4 
6  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("FastTimerRegion",GeometricTimingDet::MTD));
7 
8  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("btl:BarrelTimingLayer",GeometricTimingDet::BTL));
9  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("mtd:Layer1",GeometricTimingDet::BTLLayer));
10  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("mtd:Rod1",GeometricTimingDet::BTLTray));
11  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("mtd:BModule",GeometricTimingDet::BTLModule));
12  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("SensorPackage",GeometricTimingDet::BTLSensor));
13  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("Crystal",GeometricTimingDet::BTLCrystal));
14 
15  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("etl:EndcapTimingLayer",GeometricTimingDet::ETL));
16  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("mtd:Disc1",GeometricTimingDet::ETLDisc));
17  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("mtd:Ring",GeometricTimingDet::ETLRing));
18  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("mtd:EModule",GeometricTimingDet::ETLModule));
19  _map.insert(std::pair<std::string, GeometricTimingDet::GeometricTimingEnumType>("Sensor",GeometricTimingDet::ETLSensor));
20 
21  //
22  // build reverse map
23  //
24 
25  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::MTD,"FastTimerRegion"));
26 
27  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::BTL,"btl:BarrelTimingLayer"));
28  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::BTLLayer,"mtd:Layer"));
29  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::BTLTray,"mtd:Rod1"));
30  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::BTLModule,"Module"));
31  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::BTLSensor,"SensorPackage"));
32  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::BTLCrystal,"Crystal"));
33 
34  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::ETL,"etl:EndcapTimingLayer"));
35  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::ETLDisc,"mtd:Disc1"));
36  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::ETLRing,"mtd:Ring"));
37  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::ETLModule,"Module"));
38  _reverseMap.insert(std::pair<GeometricTimingDet::GeometricTimingEnumType, std::string>(GeometricTimingDet::ETLSensor,"Sensor"));
39 
40  //
41  // done
42  //
43 }
44 
46  MapEnumType::const_iterator p=map().find(s);
47  if (p!= map().end()) return p->second;
49 }
50 
52  static std::string const u("Unknown");
53  ReverseMapEnumType::const_iterator p=reverseMap().find(t);
54  if (p!= reverseMap().end())
55  return p->second;
56  return u;
57 }
58 
GeometricTimingDet::GeometricTimingEnumType type(std::string const &) const
static ReverseMapEnumType const & reverseMap()
static const Impl m_impl
ReverseMapEnumType _reverseMap
std::string const & name(GeometricTimingDet::GeometricTimingEnumType) const
static MapEnumType const & map()
#define end
Definition: vmac.h:39
enum GeometricTimingDet::GTDEnumType GeometricTimingEnumType