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  static DetTypeContainer theDetTypes;
25  // FIXME - fill it at runtime
26  return theDetTypes;
27 }
28 
29 
31  theDets.push_back(ch);
32  theChambers.push_back(ch);
33  theMap.insert(DTDetMap::value_type(ch->geographicalId(),ch));
34 }
35 
36 
38  theDets.push_back(sl);
39  theSuperLayers.push_back(sl);
40  theMap.insert(DTDetMap::value_type(sl->geographicalId(),sl));
41 }
42 
43 
45  theDetUnits.push_back(l);
46  theDets.push_back(l);
47  theLayers.push_back(l);
49 }
50 
51 
53  return theDetUnits;
54 }
55 
56 
58  return theDets;
59 }
60 
61 
63  static DetIdContainer theDetUnitIds;
64  // FIXME - fill it at runtime
65  return theDetUnitIds;
66 }
67 
68 
70  static DetIdContainer theDetIds;
71  // FIXME - fill it at runtime
72  return theDetIds;
73 }
74 
75 
77  return dynamic_cast<const GeomDetUnit*>(idToDet(id));
78 }
79 
80 
82  // Strip away wire#, if any!
83  DTLayerId lId(id.rawId());
84  DTDetMap::const_iterator i = theMap.find(lId);
85  return (i != theMap.end()) ?
86  i->second : 0 ;
87 }
88 
89 
90 const std::vector<DTChamber*>& DTGeometry::chambers() const{
91  return theChambers;
92 }
93 
94 
95 const std::vector<DTSuperLayer*>& DTGeometry::superLayers() const{
96  return theSuperLayers;
97 }
98 
99 
100 const std::vector<DTLayer*>& DTGeometry::layers() const{
101  return theLayers;
102 }
103 
104 
106  return (const DTChamber*)(idToDet(id));
107 }
108 
109 
111  return (const DTSuperLayer*)(idToDet(id));
112 }
113 
114 
116  return (const DTLayer*)(idToDet(id));
117 }
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: DTGeometry.cc:57
int i
Definition: DBlmapReader.cc:9
virtual const GeomDet * idToDet(DetId) const
Definition: DTGeometry.cc:81
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
Definition: DTGeometry.cc:52
DTGeometry()
Default constructor.
Definition: DTGeometry.cc:14
DetUnitContainer theDetUnits
Definition: DTGeometry.h:117
DTDetMap theMap
Definition: DTGeometry.h:113
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:100
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:69
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
Definition: DTGeometry.cc:115
std::vector< GeomDetUnit * > DetUnitContainer
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
Definition: DTGeometry.cc:62
const std::vector< DTSuperLayer * > & superLayers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:95
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:110
Container::value_type value_type
const std::vector< DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:90
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:105
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:76
void add(DTChamber *ch)
Add a DTChamber to Geometry.
Definition: DTGeometry.cc:30
std::vector< DetId > DetIdContainer