CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Attributes
AlignableObjectId Class Reference

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) More...
 
align::StructureType nameToType (const std::string &name) const
 Convert name to type. More...
 
const std::string & typeToName (align::StructureType type) const
 Convert type to name. More...
 

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.

10 {
11 
12  // Names are defined here!
13 
14  theMap.clear();
15  theReverseMap.clear();
16 
17  theMap.insert( PairEnumType( invalid , "invalid" ) );
18  theMap.insert( PairEnumType( AlignableDetUnit, "DetUnit" ) );
19  theMap.insert( PairEnumType( AlignableDet , "Det" ) );
20 
21  theMap.insert( PairEnumType(TPBModule , "TPBModule" ) );
22  theMap.insert( PairEnumType(TPBLadder , "TPBLadder" ) );
23  theMap.insert( PairEnumType(TPBLayer , "TPBLayer" ) );
24  theMap.insert( PairEnumType(TPBHalfBarrel , "TPBHalfBarrel" ) );
25  theMap.insert( PairEnumType(TPBBarrel , "TPBBarrel" ) );
26 
27  theMap.insert( PairEnumType(TPEModule , "TPEModule" ) );
28  theMap.insert( PairEnumType(TPEPanel , "TPEPanel" ) );
29  theMap.insert( PairEnumType(TPEBlade , "TPEBlade" ) );
30  theMap.insert( PairEnumType(TPEHalfDisk , "TPEHalfDisk" ) );
31  theMap.insert( PairEnumType(TPEHalfCylinder, "TPEHalfCylinder") );
32  theMap.insert( PairEnumType(TPEEndcap , "TPEEndcap" ) );
33 
34  theMap.insert( PairEnumType(TIBModule , "TIBModule" ) );
35  theMap.insert( PairEnumType(TIBString , "TIBString" ) );
36  theMap.insert( PairEnumType(TIBSurface , "TIBSurface" ) );
37  theMap.insert( PairEnumType(TIBHalfShell , "TIBHalfShell" ) );
38  theMap.insert( PairEnumType(TIBLayer , "TIBLayer" ) );
39  theMap.insert( PairEnumType(TIBHalfBarrel , "TIBHalfBarrel" ) );
40  theMap.insert( PairEnumType(TIBBarrel , "TIBBarrel" ) );
41 
42  theMap.insert( PairEnumType(TIDModule , "TIDModule" ) );
43  theMap.insert( PairEnumType(TIDSide , "TIDSide" ) );
44  theMap.insert( PairEnumType(TIDRing , "TIDRing" ) );
45  theMap.insert( PairEnumType(TIDDisk , "TIDDisk" ) );
46  theMap.insert( PairEnumType(TIDEndcap , "TIDEndcap" ) );
47 
48  theMap.insert( PairEnumType(TOBModule , "TOBModule" ) );
49  theMap.insert( PairEnumType(TOBRod , "TOBRod" ) );
50  theMap.insert( PairEnumType(TOBLayer , "TOBLayer" ) );
51  theMap.insert( PairEnumType(TOBHalfBarrel , "TOBHalfBarrel" ) );
52  theMap.insert( PairEnumType(TOBBarrel , "TOBBarrel" ) );
53 
54  theMap.insert( PairEnumType(TECModule , "TECModule" ) );
55  theMap.insert( PairEnumType(TECRing , "TECRing" ) );
56  theMap.insert( PairEnumType(TECPetal , "TECPetal" ) );
57  theMap.insert( PairEnumType(TECSide , "TECSide" ) );
58  theMap.insert( PairEnumType(TECDisk , "TECDisk" ) );
59  theMap.insert( PairEnumType(TECEndcap , "TECEndcap" ) );
60 
61  theMap.insert( PairEnumType(Pixel , "Pixel" ) );
62  theMap.insert( PairEnumType(Strip , "Strip" ) );
63  theMap.insert( PairEnumType(Tracker , "Tracker" ) );
64 
65  theMap.insert( PairEnumType( AlignableDTBarrel , "DTBarrel" ) );
66  theMap.insert( PairEnumType( AlignableDTWheel , "DTWheel" ) );
67  theMap.insert( PairEnumType( AlignableDTStation , "DTStation" ) );
68  theMap.insert( PairEnumType( AlignableDTChamber , "DTChamber" ) );
69  theMap.insert( PairEnumType( AlignableDTSuperLayer, "DTSuperLayer" ) );
70  theMap.insert( PairEnumType( AlignableDTLayer , "DTLayer" ) );
71  theMap.insert( PairEnumType( AlignableCSCEndcap , "CSCEndcap" ) );
72  theMap.insert( PairEnumType( AlignableCSCStation , "CSCStation" ) );
73  theMap.insert( PairEnumType( AlignableCSCRing , "CSCRing" ) );
74  theMap.insert( PairEnumType( AlignableCSCChamber , "CSCChamber" ) );
75  theMap.insert( PairEnumType( AlignableCSCLayer , "CSCLayer" ) );
76  theMap.insert( PairEnumType( AlignableMuon , "Muon" ) );
77 
78  theMap.insert( PairEnumType( BeamSpot, "BeamSpot" ) );
79 
80  // Create the reverse map
81  std::transform( theMap.begin(), theMap.end(),
82  std::inserter( theReverseMap, theReverseMap.begin() ),
83  reverse_pair() );
84 
85 }
A muon DT Chamber( an AlignableDet )
std::pair< align::StructureType, std::string > PairEnumType
A muon DT SuperLayer ( an AlignableDet )
ReverseMapEnumType theReverseMap
Constructor of the full muon geometry.
Definition: AlignableMuon.h:36
A muon CSC Chamber( an AlignableDet )

Member Function Documentation

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

Convert name to type.

Definition at line 90 of file AlignableObjectId.cc.

References edm::hlt::Exception, n, and mergeVDriftHistosByStation::name.

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

91 {
92  ReverseMapEnumType::const_iterator n = theReverseMap.find(name);
93 
94  if (theReverseMap.end() == n)
95  {
96  throw cms::Exception("AlignableObjectIdError")
97  << "Unknown alignableObjectId " << name;
98  }
99 
100  return n->second;
101 }
ReverseMapEnumType theReverseMap
const std::string & AlignableObjectId::typeToName ( align::StructureType  type) const

Member Data Documentation

MapEnumType AlignableObjectId::theMap
private

Definition at line 30 of file AlignableObjectId.h.

ReverseMapEnumType AlignableObjectId::theReverseMap
private

Definition at line 31 of file AlignableObjectId.h.