CMS 3D CMS Logo

ME0Geometry.cc
Go to the documentation of this file.
1 
8 
11 
12 
14  return theEtaPartitionTypes;
15 }
16 
17 
19  return theEtaPartitions;
20 }
21 
22 
24  return theDets;
25 }
26 
27 
29  return theEtaPartitionIds;
30 }
31 
32 
34  return theDetIds;
35 }
36 
37 
39  return dynamic_cast<const GeomDetUnit*>(idToDet(id));
40 }
41 
43  mapIdToDet::const_iterator i = theMap.find(id);
44  return (i != theMap.end()) ?
45  i->second : 0 ;
46 }
47 
48 
49 const std::vector<ME0Chamber const*>& ME0Geometry::chambers() const {
50  return allChambers;
51 }
52 
53 
54 const std::vector<ME0Layer const*>& ME0Geometry::layers() const {
55  return allLayers;
56 }
57 
58 
59 const std::vector<ME0EtaPartition const*>& ME0Geometry::etaPartitions() const{
60  return allEtaPartitions;
61 }
62 
63 
65  return dynamic_cast<const ME0EtaPartition*>(idToDetUnit(id));
66 }
67 
68 
70  return dynamic_cast<const ME0Layer*>(idToDetUnit(id.layerId()));
71 }
72 
74  return dynamic_cast<const ME0Chamber*>(idToDetUnit(id.chamberId()));
75 }
76 
77 
78 void
80  allEtaPartitions.push_back(etaPartition);
81  theEtaPartitions.push_back(etaPartition);
82  theEtaPartitionIds.push_back(etaPartition->geographicalId());
83  theDets.push_back(etaPartition);
84  theDetIds.push_back(etaPartition->geographicalId());
85  theEtaPartitionTypes.push_back(&etaPartition->type());
86  theMap.insert(std::pair<DetId,GeomDetUnit*>
87  (etaPartition->geographicalId(),etaPartition));
88 }
89 
90 
91 void
93  allLayers.push_back(layer);
94  // theLayers.push_back(layer); ??? what would this be fore?
95  // theLayerIds.push_back(layer->geographicalId()); ??? what would this be fore?
96  theDets.push_back(layer);
97  theDetIds.push_back(layer->geographicalId());
98  theEtaPartitionTypes.push_back(&layer->type());
99  theMap.insert(std::pair<DetId,GeomDetUnit*>
100  (layer->geographicalId(),layer));
101 }
102 
103 
104 void
106  allChambers.push_back(chamber);
107  theDets.push_back(chamber);
108  theDetIds.push_back(chamber->geographicalId());
109  theMap.insert(std::pair<DetId,GeomDet*>
110  (chamber->geographicalId(),chamber));
111 }
112 
std::vector< ME0Layer const * > allLayers
Definition: ME0Geometry.h:84
std::vector< GeomDetType const * > DetTypeContainer
DetTypeContainer theEtaPartitionTypes
Definition: ME0Geometry.h:75
int i
Definition: DBlmapReader.cc:9
const ME0Layer * layer(ME0DetId id) const
Return a layer given its id.
Definition: ME0Geometry.cc:69
virtual const GeomDetType & type() const
Definition: GeomDet.cc:85
virtual const GeomDet * idToDet(DetId) const
Definition: ME0Geometry.cc:42
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
Definition: ME0Geometry.cc:18
mapIdToDet theMap
Definition: ME0Geometry.h:81
DetIdContainer theDetIds
Definition: ME0Geometry.h:77
DetContainer theDets
Definition: ME0Geometry.h:78
std::vector< ME0EtaPartition const * > allEtaPartitions
Definition: ME0Geometry.h:83
const ME0EtaPartition * etaPartition(ME0DetId id) const
Return a etaPartition given its id.
Definition: ME0Geometry.cc:64
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: ME0Geometry.cc:23
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
Definition: ME0Geometry.cc:13
virtual ~ME0Geometry()
Destructor.
Definition: ME0Geometry.cc:10
const ME0Chamber * chamber(ME0DetId id) const
Return a chamber given its id.
Definition: ME0Geometry.cc:73
const std::vector< const ME0Chamber * > & chambers() const
Return a vector of all ME0 chambers.
Definition: ME0Geometry.cc:49
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
DetUnitContainer theEtaPartitions
Definition: ME0Geometry.h:74
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:59
Definition: DetId.h:18
DetIdContainer theEtaPartitionIds
Definition: ME0Geometry.h:76
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: ME0Geometry.cc:38
std::vector< ME0Chamber const * > allChambers
Definition: ME0Geometry.h:85
const std::vector< const ME0Layer * > & layers() const
Return a vector of all ME0 layers.
Definition: ME0Geometry.cc:54
void add(ME0EtaPartition *etaPartition)
Add a ME0 etaPartition to the Geometry.
Definition: ME0Geometry.cc:79
const GeomDetType & type() const
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
Definition: ME0Geometry.cc:28
std::vector< GeomDet const * > DetContainer
std::vector< GeomDetUnit const * > DetUnitContainer
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: ME0Geometry.cc:33
ME0Geometry()
Default constructor.
Definition: ME0Geometry.cc:9
std::vector< DetId > DetIdContainer