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 class GeomDetUnit;
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;
33 
34  // Return a vector of all GeomDetUnit
35  virtual const DetUnitContainer& detUnits() const;
36 
37  // Return a vector of all GeomDet
38  virtual const DetContainer& dets() const;
39 
40  // Return a vector of all GeomDetUnit DetIds
41  virtual const DetIdContainer& detUnitIds() const;
42 
43  // Return a vector of all GeomDet DetIds
44  virtual const DetIdContainer& detIds() const;
45 
46  // Return the pointer to the GeomDetUnit corresponding to a given DetId
47  virtual const GeomDetUnit* idToDetUnit(DetId) const;
48 
49  // Return the pointer to the GeomDet corresponding to a given DetId
50  virtual const GeomDet* idToDet(DetId) const;
51 
52 
53  //---- Extension of the interface
54 
56  const std::vector<RPCChamber*>& chambers() const;
57 
59  const std::vector<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<RPCRoll*> allRolls; // Are not owned by this class; are owned by their chamber.
84  std::vector<RPCChamber*> allChambers; // Are owned by this class.
85 
86 };
87 
88 #endif
mapIdToDet theMap
Definition: RPCGeometry.h:81
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
Definition: RPCGeometry.cc:28
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:48
DetTypeContainer theRollTypes
Definition: RPCGeometry.h:76
std::vector< RPCRoll * > allRolls
Definition: RPCGeometry.h:83
std::vector< GeomDet * > DetContainer
std::vector< RPCChamber * > allChambers
Definition: RPCGeometry.h:84
const std::vector< RPCChamber * > & chambers() const
Return a vector of all RPC chambers.
Definition: RPCGeometry.cc:63
void add(RPCRoll *roll)
Add a RPC roll to the Geometry.
Definition: RPCGeometry.cc:81
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: RPCGeometry.cc:43
const RPCChamber * chamber(RPCDetId id) const
Definition: RPCGeometry.cc:71
std::vector< GeomDetUnit * > DetUnitContainer
virtual ~RPCGeometry()
Destructor.
Definition: RPCGeometry.cc:13
RPCGeometry()
Default constructor.
Definition: RPCGeometry.cc:10
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: RPCGeometry.cc:33
DetIdContainer theRollIds
Definition: RPCGeometry.h:77
std::vector< GeomDetType * > DetTypeContainer
Definition: DetId.h:18
DetUnitContainer theRolls
Definition: RPCGeometry.h:74
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
Definition: RPCGeometry.cc:23
DetIdContainer theDetIds
Definition: RPCGeometry.h:78
DetContainer theDets
Definition: RPCGeometry.h:75
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
Definition: RPCGeometry.cc:38
__gnu_cxx::hash_map< unsigned int, GeomDet * > mapIdToDet
const std::vector< RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
virtual const GeomDet * idToDet(DetId) const
Definition: RPCGeometry.cc:53
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:75
std::vector< DetId > DetIdContainer