Allows conversion between type and name, and vice-versa. More...
#include <AlignableObjectId.h>
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) | |
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 |
Allows conversion between type and name, and vice-versa.
Definition at line 10 of file AlignableObjectId.h.
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.
AlignableObjectId::AlignableObjectId | ( | ) |
Constructor (create maps)
Definition at line 9 of file AlignableObjectId.cc.
References align::AlignableCSCLayer, align::AlignableDTLayer, align::invalid, align::Pixel, align::Strip, align::TECDisk, align::TECEndcap, align::TECModule, align::TECRing, align::TECSide, 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.
{ // 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" ) ); // Create the reverse map std::transform( theMap.begin(), theMap.end(), std::inserter( theReverseMap, theReverseMap.begin() ), reverse_pair() ); }
const StructureType AlignableObjectId::nameToType | ( | const std::string & | name | ) | const |
Convert name to type.
Definition at line 88 of file AlignableObjectId.cc.
References Exception, n, and AlCaRecoCosmics_cfg::name.
Referenced by AlignmentMonitorSurvey::AlignmentMonitorSurvey(), AlignableTracker::buildBarrel(), HIPAlignmentAlgorithm::HIPAlignmentAlgorithm(), SurveyAlignmentAlgorithm::initialize(), MisalignmentScenarioBuilder::propagateParameters_(), SurveyInputTextReader::readFile(), and TrackerGeometryCompare::setCommonTrackerSystem().
{ ReverseMapEnumType::const_iterator n = theReverseMap.find(name); if (theReverseMap.end() == n) { throw cms::Exception("AlignableObjectIdError") << "Unknown alignableObjectId " << name; } return n->second; }
const std::string & AlignableObjectId::typeToName | ( | align::StructureType | type | ) | const |
Convert type to name.
Definition at line 103 of file AlignableObjectId.cc.
References Exception, and matplotRender::t.
Referenced by AlignmentMonitorGeneric::book(), TrackerOfflineValidation::bookDirHists(), TrackerOfflineValidation::bookSummaryHists(), AlignableBuilder::build(), TrackerOfflineValidation::collateSummaryHists(), MisalignmentScenarioBuilder::decodeMovements_(), Counters::get(), PedeSteerer::hierarchyConstraint(), KalmanAlignmentUserVariables::KalmanAlignmentUserVariables(), PedeSteerer::presigmas(), PedeSteerer::presigmasFile(), and MuonAlignmentOutputXML::writeComponents().
MapEnumType AlignableObjectId::theMap [private] |
Definition at line 30 of file AlignableObjectId.h.
Definition at line 31 of file AlignableObjectId.h.