CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ich=theChambers.begin();
18  ich!=theChambers.end(); ++ich) delete (*ich);
19 }
20 
22  // FIXME - fill it at runtime
23  return theDetTypes;
24 }
25 
26 
28  theDets.push_back(ch);
29  theChambers.push_back(ch);
30  theMap.insert(DTDetMap::value_type(ch->geographicalId(),ch));
31 }
32 
33 
35  theDets.push_back(sl);
36  theSuperLayers.push_back(sl);
37  theMap.insert(DTDetMap::value_type(sl->geographicalId(),sl));
38 }
39 
40 
42  theDetUnits.push_back(l);
43  theDets.push_back(l);
44  theLayers.push_back(l);
46 }
47 
48 
50  return theDetUnits;
51 }
52 
53 
55  return theDets;
56 }
57 
58 
60  // FIXME - fill it at runtime
61  return theDetUnitIds;
62 }
63 
64 
66  // FIXME - fill it at runtime
67  return theDetIds;
68 }
69 
70 
72  return dynamic_cast<const GeomDetUnit*>(idToDet(id));
73 }
74 
75 
77  // Strip away wire#, if any!
78  DTLayerId lId(id.rawId());
79  DTDetMap::const_iterator i = theMap.find(lId);
80  return (i != theMap.end()) ?
81  i->second : 0 ;
82 }
83 
84 
85 const std::vector<const DTChamber*>& DTGeometry::chambers() const{
86  return theChambers;
87 }
88 
89 
90 const std::vector<const DTSuperLayer*>& DTGeometry::superLayers() const{
91  return theSuperLayers;
92 }
93 
94 
95 const std::vector<const DTLayer*>& DTGeometry::layers() const{
96  return theLayers;
97 }
98 
99 
101  return (const DTChamber*)(idToDet(id));
102 }
103 
104 
106  return (const DTSuperLayer*)(idToDet(id));
107 }
108 
109 
111  return (const DTLayer*)(idToDet(id));
112 }
std::vector< GeomDetType const * > DetTypeContainer
int i
Definition: DBlmapReader.cc:9
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:85
virtual const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: DTGeometry.cc:54
virtual const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: DTGeometry.cc:65
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
std::vector< const DTSuperLayer * > theSuperLayers
Definition: DTGeometry.h:107
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
Definition: DTGeometry.cc:110
std::vector< const DTLayer * > theLayers
Definition: DTGeometry.h:108
virtual const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: DTGeometry.cc:21
DetIdContainer theDetUnitIds
Definition: DTGeometry.h:121
virtual const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:76
DetIdContainer theDetIds
Definition: DTGeometry.h:122
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
std::vector< const DTChamber * > theChambers
Definition: DTGeometry.h:102
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return a DTSuperLayer given its id.
Definition: DTGeometry.cc:105
Container::value_type value_type
Definition: DetId.h:18
virtual ~DTGeometry()
Destructor.
Definition: DTGeometry.cc:14
virtual const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: DTGeometry.cc:59
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:95
const DTChamber * chamber(DTChamberId id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:100
DetContainer theDets
Definition: DTGeometry.h:116
virtual const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: DTGeometry.cc:71
std::vector< GeomDet const * > DetContainer
std::vector< GeomDetUnit const * > DetUnitContainer
void add(DTChamber *ch)
Add a DTChamber to Geometry.
Definition: DTGeometry.cc:27
const std::vector< const DTSuperLayer * > & superLayers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:90
std::vector< DetId > DetIdContainer
virtual const DetUnitContainer & detUnits() const override
Returm a vector of all GeomDetUnit.
Definition: DTGeometry.cc:49