CMS 3D CMS Logo

AlignableObjectId Class Reference

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

#include <Alignment/CommonAlignment/interface/AlignableObjectId.h>

List of all members.

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).
const 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

Classes

struct  reverse_pair


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.

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

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.

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

Definition at line 19 of file AlignableObjectId.h.


Constructor & Destructor Documentation

AlignableObjectId::AlignableObjectId (  ) 

Constructor (create maps).

Definition at line 8 of file AlignableObjectId.cc.

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

00009 {
00010 
00011   // Names are defined here!
00012 
00013   theMap.clear();
00014   theReverseMap.clear();
00015 
00016   theMap.insert( PairEnumType( AlignableDetUnit, "DetUnit" ) );
00017   theMap.insert( PairEnumType( AlignableDet    , "Det"     ) );
00018 
00019   theMap.insert( PairEnumType(TPBModule      , "TPBModule"      ) );
00020   theMap.insert( PairEnumType(TPBLadder      , "TPBLadder"      ) );
00021   theMap.insert( PairEnumType(TPBLayer       , "TPBLayer"       ) );
00022   theMap.insert( PairEnumType(TPBHalfBarrel  , "TPBHalfBarrel"  ) );
00023   theMap.insert( PairEnumType(TPBBarrel      , "TPBBarrel"      ) );
00024 
00025   theMap.insert( PairEnumType(TPEModule      , "TPEModule"      ) );
00026   theMap.insert( PairEnumType(TPEPanel       , "TPEPanel"       ) );
00027   theMap.insert( PairEnumType(TPEBlade       , "TPEBlade"       ) );
00028   theMap.insert( PairEnumType(TPEHalfDisk    , "TPEHalfDisk"    ) );
00029   theMap.insert( PairEnumType(TPEHalfCylinder, "TPEHalfCylinder") );
00030   theMap.insert( PairEnumType(TPEEndcap      , "TPEEndcap"      ) );
00031 
00032   theMap.insert( PairEnumType(TIBModule      , "TIBModule"      ) );
00033   theMap.insert( PairEnumType(TIBString      , "TIBString"      ) );
00034   theMap.insert( PairEnumType(TIBSurface     , "TIBSurface"     ) );
00035   theMap.insert( PairEnumType(TIBHalfShell   , "TIBHalfShell"   ) );
00036   theMap.insert( PairEnumType(TIBLayer       , "TIBLayer"       ) );
00037   theMap.insert( PairEnumType(TIBHalfBarrel  , "TIBHalfBarrel"  ) );
00038   theMap.insert( PairEnumType(TIBBarrel      , "TIBBarrel"      ) );
00039 
00040   theMap.insert( PairEnumType(TIDModule      , "TIDModule"      ) );
00041   theMap.insert( PairEnumType(TIDSide        , "TIDSide"        ) );
00042   theMap.insert( PairEnumType(TIDRing        , "TIDRing"        ) );
00043   theMap.insert( PairEnumType(TIDDisk        , "TIDDisk"        ) );
00044   theMap.insert( PairEnumType(TIDEndcap      , "TIDEndcap"      ) );
00045 
00046   theMap.insert( PairEnumType(TOBModule      , "TOBModule"      ) );
00047   theMap.insert( PairEnumType(TOBRod         , "TOBRod"         ) );
00048   theMap.insert( PairEnumType(TOBLayer       , "TOBLayer"       ) );
00049   theMap.insert( PairEnumType(TOBHalfBarrel  , "TOBHalfBarrel"  ) );
00050   theMap.insert( PairEnumType(TOBBarrel      , "TOBBarrel"      ) );
00051 
00052   theMap.insert( PairEnumType(TECModule      , "TECModule"      ) );
00053   theMap.insert( PairEnumType(TECRing        , "TECRing"        ) );
00054   theMap.insert( PairEnumType(TECPetal       , "TECPetal"       ) );
00055   theMap.insert( PairEnumType(TECSide        , "TECSide"        ) );
00056   theMap.insert( PairEnumType(TECDisk        , "TECDisk"        ) );
00057   theMap.insert( PairEnumType(TECEndcap      , "TECEndcap"      ) );
00058 
00059   theMap.insert( PairEnumType(Pixel          , "Pixel"          ) );
00060   theMap.insert( PairEnumType(Strip          , "Strip"          ) );
00061   theMap.insert( PairEnumType(Tracker        , "Tracker"        ) );
00062 
00063   theMap.insert( PairEnumType( AlignableDTBarrel    ,  "DTBarrel"     ) );
00064   theMap.insert( PairEnumType( AlignableDTWheel     ,  "DTWheel"      ) );
00065   theMap.insert( PairEnumType( AlignableDTStation   ,  "DTStation"    ) );
00066   theMap.insert( PairEnumType( AlignableDTChamber   ,  "DTChamber"    ) );
00067   theMap.insert( PairEnumType( AlignableDTSuperLayer,  "DTSuperLayer" ) );
00068   theMap.insert( PairEnumType( AlignableDTLayer     ,  "DTLayer"      ) );
00069   theMap.insert( PairEnumType( AlignableCSCEndcap   ,  "CSCEndcap"    ) );
00070   theMap.insert( PairEnumType( AlignableCSCStation  ,  "CSCStation"   ) );
00071   theMap.insert( PairEnumType( AlignableCSCRing     ,  "CSCRing"      ) );
00072   theMap.insert( PairEnumType( AlignableCSCChamber  ,  "CSCChamber"   ) );
00073   theMap.insert( PairEnumType( AlignableCSCLayer    ,  "CSCLayer"     ) );
00074   theMap.insert( PairEnumType( AlignableMuon        ,  "Muon"         ) );
00075 
00076   // Create the reverse map
00077   std::transform( theMap.begin(), theMap.end(),
00078                   std::inserter( theReverseMap, theReverseMap.begin() ),
00079                   reverse_pair() );
00080 
00081 }


