CMS 3D CMS Logo

ME0Geometry.cc
Go to the documentation of this file.
1 
8 
11 
13 
15 
17 
19 
21 
22 const GeomDet* ME0Geometry::idToDetUnit(DetId id) const { return dynamic_cast<const GeomDet*>(idToDet(id)); }
23 
25  mapIdToDet::const_iterator i = theMap.find(id);
26  return (i != theMap.end()) ? i->second : nullptr;
27 }
28 
29 const std::vector<ME0Chamber const*>& ME0Geometry::chambers() const { return allChambers; }
30 
31 const std::vector<ME0Layer const*>& ME0Geometry::layers() const { return allLayers; }
32 
33 const std::vector<ME0EtaPartition const*>& ME0Geometry::etaPartitions() const { return allEtaPartitions; }
34 
36  return dynamic_cast<const ME0EtaPartition*>(idToDetUnit(id));
37 }
38 
40  return dynamic_cast<const ME0Layer*>(idToDetUnit(id.layerId()));
41 }
42 
44  return dynamic_cast<const ME0Chamber*>(idToDetUnit(id.chamberId()));
45 }
46 
47 void ME0Geometry::add(ME0EtaPartition* etaPartition) {
48  allEtaPartitions.emplace_back(etaPartition);
49  theEtaPartitions.emplace_back(etaPartition);
51  theDets.emplace_back(etaPartition);
52  theDetIds.emplace_back(etaPartition->geographicalId());
53  theEtaPartitionTypes.emplace_back(&etaPartition->type());
54  theMap.insert(std::pair<DetId, GeomDet*>(etaPartition->geographicalId(), etaPartition));
55 }
56 
58  allLayers.emplace_back(layer);
59  // theLayers.emplace_back(layer); ??? what would this be fore?
60  // theLayerIds.emplace_back(layer->geographicalId()); ??? what would this be fore?
61  theDets.emplace_back(layer);
62  theDetIds.emplace_back(layer->geographicalId());
63  theEtaPartitionTypes.emplace_back(&layer->type());
64  theMap.insert(std::pair<DetId, GeomDet*>(layer->geographicalId(), layer));
65 }
66 
68  allChambers.emplace_back(chamber);
69  theDets.emplace_back(chamber);
70  theDetIds.emplace_back(chamber->geographicalId());
71  theMap.insert(std::pair<DetId, GeomDet*>(chamber->geographicalId(), chamber));
72 }
std::vector< ME0Layer const * > allLayers
Definition: ME0Geometry.h:81
DetContainer theEtaPartitions
Definition: ME0Geometry.h:71
DetTypeContainer theEtaPartitionTypes
Definition: ME0Geometry.h:72
~ME0Geometry() override
Destructor.
Definition: ME0Geometry.cc:10
mapIdToDet theMap
Definition: ME0Geometry.h:78
DetIdContainer theDetIds
Definition: ME0Geometry.h:74
DetContainer theDets
Definition: ME0Geometry.h:75
std::vector< ME0EtaPartition const * > allEtaPartitions
Definition: ME0Geometry.h:80
virtual const GeomDetType & type() const
Definition: GeomDet.cc:69
const GeomDet * idToDet(DetId) const override
Definition: ME0Geometry.cc:24
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: ME0Geometry.cc:18
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: ME0Geometry.cc:22
const GeomDetType & type() const override
std::vector< const GeomDet * > DetContainer
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: ME0Geometry.cc:20
const std::vector< const ME0Chamber * > & chambers() const
Return a vector of all ME0 chambers.
Definition: ME0Geometry.cc:29
const ME0Chamber * chamber(ME0DetId id) const
Return a chamber given its id.
Definition: ME0Geometry.cc:43
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
Definition: DetId.h:17
DetIdContainer theEtaPartitionIds
Definition: ME0Geometry.h:73
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: ME0Geometry.cc:16
std::vector< ME0Chamber const * > allChambers
Definition: ME0Geometry.h:82
const ME0EtaPartition * etaPartition(ME0DetId id) const
Return a etaPartition given its id.
Definition: ME0Geometry.cc:35
std::vector< DetId > DetIdContainer
void add(ME0EtaPartition *etaPartition)
Add a ME0 etaPartition to the Geometry.
Definition: ME0Geometry.cc:47
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: ME0Geometry.cc:12
std::vector< const GeomDetType * > DetTypeContainer
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: ME0Geometry.cc:14
const std::vector< const ME0Layer * > & layers() const
Return a vector of all ME0 layers.
Definition: ME0Geometry.cc:31
const ME0Layer * layer(ME0DetId id) const
Return a layer given its id.
Definition: ME0Geometry.cc:39
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:33
ME0Geometry()
Default constructor.
Definition: ME0Geometry.cc:9