CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTGeometry.h
Go to the documentation of this file.
1 #ifndef DTGeometry_DTGeometry_h
2 #define DTGeometry_DTGeometry_h
3 
19 #include <vector>
20 #include <map>
21 
22 class GeomDetType;
23 class GeomDetUnit;
24 
25 class DTGeometry : public TrackingGeometry {
26 
27  typedef std::map<DetId, GeomDet*> DTDetMap;
28 
29  public:
31  DTGeometry();
32 
34  virtual ~DTGeometry();
35 
36  //---- Base class' interface
37 
38  // Return a vector of all det types
39  virtual const DetTypeContainer& detTypes() const;
40 
41  // Returm a vector of all GeomDetUnit
42  virtual const DetUnitContainer& detUnits() const;
43 
44  // Returm a vector of all GeomDet (including all GeomDetUnits)
45  virtual const DetContainer& dets() const;
46 
47  // Returm a vector of all GeomDetUnit DetIds
48  virtual const DetIdContainer& detUnitIds() const;
49 
50  // Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
51  virtual const DetIdContainer& detIds() const;
52 
53  // Return the pointer to the GeomDetUnit corresponding to a given DetId
54  virtual const GeomDetUnit* idToDetUnit(DetId) const;
55 
56  // Return the pointer to the GeomDet corresponding to a given DetId
57  virtual const GeomDet* idToDet(DetId) const;
58 
59 
60  //---- Extension of the interface
61 
63  const std::vector<DTChamber*>& chambers() const;
64 
66  const std::vector<DTSuperLayer*>& superLayers() const;
67 
69  const std::vector<DTLayer*>& layers() const;
70 
71 
73  const DTChamber* chamber(DTChamberId id) const;
74 
76  const DTSuperLayer* superLayer(DTSuperLayerId id) const;
77 
79  const DTLayer* layer(DTLayerId id) const;
80 
81 
82  private:
83 
86 
87  friend class GeometryAligner;
88 
89 
91  void add(DTChamber* ch);
92 
94  void add(DTSuperLayer* sl);
95 
97  void add(DTLayer* l);
98 
99 
100  // The chambers are owned by the geometry (and in turn own superlayers
101  // and layers)
102  std::vector<DTChamber*> theChambers;
103 
104  // All following pointers are redundant; they are used only for an
105  // efficient implementation of the interface, and are NOT owned.
106 
107  std::vector<DTSuperLayer*> theSuperLayers;
108  std::vector<DTLayer*> theLayers;
109 
110  // Map for efficient lookup by DetId
112 
113  // These are used rarely; they could be computed at runtime
114  // to save memory.
116  DetContainer theDets; // all chambers, SL, layers
117 
118  // Replace local static with mutable members
119  // to allow lazy evaluation if (ever) needed.
123 };
124 
125 #endif
std::map< DetId, GeomDet * > DTDetMap
Definition: DTGeometry.h:27
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: DTGeometry.cc:54
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
Class to update a given geometry with a set of alignments.
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
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return a DTSuperLayer given its id.
Definition: DTGeometry.cc:105
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