CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Static Private Member Functions | Static Private Attributes
CmsMTDStringToEnum Class Reference

#include <CmsMTDStringToEnum.h>

Classes

struct  Impl
 

Public Types

using MapEnumType = std::map< std::string, GeometricTimingDet::GeometricTimingEnumType >
 

Public Member Functions

GeometricTimingDet::GeometricTimingEnumType type (std::string const &) const
 

Static Public Attributes

static constexpr size_t kModStrLen = 7
 

Static Private Member Functions

static MapEnumType const & map ()
 

Static Private Attributes

static const Impl m_impl
 

Detailed Description

Builds map between Det type and an enum

Definition at line 10 of file CmsMTDStringToEnum.h.

Member Typedef Documentation

◆ MapEnumType

Definition at line 14 of file CmsMTDStringToEnum.h.

Member Function Documentation

◆ map()

static MapEnumType const& CmsMTDStringToEnum::map ( )
inlinestaticprivate

Definition at line 19 of file CmsMTDStringToEnum.h.

19 { return m_impl.map_; }

References m_impl, and CmsMTDStringToEnum::Impl::map_.

Referenced by type().

◆ type()

GeometricTimingDet::GeometricTimingEnumType CmsMTDStringToEnum::type ( std::string const &  s) const

Definition at line 18 of file CmsMTDStringToEnum.cc.

18  {
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 }

References first, map(), min(), AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::s, susybsm::HSCParticleType::unknown, and findQualityFiles::v.

Referenced by DDCmsMTDConstruction::construct().

Member Data Documentation

◆ kModStrLen

constexpr size_t CmsMTDStringToEnum::kModStrLen = 7
staticconstexpr

◆ m_impl

const CmsMTDStringToEnum::Impl CmsMTDStringToEnum::m_impl
staticprivate

Definition at line 27 of file CmsMTDStringToEnum.h.

Referenced by map().

min
T min(T a, T b)
Definition: MathUtil.h:58
findQualityFiles.v
v
Definition: findQualityFiles.py:179
alignCSCRings.s
s
Definition: alignCSCRings.py:92
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::map
static MapEnumType const & map()
Definition: CmsMTDStringToEnum.h:19
CmsMTDStringToEnum::Impl::map_
MapEnumType map_
Definition: CmsMTDStringToEnum.h:24
susybsm::HSCParticleType::unknown
Definition: HSCParticle.h:20