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.

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

Referenced by type().

19 { return m_impl.map_; }
static const Impl m_impl

◆ type()

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

Definition at line 21 of file CmsMTDStringToEnum.cc.

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

Referenced by DDCmsMTDConstruction::construct().

21  {
22  // remove namespace if present
23  std::string_view v = s;
24  auto first = v.find_first_of(':');
25  v.remove_prefix(std::min(first + 1, v.size()));
26  MapEnumType::const_iterator p = map().find({v.data(), v.size()});
27  if (p != map().end())
28  return p->second;
30 }
static MapEnumType const & map()

Member Data Documentation

◆ kModStrLen

constexpr size_t CmsMTDStringToEnum::kModStrLen = 7
static

◆ m_impl

const CmsMTDStringToEnum::Impl CmsMTDStringToEnum::m_impl
staticprivate

Definition at line 27 of file CmsMTDStringToEnum.h.

Referenced by map().