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 
21 #include <vector>
22 #include <map>
23 
24 class GeomDetType;
25 class GeomDetUnit;
26 
27 class DTGeometry : public TrackingGeometry {
28 
29  typedef std::map<DetId, GeomDet*> DTDetMap;
30 
31  public:
33  DTGeometry();
34 
36  virtual ~DTGeometry();
37 
38  //---- Base class' interface
39 
40  // Return a vector of all det types
41  virtual const DetTypeContainer& detTypes() const;
42 
43  // Returm a vector of all GeomDetUnit
44  virtual const DetUnitContainer& detUnits() const;
45 
46  // Returm a vector of all GeomDet (including all GeomDetUnits)
47  virtual const DetContainer& dets() const;
48 
49  // Returm a vector of all GeomDetUnit DetIds
50  virtual const DetIdContainer& detUnitIds() const;
51 
52  // Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
53  virtual const DetIdContainer& detIds() const;
54 
55  // Return the pointer to the GeomDetUnit corresponding to a given DetId
56  virtual const GeomDetUnit* idToDetUnit(DetId) const;
57 
58  // Return the pointer to the GeomDet corresponding to a given DetId
59  virtual const GeomDet* idToDet(DetId) const;
60 
61 
62  //---- Extension of the interface
63 
65  const std::vector<DTChamber*>& chambers() const;
66 
68  const std::vector<DTSuperLayer*>& superLayers() const;
69 
71  const std::vector<DTLayer*>& layers() const;
72 
73 
75  const DTChamber* chamber(DTChamberId id) const;
76 
78  const DTSuperLayer* superLayer(DTSuperLayerId id) const;
79 
81  const DTLayer* layer(DTLayerId id) const;
82 
83 
84  private:
85 
88 
89  friend class GeometryAligner;
90 
91 
93  void add(DTChamber* ch);
94 
96  void add(DTSuperLayer* sl);
97 
99  void add(DTLayer* l);
100 
101 
102  // The chambers are owned by the geometry (and in turn own superlayers
103  // and layers)
104  std::vector<DTChamber*> theChambers;
105 
106  // All following pointers are redundant; they are used only for an
107  // efficient implementation of the interface, and are NOT owned.
108 
109  std::vector<DTSuperLayer*> theSuperLayers;
110  std::vector<DTLayer*> theLayers;
111 
112  // Map for efficient lookup by DetId
114 
115  // These are used rarely; they could be computed at runtime
116  // to save memory.
118  DetContainer theDets; // all chambers, SL, layers
119 
120  // Replace local static with mutable members
121  // to allow lazy evaluation if (ever) needed.
125 };
126 
127 #endif
std::map< DetId, GeomDet * > DTDetMap
Definition: DTGeometry.h:29
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: DTGeometry.cc:56
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
Class to update a given geometry with a set of alignments.
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
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return a DTSuperLayer given its id.
Definition: DTGeometry.cc:107
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