CMS 3D CMS Logo

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  ~RPCGeometry() override;
30 
31  // Return a vector of all det types
32  const DetTypeContainer& detTypes() const override;
33 
34  // Return a vector of all GeomDetUnit
35  const DetContainer& detUnits() const override;
36 
37  // Return a vector of all GeomDet
38  const DetContainer& dets() const override;
39 
40  // Return a vector of all GeomDetUnit DetIds
41  const DetIdContainer& detUnitIds() const override;
42 
43  // Return a vector of all GeomDet DetIds
44  const DetIdContainer& detIds() const override;
45 
46  // Return the pointer to the GeomDetUnit corresponding to a given DetId
47  const GeomDet* idToDetUnit(DetId) const override;
48 
49  // Return the pointer to the GeomDet corresponding to a given DetId
50  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
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:48
~RPCGeometry() override
Destructor.
Definition: RPCGeometry.cc:13
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: RPCGeometry.cc:28
DetTypeContainer theRollTypes
Definition: RPCGeometry.h:76
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
std::vector< const RPCRoll * > allRolls
Definition: RPCGeometry.h:83
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: RPCGeometry.cc:38
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 DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: RPCGeometry.cc:23
const RPCChamber * chamber(RPCDetId id) const
Definition: RPCGeometry.cc:71
RPCGeometry()
Default constructor.
Definition: RPCGeometry.cc:10
DetIdContainer theRollIds
Definition: RPCGeometry.h:77
DetContainer theRolls
Definition: RPCGeometry.h:74
const std::vector< const RPCChamber * > & chambers() const
Return a vector of all RPC chambers.
Definition: RPCGeometry.cc:63
Definition: DetId.h:18
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: RPCGeometry.cc:33
std::vector< const RPCChamber * > allChambers
Definition: RPCGeometry.h:84
std::vector< DetId > DetIdContainer
const GeomDet * idToDet(DetId) const override
Definition: RPCGeometry.cc:53
std::vector< const GeomDet * > DetContainer
DetIdContainer theDetIds
Definition: RPCGeometry.h:78
std::unordered_map< unsigned int, const GeomDet * > mapIdToDet
DetContainer theDets
Definition: RPCGeometry.h:75
std::vector< const GeomDetType * > DetTypeContainer
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:75