CMS 3D CMS Logo

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

#include <CmsTrackerStringToEnum.h>

Classes

struct  Impl
 

Public Types

typedef std::map< std::string, GeometricDet::GeometricEnumTypeMapEnumType
 
typedef std::map< GeometricDet::GeometricEnumType, std::string > ReverseMapEnumType
 

Public Member Functions

std::string const & name (GeometricDet::GeometricEnumType) const
 
GeometricDet::GeometricEnumType type (std::string const &) const
 

Static Private Member Functions

static MapEnumType const & map ()
 
static ReverseMapEnumType const & reverseMap ()
 

Static Private Attributes

static const Impl m_impl
 

Detailed Description

Builds map between Det type and an enum

Definition at line 10 of file CmsTrackerStringToEnum.h.

Member Typedef Documentation

◆ MapEnumType

Definition at line 12 of file CmsTrackerStringToEnum.h.

◆ ReverseMapEnumType

Definition at line 13 of file CmsTrackerStringToEnum.h.

Member Function Documentation

◆ map()

static MapEnumType const& CmsTrackerStringToEnum::map ( )
inlinestaticprivate

Definition at line 19 of file CmsTrackerStringToEnum.h.

19 { return m_impl._map; }

References CmsTrackerStringToEnum::Impl::_map, and m_impl.

Referenced by type().

◆ name()

std::string const & CmsTrackerStringToEnum::name ( GeometricDet::GeometricEnumType  t) const

Definition at line 129 of file CmsTrackerStringToEnum.cc.

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

References mps_fire::end, AlCaHLTBitMon_ParallelJobs::p, reverseMap(), AlCaHLTBitMon_QueryRunRegistry::string, and submitPVValidationJobs::t.

Referenced by config.CFG::__str__(), validation.Sample::digest(), and VIDSelectorBase.VIDSelectorBase::initialize().

◆ reverseMap()

static ReverseMapEnumType const& CmsTrackerStringToEnum::reverseMap ( )
inlinestaticprivate

Definition at line 20 of file CmsTrackerStringToEnum.h.

20 { return m_impl._reverseMap; }

References CmsTrackerStringToEnum::Impl::_reverseMap, and m_impl.

Referenced by name().

◆ type()

GeometricDet::GeometricEnumType CmsTrackerStringToEnum::type ( std::string const &  s) const

Definition at line 122 of file CmsTrackerStringToEnum.cc.

122  {
123  MapEnumType::const_iterator p = map().find(s);
124  if (p != map().end())
125  return p->second;
126  return GeometricDet::unknown;
127 }

References mps_fire::end, map(), AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::s, and GeometricDet::unknown.

Referenced by ListIds::analyze(), and DDDCmsTrackerContruction::construct().

Member Data Documentation

◆ m_impl

const CmsTrackerStringToEnum::Impl CmsTrackerStringToEnum::m_impl
staticprivate

Definition at line 29 of file CmsTrackerStringToEnum.h.

Referenced by map(), and reverseMap().

AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CmsTrackerStringToEnum::Impl::_reverseMap
ReverseMapEnumType _reverseMap
Definition: CmsTrackerStringToEnum.h:26
CmsTrackerStringToEnum::m_impl
static const Impl m_impl
Definition: CmsTrackerStringToEnum.h:29
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CmsTrackerStringToEnum::Impl::_map
MapEnumType _map
Definition: CmsTrackerStringToEnum.h:25
mps_fire.end
end
Definition: mps_fire.py:242
GeometricDet::unknown
Definition: GeometricDet.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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