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