CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Attributes

AlignableObjectId Class Reference

Allows conversion between type and name, and vice-versa. More...

#include <AlignableObjectId.h>

List of all members.

Classes

struct  reverse_pair

Public Types

typedef std::map
< align::StructureType,
std::string > 
MapEnumType
typedef std::pair< std::string,
align::StructureType
PairEnumReverseType
typedef std::pair
< align::StructureType,
std::string > 
PairEnumType
typedef std::map< std::string,
align::StructureType
ReverseMapEnumType

Public Member Functions

 AlignableObjectId ()
 Constructor (create maps)
align::StructureType nameToType (const std::string &name) const
 Convert name to type.
const std::string & typeToName (align::StructureType type) const
 Convert type to name.

Private Attributes

MapEnumType theMap
ReverseMapEnumType theReverseMap

Detailed Description

Allows conversion between type and name, and vice-versa.

Definition at line 10 of file AlignableObjectId.h.


Member Typedef Documentation

typedef std::map<align::StructureType, std::string> AlignableObjectId::MapEnumType

Definition at line 18 of file AlignableObjectId.h.

Definition at line 21 of file AlignableObjectId.h.

typedef std::pair<align::StructureType, std::string> AlignableObjectId::PairEnumType

Definition at line 20 of file AlignableObjectId.h.

Definition at line 19 of file AlignableObjectId.h.


Constructor & Destructor Documentation

AlignableObjectId::AlignableObjectId ( )

Constructor (create maps)

Definition at line 9 of file AlignableObjectId.cc.

References align::AlignableCSCLayer, align::AlignableDTLayer, align::BeamSpot, align::invalid, align::Pixel, align::Strip, align::TECDisk, align::TECEndcap, align::TECModule, align::TECRing, align::TECSide, align::TIBBarrel, align::TIBHalfBarrel, align::TIBHalfShell, align::TIBLayer, align::TIBModule, align::TIBString, align::TIBSurface, align::TIDDisk, align::TIDEndcap, align::TIDModule, align::TIDRing, align::TIDSide, align::TOBBarrel, align::TOBHalfBarrel, align::TOBLayer, align::TOBModule, align::TOBRod, align::TPBBarrel, align::TPBHalfBarrel, align::TPBLadder, align::TPBLayer, align::TPBModule, align::TPEBlade, align::TPEEndcap, align::TPEHalfCylinder, align::TPEHalfDisk, align::TPEModule, align::TPEPanel, align::Tracker, and create_public_pileup_plots::transform.

