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 (std::vector<DTChamber*>::const_iterator 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<DTChamber*>& DTGeometry::chambers() const{
86  return theChambers;
87 }
88 
89 
90 const std::vector<DTSuperLayer*>& DTGeometry::superLayers() const{
91  return theSuperLayers;
92 }
93 
94 
95 const std::vector<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 }
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: DTGeometry.cc:54
int i
Definition: DBlmapReader.cc:9
virtual const GeomDet * idToDet(DetId) const
Definition: DTGeometry.cc:76
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
Definition: DTGeometry.cc:49
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< DTChamber * > theChambers
Definition: DTGeometry.h:102
std::vector< GeomDet * > DetContainer
const std::vector< DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:95
std::vector< DTSuperLayer * > theSuperLayers
Definition: DTGeometry.h:107
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: DTGeometry.cc:65
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
Definition: DTGeometry.cc:110
DetIdContainer theDetUnitIds
Definition: DTGeometry.h:121
std::vector< GeomDetUnit * > DetUnitContainer
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
Definition: DTGeometry.cc:59
const std::vector< DTSuperLayer * > & superLayers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:90
DetIdContainer theDetIds
Definition: DTGeometry.h:122
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:105
Container::value_type value_type
const std::vector< DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:85
std::vector< GeomDetType * > DetTypeContainer
Definition: DetId.h:18
virtual ~DTGeometry()
Destructor.
Definition: DTGeometry.cc:14
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
Definition: DTGeometry.cc:21
const DTChamber * chamber(DTChamberId id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:100
std::vector< DTLayer * > theLayers
Definition: DTGeometry.h:108
DetContainer theDets
Definition: DTGeometry.h:116
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: DTGeometry.cc:71
void add(DTChamber *ch)
Add a DTChamber to Geometry.
Definition: DTGeometry.cc:27
std::vector< DetId > DetIdContainer