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 GeomDet*>(idToDet(id));
40 }
41 
43  mapIdToDet::const_iterator i = theMap.find(id);
44  return (i != theMap.end()) ?
45  i->second : nullptr ;
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.emplace_back(etaPartition);
81  theEtaPartitions.emplace_back(etaPartition);
82  theEtaPartitionIds.emplace_back(etaPartition->geographicalId());
83  theDets.emplace_back(etaPartition);
84  theDetIds.emplace_back(etaPartition->geographicalId());
85  theEtaPartitionTypes.emplace_back(&etaPartition->type());
86  theMap.insert(std::pair<DetId,GeomDet*>
87  (etaPartition->geographicalId(),etaPartition));
88 }
89 
90 
91 void
93  allLayers.emplace_back(layer);
94  // theLayers.emplace_back(layer); ??? what would this be fore?
95  // theLayerIds.emplace_back(layer->geographicalId()); ??? what would this be fore?
96  theDets.emplace_back(layer);
97  theDetIds.emplace_back(layer->geographicalId());
98  theEtaPartitionTypes.emplace_back(&layer->type());
99  theMap.insert(std::pair<DetId,GeomDet*>
100  (layer->geographicalId(),layer));
101 }
102 
103 
104 void
106  allChambers.emplace_back(chamber);
107  theDets.emplace_back(chamber);
108  theDetIds.emplace_back(chamber->geographicalId());
109  theMap.insert(std::pair<DetId,GeomDet*>
110  (chamber->geographicalId(),chamber));
111 }
112 
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: ME0Geometry.cc:38
std::vector< ME0Layer const * > allLayers
Definition: ME0Geometry.h:84
DetContainer theEtaPartitions
Definition: ME0Geometry.h:74
DetTypeContainer theEtaPartitionTypes
Definition: ME0Geometry.h:75
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
~ME0Geometry() override
Destructor.
Definition: ME0Geometry.cc:10
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
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: ME0Geometry.cc:28
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: ME0Geometry.cc:33
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: ME0Geometry.cc:18
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
const GeomDetType & type() const override
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: ME0Geometry.cc:23
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: ME0Geometry.cc:13
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
std::vector< ME0Chamber const * > allChambers
Definition: ME0Geometry.h:85
const GeomDet * idToDet(DetId) const override
Definition: ME0Geometry.cc:42
const std::vector< const ME0Layer * > & layers() const
Return a vector of all ME0 layers.
Definition: ME0Geometry.cc:54
std::vector< DetId > DetIdContainer
void add(ME0EtaPartition *etaPartition)
Add a ME0 etaPartition to the Geometry.
Definition: ME0Geometry.cc:79
std::vector< const GeomDet * > DetContainer
std::vector< const GeomDetType * > DetTypeContainer
ME0Geometry()
Default constructor.
Definition: ME0Geometry.cc:9