CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/Geometry/RPCGeometry/interface/RPCGeometry.h

Go to the documentation of this file.
00001 #ifndef RPCGeometry_RPCGeometry_h
00002 #define RPCGeometry_RPCGeometry_h
00003 
00011 #include "DataFormats/DetId/interface/DetId.h"
00012 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
00013 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
00014 #include "Geometry/RPCGeometry/interface/RPCChamber.h"
00015 #include <vector>
00016 #include <map>
00017 
00018 
00019 class GeomDetType;
00020 class GeomDetUnit;
00021 
00022 class RPCGeometry : public TrackingGeometry {
00023 
00024  public:
00026   RPCGeometry();
00027 
00029   virtual ~RPCGeometry();
00030 
00031   // Return a vector of all det types
00032   virtual const DetTypeContainer&  detTypes() const;
00033 
00034   // Return a vector of all GeomDetUnit
00035   virtual const DetUnitContainer& detUnits() const;
00036 
00037   // Return a vector of all GeomDet
00038   virtual const DetContainer& dets() const;
00039   
00040   // Return a vector of all GeomDetUnit DetIds
00041   virtual const DetIdContainer& detUnitIds() const;
00042 
00043   // Return a vector of all GeomDet DetIds
00044   virtual const DetIdContainer& detIds() const;
00045 
00046   // Return the pointer to the GeomDetUnit corresponding to a given DetId
00047   virtual const GeomDetUnit* idToDetUnit(DetId) const;
00048 
00049   // Return the pointer to the GeomDet corresponding to a given DetId
00050   virtual const GeomDet* idToDet(DetId) const;
00051 
00052 
00053   //---- Extension of the interface
00054 
00056   const std::vector<RPCChamber*>& chambers() const;
00057 
00059   const std::vector<RPCRoll*>& rolls() const;
00060 
00061   // Return a RPCChamber given its id
00062   const RPCChamber* chamber(RPCDetId id) const;
00063 
00065   const RPCRoll* roll(RPCDetId id) const;
00066 
00068   void add(RPCRoll* roll);
00069 
00071   void add(RPCChamber* ch);
00072 
00073  private:
00074   DetUnitContainer theRolls;
00075   DetContainer theDets;
00076   DetTypeContainer theRollTypes;
00077   DetIdContainer theRollIds;
00078   DetIdContainer theDetIds;
00079   
00080   // Map for efficient lookup by DetId 
00081   mapIdToDet theMap;
00082 
00083   std::vector<RPCRoll*> allRolls; // Are not owned by this class; are owned by their chamber.
00084   std::vector<RPCChamber*> allChambers; // Are owned by this class.
00085 
00086 };
00087 
00088 #endif