Member Function Documentation

const StructureType AlignableObjectId::nameToType ( const std::string &  name  )  const

Convert name to type.

Definition at line 86 of file AlignableObjectId.cc.

References Exception, n, and theReverseMap.

Referenced by AlignmentMonitorSurvey::AlignmentMonitorSurvey(), AlignableTracker::buildBarrel(), HIPAlignmentAlgorithm::HIPAlignmentAlgorithm(), SurveyAlignmentAlgorithm::initialize(), MisalignmentScenarioBuilder::propagateParameters_(), SurveyInputTextReader::readFile(), and TrackerGeometryCompare::setCommonTrackerSystem().

00087 {
00088   ReverseMapEnumType::const_iterator n = theReverseMap.find(name);
00089 
00090   if (theReverseMap.end() == n)
00091   {
00092     throw cms::Exception("AlignableObjectIdError")
00093       << "Unknown alignableObjectId " << name;
00094   }
00095 
00096   return n->second;
00097 }

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

Convert type to name.

Definition at line 101 of file AlignableObjectId.cc.

References Exception, t, and theMap.

Referenced by AlignmentMonitorGeneric::book(), TrackerOfflineValidation::bookDirHists(), TrackerOfflineValidation::bookSummaryHists(), AlignableBuilder::build(), TrackerOfflineValidation::collateSummaryHists(), MisalignmentScenarioBuilder::decodeMovements_(), PedeSteerer::hierarchyConstraint(), PedeSteerer::presigmasFile(), MuonGeometryIntoNtuples::recursiveWalk(), and MuonAlignmentOutputXML::writeComponents().

00102 {
00103   MapEnumType::const_iterator t = theMap.find(type);
00104 
00105   if (theMap.end() == t)
00106   {
00107     throw cms::Exception("AlignableObjectIdError")
00108       << "Unknown alignableObjectId " << type;
00109   }
00110 
00111   return t->second;
00112 }


Member Data Documentation

MapEnumType AlignableObjectId::theMap [private]

Definition at line 30 of file AlignableObjectId.h.

Referenced by AlignableObjectId(), and typeToName().

ReverseMapEnumType AlignableObjectId::theReverseMap [private]

Definition at line 31 of file AlignableObjectId.h.

Referenced by AlignableObjectId(), and nameToType().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:14:23 2009 for CMSSW by  doxygen 1.5.4