CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCGeometry.h
Go to the documentation of this file.
1 #ifndef RPCGeometry_RPCGeometry_h
2 #define RPCGeometry_RPCGeometry_h
3 
15 #include <vector>
16 #include <map>
17 
18 
19 class GeomDetType;
20 
21 
22 class RPCGeometry : public TrackingGeometry {
23 
24  public:
26  RPCGeometry();
27 
29  virtual ~RPCGeometry();
30 
31  // Return a vector of all det types
32  virtual const DetTypeContainer& detTypes() const override;
33 
34  // Return a vector of all GeomDetUnit
35  virtual const DetUnitContainer& detUnits() const override;
36 
37  // Return a vector of all GeomDet
38  virtual const DetContainer& dets() const override;
39 
40  // Return a vector of all GeomDetUnit DetIds
41  virtual const DetIdContainer& detUnitIds() const override;
42 
43  // Return a vector of all GeomDet DetIds
44  virtual const DetIdContainer& detIds() const override;
45 
46  // Return the pointer to the GeomDetUnit corresponding to a given DetId
47  virtual const GeomDetUnit* idToDetUnit(DetId) const override;
48 
49  // Return the pointer to the GeomDet corresponding to a given DetId
50  virtual const GeomDet* idToDet(DetId) const override;
51 
52 
53  //---- Extension of the interface
54 
56  const std::vector<const RPCChamber*>& chambers() const;
57 
59  const std::vector<const RPCRoll*>& rolls() const;
60 
61  // Return a RPCChamber given its id
62  const RPCChamber* chamber(RPCDetId id) const;
63 
65  const RPCRoll* roll(RPCDetId id) const;
66 
68  void add(RPCRoll* roll);
69 
71  void add(RPCChamber* ch);
72 
73  private:
79 
80  // Map for efficient lookup by DetId
82 
83  std::vector<const RPCRoll*> allRolls; // Are not owned by this class; are owned by their chamber.
84  std::vector<const RPCChamber*> allChambers; // Are owned by this class.
85 
86 };
87 
88 #endif
mapIdToDet theMap
Definition: RPCGeometry.h:81
std::vector< GeomDetType const * > DetTypeContainer
virtual const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: RPCGeometry.cc:23
DetTypeContainer theRollTypes
Definition: RPCGeometry.h:76
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
virtual const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: RPCGeometry.cc:38
std::vector< const RPCRoll * > allRolls
Definition: RPCGeometry.h:83
virtual const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: RPCGeometry.cc:43
void add(RPCRoll *roll)
Add a RPC roll to the Geometry.
Definition: RPCGeometry.cc:81
const RPCChamber * chamber(RPCDetId id) const
Definition: RPCGeometry.cc:71
virtual ~RPCGeometry()
Destructor.
Definition: RPCGeometry.cc:13
RPCGeometry()
Default constructor.
Definition: RPCGeometry.cc:10
virtual const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: RPCGeometry.cc:33
DetIdContainer theRollIds
Definition: RPCGeometry.h:77
virtual const DetUnitContainer & detUnits() const override
Returm a vector of all GeomDetUnit.
Definition: RPCGeometry.cc:28
std::unordered_map< unsigned int, GeomDet const * > mapIdToDet
const std::vector< const RPCChamber * > & chambers() const
Return a vector of all RPC chambers.
Definition: RPCGeometry.cc:63
Definition: DetId.h:18
std::vector< const RPCChamber * > allChambers
Definition: RPCGeometry.h:84
DetUnitContainer theRolls
Definition: RPCGeometry.h:74
DetIdContainer theDetIds
Definition: RPCGeometry.h:78
DetContainer theDets
Definition: RPCGeometry.h:75
virtual const GeomDet * idToDet(DetId) const override
Definition: RPCGeometry.cc:53
std::vector< GeomDet const * > DetContainer
std::vector< GeomDetUnit const * > DetUnitContainer
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:75
std::vector< DetId > DetIdContainer
virtual const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:48