CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCGeometry.cc
Go to the documentation of this file.
1 
8 
10 
11 
13 {
14  // delete all the chamber associated to the geometry
15  //for (std::vector<RPCChamber*>::const_iterator ich = allChambers.begin();
16  // ich != allChambers.end(); ++ich){
17  // delete (*ich);
18  //}
19 }
20 
21 
23  return theRollTypes;
24 }
25 
26 
28  return theRolls;
29 }
30 
31 
33  return theDets;
34 }
35 
36 
38  return theRollIds;
39 }
40 
41 
43  return theDetIds;
44 }
45 
46 
48  return dynamic_cast<const GeomDetUnit*>(idToDet(id));
49 }
50 
51 
53  mapIdToDet::const_iterator i = theMap.find(id);
54  return (i != theMap.end()) ?
55  i->second : 0 ;
56 }
57 
58 const std::vector<RPCChamber*>& RPCGeometry::chambers() const {
59  return allChambers;
60 }
61 
62 const std::vector<RPCRoll*>& RPCGeometry::rolls() const{
63  return allRolls;
64 }
65 
67  return dynamic_cast<const RPCChamber*>(idToDet(id.chamberId()));
68 }
69 
71  return dynamic_cast<const RPCRoll*>(idToDetUnit(id));
72 }
73 
74 
75 void
77  theDets.push_back(roll);
78  allRolls.push_back(roll);
79  theRolls.push_back(roll);
80  theRollIds.push_back(roll->geographicalId());
81  theDetIds.push_back(roll->geographicalId());
82  GeomDetType* _t = const_cast<GeomDetType*>(&roll->type());
83  theRollTypes.push_back(_t);
84  theMap.insert(std::pair<DetId,GeomDetUnit*>
85  (roll->geographicalId(),roll));
86 }
87 
88 void
90  allChambers.push_back(chamber);
91  theDets.push_back(chamber);
92  theDetIds.push_back(chamber->geographicalId());
93  theMap.insert(std::pair<DetId,GeomDet*>
94  (chamber->geographicalId(),chamber));
95 }
mapIdToDet theMap
Definition: RPCGeometry.h:81
int i
Definition: DBlmapReader.cc:9
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
Definition: RPCGeometry.cc:27
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:47
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:58
void add(RPCRoll *roll)
Add a RPC roll to the Geometry.
Definition: RPCGeometry.cc:76
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: RPCGeometry.cc:42
const RPCChamber * chamber(RPCDetId id) const
Definition: RPCGeometry.cc:66
std::vector< GeomDetUnit * > DetUnitContainer
const GeomDetType & type() const
Definition: RPCRoll.cc:36
virtual ~RPCGeometry()
Destructor.
Definition: RPCGeometry.cc:12
RPCGeometry()
Default constructor.
Definition: RPCGeometry.cc:9
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: RPCGeometry.cc:32
DetIdContainer theRollIds
Definition: RPCGeometry.h:77
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
std::vector< GeomDetType * > DetTypeContainer
Definition: DetId.h:20
DetUnitContainer theRolls
Definition: RPCGeometry.h:74
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
Definition: RPCGeometry.cc:22
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:37
const std::vector< RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:62
virtual const GeomDet * idToDet(DetId) const
Definition: RPCGeometry.cc:52
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:70
std::vector< DetId > DetIdContainer