CMS 3D CMS Logo

DTGeometry.cc
Go to the documentation of this file.
1 
8 
9 #include <algorithm>
10 #include <iostream>
11 
13 
15  // delete all the chambers (which will delete the SL which will delete the
16  // layers)
17  for (auto & theChamber : theChambers) delete theChamber;
18 }
19 
21  // FIXME - fill it at runtime
22  return theDetTypes;
23 }
24 
25 
27  theDets.emplace_back(ch);
28  theChambers.emplace_back(ch);
29  theMap.insert(DTDetMap::value_type(ch->geographicalId(),ch));
30 }
31 
32 
34  theDets.emplace_back(sl);
35  theSuperLayers.emplace_back(sl);
36  theMap.insert(DTDetMap::value_type(sl->geographicalId(),sl));
37 }
38 
39 
41  theDetUnits.emplace_back(l);
42  theDets.emplace_back(l);
43  theLayers.emplace_back(l);
45 }
46 
47 
49  return theDetUnits;
50 }
51 
52 
54  return theDets;
55 }
56 
57 
59  // FIXME - fill it at runtime
60  return theDetUnitIds;
61 }
62 
63 
65  // FIXME - fill it at runtime
66  return theDetIds;
67 }
68 
69 
71  return dynamic_cast<const GeomDetUnit*>(idToDet(id));
72 }
73 
74 
76  // Strip away wire#, if any!
77  DTLayerId lId(id.rawId());
78  DTDetMap::const_iterator i = theMap.find(lId);
79  return (i != theMap.end()) ?
80  i->second : nullptr ;
81 }
82 
83 
84 const std::vector<const DTChamber*>& DTGeometry::chambers() const{
85  return theChambers;
86 }
87 
88 
89 const std::vector<const DTSuperLayer*>& DTGeometry::superLayers() const{
90  return theSuperLayers;
91 }
92 
93 
94 const std::vector<const DTLayer*>& DTGeometry::layers() const{
95  return theLayers;
96 }
97 
98 
99 const DTChamber* DTGeometry::chamber(const DTChamberId& id) const {
100  return (const DTChamber*)(idToDet(id));
101 }
102 
103 
105  return (const DTSuperLayer*)(idToDet(id));
106 }
107 
108 
109 const DTLayer* DTGeometry::layer(const DTLayerId& id) const {
110  return (const DTLayer*)(idToDet(id));
111 }
std::vector< GeomDetType const * > DetTypeContainer
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
~DTGeometry() override
Destructor.
Definition: DTGeometry.cc:14
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:99
DTGeometry()
Default constructor.
Definition: DTGeometry.cc:12
DetUnitContainer theDetUnits
Definition: DTGeometry.h:115
DTDetMap theMap
Definition: DTGeometry.h:111
DetTypeContainer theDetTypes
Definition: DTGeometry.h:120
const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: DTGeometry.cc:70
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: DTGeometry.cc:64
std::vector< const DTSuperLayer * > theSuperLayers
Definition: DTGeometry.h:107
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: DTGeometry.cc:58
std::vector< const DTLayer * > theLayers
Definition: DTGeometry.h:108
DetIdContainer theDetUnitIds
Definition: DTGeometry.h:121
DetIdContainer theDetIds
Definition: DTGeometry.h:122
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
std::vector< const DTChamber * > theChambers
Definition: DTGeometry.h:102
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: DTGeometry.cc:53
Definition: DetId.h:18
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:94
DetContainer theDets
Definition: DTGeometry.h:116
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:75
const DetUnitContainer & detUnits() const override
Returm a vector of all GeomDetUnit.
Definition: DTGeometry.cc:48
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:109
std::vector< GeomDet const * > DetContainer
std::vector< GeomDetUnit const * > DetUnitContainer
void add(DTChamber *ch)
Add a DTChamber to Geometry.
Definition: DTGeometry.cc:26
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: DTGeometry.cc:20
const std::vector< const DTSuperLayer * > & superLayers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:89
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return a DTSuperLayer given its id.
Definition: DTGeometry.cc:104
std::vector< DetId > DetIdContainer