{

  // Names are defined here!

  theMap.clear();
  theReverseMap.clear();

  theMap.insert( PairEnumType( invalid         , "invalid" ) );
  theMap.insert( PairEnumType( AlignableDetUnit, "DetUnit" ) );
  theMap.insert( PairEnumType( AlignableDet    , "Det"     ) );

  theMap.insert( PairEnumType(TPBModule      , "TPBModule"      ) );
  theMap.insert( PairEnumType(TPBLadder      , "TPBLadder"      ) );
  theMap.insert( PairEnumType(TPBLayer       , "TPBLayer"       ) );
  theMap.insert( PairEnumType(TPBHalfBarrel  , "TPBHalfBarrel"  ) );
  theMap.insert( PairEnumType(TPBBarrel      , "TPBBarrel"      ) );

  theMap.insert( PairEnumType(TPEModule      , "TPEModule"      ) );
  theMap.insert( PairEnumType(TPEPanel       , "TPEPanel"       ) );
  theMap.insert( PairEnumType(TPEBlade       , "TPEBlade"       ) );
  theMap.insert( PairEnumType(TPEHalfDisk    , "TPEHalfDisk"    ) );
  theMap.insert( PairEnumType(TPEHalfCylinder, "TPEHalfCylinder") );
  theMap.insert( PairEnumType(TPEEndcap      , "TPEEndcap"      ) );

  theMap.insert( PairEnumType(TIBModule      , "TIBModule"      ) );
  theMap.insert( PairEnumType(TIBString      , "TIBString"      ) );
  theMap.insert( PairEnumType(TIBSurface     , "TIBSurface"     ) );
  theMap.insert( PairEnumType(TIBHalfShell   , "TIBHalfShell"   ) );
  theMap.insert( PairEnumType(TIBLayer       , "TIBLayer"       ) );
  theMap.insert( PairEnumType(TIBHalfBarrel  , "TIBHalfBarrel"  ) );
  theMap.insert( PairEnumType(TIBBarrel      , "TIBBarrel"      ) );

  theMap.insert( PairEnumType(TIDModule      , "TIDModule"      ) );
  theMap.insert( PairEnumType(TIDSide        , "TIDSide"        ) );
  theMap.insert( PairEnumType(TIDRing        , "TIDRing"        ) );
  theMap.insert( PairEnumType(TIDDisk        , "TIDDisk"        ) );
  theMap.insert( PairEnumType(TIDEndcap      , "TIDEndcap"      ) );

  theMap.insert( PairEnumType(TOBModule      , "TOBModule"      ) );
  theMap.insert( PairEnumType(TOBRod         , "TOBRod"         ) );
  theMap.insert( PairEnumType(TOBLayer       , "TOBLayer"       ) );
  theMap.insert( PairEnumType(TOBHalfBarrel  , "TOBHalfBarrel"  ) );
  theMap.insert( PairEnumType(TOBBarrel      , "TOBBarrel"      ) );

  theMap.insert( PairEnumType(TECModule      , "TECModule"      ) );
  theMap.insert( PairEnumType(TECRing        , "TECRing"        ) );
  theMap.insert( PairEnumType(TECPetal       , "TECPetal"       ) );
  theMap.insert( PairEnumType(TECSide        , "TECSide"        ) );
  theMap.insert( PairEnumType(TECDisk        , "TECDisk"        ) );
  theMap.insert( PairEnumType(TECEndcap      , "TECEndcap"      ) );

  theMap.insert( PairEnumType(Pixel          , "Pixel"          ) );
  theMap.insert( PairEnumType(Strip          , "Strip"          ) );
  theMap.insert( PairEnumType(Tracker        , "Tracker"        ) );

  theMap.insert( PairEnumType( AlignableDTBarrel    ,  "DTBarrel"     ) );
  theMap.insert( PairEnumType( AlignableDTWheel     ,  "DTWheel"      ) );
  theMap.insert( PairEnumType( AlignableDTStation   ,  "DTStation"    ) );
  theMap.insert( PairEnumType( AlignableDTChamber   ,  "DTChamber"    ) );
  theMap.insert( PairEnumType( AlignableDTSuperLayer,  "DTSuperLayer" ) );
  theMap.insert( PairEnumType( AlignableDTLayer     ,  "DTLayer"      ) );
  theMap.insert( PairEnumType( AlignableCSCEndcap   ,  "CSCEndcap"    ) );
  theMap.insert( PairEnumType( AlignableCSCStation  ,  "CSCStation"   ) );
  theMap.insert( PairEnumType( AlignableCSCRing     ,  "CSCRing"      ) );
  theMap.insert( PairEnumType( AlignableCSCChamber  ,  "CSCChamber"   ) );
  theMap.insert( PairEnumType( AlignableCSCLayer    ,  "CSCLayer"     ) );
  theMap.insert( PairEnumType( AlignableMuon        ,  "Muon"         ) );

  theMap.insert( PairEnumType( BeamSpot, "BeamSpot" ) );

  // Create the reverse map
  std::transform( theMap.begin(), theMap.end(),
                  std::inserter( theReverseMap, theReverseMap.begin() ),
                  reverse_pair() );

}

Member Function Documentation

StructureType AlignableObjectId::nameToType ( const std::string &  name) const
const std::string & AlignableObjectId::typeToName ( align::StructureType  type) const

Member Data Documentation

Definition at line 30 of file AlignableObjectId.h.

Definition at line 31 of file AlignableObjectId.h.