CMS 3D CMS Logo

CmsMTDStringToEnum.cc
Go to the documentation of this file.
2 
4 
6  map_.emplace("FastTimerRegion", GeometricTimingDet::MTD);
7  map_.emplace("BarrelTimingLayer", GeometricTimingDet::BTL);
8  map_.emplace("Layer1", GeometricTimingDet::BTLLayer);
9  map_.emplace("Layer1Timing", GeometricTimingDet::BTLLayer);
10  map_.emplace("BModule", GeometricTimingDet::BTLModule);
11  map_.emplace("EndcapTimingLayer", GeometricTimingDet::ETL);
12  map_.emplace("Disc1", GeometricTimingDet::ETLDisc);
13  map_.emplace("Disc1Timing", GeometricTimingDet::ETLDisc);
14  map_.emplace("Disc2Timing", GeometricTimingDet::ETLDisc);
15  map_.emplace("EModule", GeometricTimingDet::ETLModule);
16 }
17 
19  // remove namespace if present
20  std::string_view v = s;
21  auto first = v.find_first_of(':');
22  v.remove_prefix(std::min(first + 1, v.size()));
23  MapEnumType::const_iterator p = map().find({v.data(), v.size()});
24  if (p != map().end())
25  return p->second;
27 }
min
T min(T a, T b)
Definition: MathUtil.h:58
GeometricTimingDet::GeometricTimingEnumType
enum GTDEnumType { unknown=100, MTD=0, BTL=1, BTLLayer=2, BTLTray=3, BTLModule=4, BTLSensor=5, BTLCrystal=6, ETL=7, ETLDisc=8, ETLRing=9, ETLModule=10, ETLSensor=11 } GeometricTimingEnumType
Definition: GeometricTimingDet.h:63
findQualityFiles.v
v
Definition: findQualityFiles.py:179
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CmsMTDStringToEnum::Impl
Definition: CmsMTDStringToEnum.h:22
CmsMTDStringToEnum::m_impl
static const Impl m_impl
Definition: CmsMTDStringToEnum.h:27
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CmsMTDStringToEnum::type
GeometricTimingDet::GeometricTimingEnumType type(std::string const &) const
Definition: CmsMTDStringToEnum.cc:18
CmsMTDStringToEnum::map
static MapEnumType const & map()
Definition: CmsMTDStringToEnum.h:19
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CmsMTDStringToEnum::Impl::map_
MapEnumType map_
Definition: CmsMTDStringToEnum.h:24
CmsMTDStringToEnum.h
CmsMTDStringToEnum::Impl::Impl
Impl()
Definition: CmsMTDStringToEnum.cc:5
susybsm::HSCParticleType::unknown
Definition: HSCParticle.h:20