CMS 3D CMS Logo

DTGeometry.h

Go to the documentation of this file.
00001 #ifndef DTGeometry_DTGeometry_h
00002 #define DTGeometry_DTGeometry_h
00003 
00016 #include <DataFormats/DetId/interface/DetId.h>
00017 #include <Geometry/CommonDetUnit/interface/TrackingGeometry.h>
00018 #include "Geometry/DTGeometry/interface/DTChamber.h"
00019 #include "Geometry/DTGeometry/interface/DTSuperLayer.h"
00020 #include "Geometry/DTGeometry/interface/DTLayer.h"
00021 #include <vector>
00022 #include <map>
00023 
00024 class GeomDetType;
00025 class GeomDetUnit;
00026 
00027 class DTGeometry : public TrackingGeometry {
00028 
00029   typedef std::map<DetId, GeomDet*> DTDetMap;
00030 
00031   public:
00033     DTGeometry();
00034 
00036     virtual ~DTGeometry();
00037 
00038     //---- Base class' interface 
00039 
00040     // Return a vector of all det types
00041     virtual const DetTypeContainer&  detTypes() const;
00042 
00043     // Returm a vector of all GeomDetUnit
00044     virtual const DetUnitContainer&  detUnits() const;
00045 
00046     // Returm a vector of all GeomDet (including all GeomDetUnits)
00047     virtual const DetContainer& dets() const;
00048 
00049     // Returm a vector of all GeomDetUnit DetIds
00050     virtual const DetIdContainer&    detUnitIds() const;
00051 
00052     // Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
00053     virtual const DetIdContainer& detIds() const;
00054 
00055     // Return the pointer to the GeomDetUnit corresponding to a given DetId
00056     virtual const GeomDetUnit* idToDetUnit(DetId) const;
00057 
00058     // Return the pointer to the GeomDet corresponding to a given DetId
00059     virtual const GeomDet* idToDet(DetId) const;
00060 
00061 
00062     //---- Extension of the interface
00063 
00065     const std::vector<DTChamber*>& chambers() const;
00066 
00068     const std::vector<DTSuperLayer*>& superLayers() const;
00069 
00071     const std::vector<DTLayer*>& layers() const;
00072 
00073 
00075     const DTChamber* chamber(DTChamberId id) const;
00076 
00078     const DTSuperLayer* superLayer(DTSuperLayerId id) const;
00079 
00081     const DTLayer* layer(DTLayerId id) const;
00082 
00083 
00084   private:
00085   
00086     friend class DTGeometryBuilderFromDDD;
00087 
00088     friend class GeometryAligner;
00089 
00090 
00092     void add(DTChamber* ch);
00093 
00095     void add(DTSuperLayer* sl);
00096 
00098     void add(DTLayer* l);
00099 
00100 
00101     // The chambers are owned by the geometry (and in turn own superlayers
00102     // and layers)
00103     std::vector<DTChamber*> theChambers; 
00104 
00105     // All following pointers are redundant; they are used only for an
00106     // efficient implementation of the interface, and are NOT owned.
00107 
00108     std::vector<DTSuperLayer*> theSuperLayers; 
00109     std::vector<DTLayer*> theLayers;
00110 
00111     // Map for efficient lookup by DetId 
00112     DTDetMap          theMap;
00113 
00114     // These are used rarely; they could be computed at runtime 
00115     // to save memory.
00116     DetUnitContainer  theDetUnits;       // all layers
00117     DetContainer      theDets;           // all chambers, SL, layers
00118 
00119 
00120 };
00121 
00122 #endif

Generated on Tue Jun 9 17:37:20 2009 for CMSSW by  doxygen 1.5.4