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 
57 void ME0Geometry::add(ME0Layer* layer) {
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 }
ME0Geometry::etaPartitions
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:33
ME0Geometry::~ME0Geometry
~ME0Geometry() override
Destructor.
Definition: ME0Geometry.cc:10
mps_fire.i
i
Definition: mps_fire.py:428
ME0Geometry::theEtaPartitions
DetContainer theEtaPartitions
Definition: ME0Geometry.h:71
GeomDet
Definition: GeomDet.h:27
ME0Geometry::theDetIds
DetIdContainer theDetIds
Definition: ME0Geometry.h:74
ME0EtaPartition::type
const GeomDetType & type() const override
Definition: ME0EtaPartition.cc:22
ME0Geometry::theDets
DetContainer theDets
Definition: ME0Geometry.h:75
ME0Geometry::ME0Geometry
ME0Geometry()
Default constructor.
Definition: ME0Geometry.cc:9
GeomDet::type
virtual const GeomDetType & type() const
Definition: GeomDet.cc:69
ME0Geometry::theEtaPartitionTypes
DetTypeContainer theEtaPartitionTypes
Definition: ME0Geometry.h:72
ME0Geometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: ME0Geometry.cc:24
ME0Geometry::detUnitIds
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: ME0Geometry.cc:18
ME0Geometry::idToDetUnit
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: ME0Geometry.cc:22
ME0Geometry::detIds
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: ME0Geometry.cc:20
ME0Geometry::chambers
const std::vector< const ME0Chamber * > & chambers() const
Return a vector of all ME0 chambers.
Definition: ME0Geometry.cc:29
ME0Geometry::allEtaPartitions
std::vector< ME0EtaPartition const * > allEtaPartitions
Definition: ME0Geometry.h:80
ME0Geometry::chamber
const ME0Chamber * chamber(ME0DetId id) const
Return a chamber given its id.
Definition: ME0Geometry.cc:43
DetId
Definition: DetId.h:17
ME0Geometry::theMap
mapIdToDet theMap
Definition: ME0Geometry.h:78
TrackingGeometry::DetTypeContainer
std::vector< const GeomDetType * > DetTypeContainer
Definition: TrackingGeometry.h:28
ME0Geometry::theEtaPartitionIds
DetIdContainer theEtaPartitionIds
Definition: ME0Geometry.h:73
TrackingGeometry::DetIdContainer
std::vector< DetId > DetIdContainer
Definition: TrackingGeometry.h:30
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
ME0Layer
Definition: ME0Layer.h:9
TrackingGeometry::DetContainer
std::vector< const GeomDet * > DetContainer
Definition: TrackingGeometry.h:29
ME0Chamber
Definition: ME0Chamber.h:10
ME0Geometry::allChambers
std::vector< ME0Chamber const * > allChambers
Definition: ME0Geometry.h:82
ME0DetId
Definition: ME0DetId.h:16
ME0Geometry::detTypes
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: ME0Geometry.cc:12
ME0Geometry::add
void add(ME0EtaPartition *etaPartition)
Add a ME0 etaPartition to the Geometry.
Definition: ME0Geometry.cc:47
ME0Geometry.h
GeomDet.h
ME0Geometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: ME0Geometry.cc:16
ME0Geometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: ME0Geometry.cc:14
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
ME0Geometry::etaPartition
const ME0EtaPartition * etaPartition(ME0DetId id) const
Return a etaPartition given its id.
Definition: ME0Geometry.cc:35
ME0Geometry::allLayers
std::vector< ME0Layer const * > allLayers
Definition: ME0Geometry.h:81
ME0EtaPartition
Definition: ME0EtaPartition.h:12
ME0Geometry::layers
const std::vector< const ME0Layer * > & layers() const
Return a vector of all ME0 layers.
Definition: ME0Geometry.cc:31
ME0Geometry::layer
const ME0Layer * layer(ME0DetId id) const
Return a layer given its id.
Definition: ME0Geometry.cc:39