Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:19

0001 #ifndef RPCGeometry_RPCGeometry_h
0002 #define RPCGeometry_RPCGeometry_h
0003 
0004 /** \class RPCGeometry
0005  *
0006  *  The model of the geometry of RPC.
0007  *
0008  *  \author M. Maggi - INFN Bari
0009  */
0010 
0011 #include "DataFormats/DetId/interface/DetId.h"
0012 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0013 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
0014 #include "Geometry/RPCGeometry/interface/RPCChamber.h"
0015 #include <vector>
0016 #include <map>
0017 
0018 class GeomDetType;
0019 
0020 class RPCGeometry : public TrackingGeometry {
0021 public:
0022   /// Default constructor
0023   RPCGeometry();
0024 
0025   /// Destructor
0026   ~RPCGeometry() override;
0027 
0028   // Return a vector of all det types
0029   const DetTypeContainer& detTypes() const override;
0030 
0031   // Return a vector of all GeomDetUnit
0032   const DetContainer& detUnits() const override;
0033 
0034   // Return a vector of all GeomDet
0035   const DetContainer& dets() const override;
0036 
0037   // Return a vector of all GeomDetUnit DetIds
0038   const DetIdContainer& detUnitIds() const override;
0039 
0040   // Return a vector of all GeomDet DetIds
0041   const DetIdContainer& detIds() const override;
0042 
0043   // Return the pointer to the GeomDetUnit corresponding to a given DetId
0044   const GeomDet* idToDetUnit(DetId) const override;
0045 
0046   // Return the pointer to the GeomDet corresponding to a given DetId
0047   const GeomDet* idToDet(DetId) const override;
0048 
0049   //---- Extension of the interface
0050 
0051   /// Return a vector of all RPC chambers
0052   const std::vector<const RPCChamber*>& chambers() const;
0053 
0054   /// Return a vector of all RPC rolls
0055   const std::vector<const RPCRoll*>& rolls() const;
0056 
0057   // Return a RPCChamber given its id
0058   const RPCChamber* chamber(RPCDetId id) const;
0059 
0060   /// Return a roll given its id
0061   const RPCRoll* roll(RPCDetId id) const;
0062 
0063   /// Add a RPC roll to the Geometry
0064   void add(RPCRoll* roll);
0065 
0066   /// Add a RPC roll to the Geometry
0067   void add(RPCChamber* ch);
0068 
0069 private:
0070   DetContainer theRolls;
0071   DetContainer theDets;
0072   DetTypeContainer theRollTypes;
0073   DetIdContainer theRollIds;
0074   DetIdContainer theDetIds;
0075 
0076   // Map for efficient lookup by DetId
0077   mapIdToDet theMap;
0078 
0079   std::vector<const RPCRoll*> allRolls;        // Are not owned by this class; are owned by their chamber.
0080   std::vector<const RPCChamber*> allChambers;  // Are owned by this class.
0081 };
0082 
0083 #endif