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 
9 
11 
12 
14 {
15  // delete all the chamber associated to the geometry
16  //for (std::vector<RPCChamber*>::const_iterator ich = allChambers.begin();
17  // ich != allChambers.end(); ++ich){
18  // delete (*ich);
19  //}
20 }
21 
22 
24  return theRollTypes;
25 }
26 
27 
29  return theRolls;
30 }
31 
32 
34  return theDets;
35 }
36 
37 
39  return theRollIds;
40 }
41 
42 
44  return theDetIds;
45 }
46 
47 
49  return dynamic_cast<const GeomDetUnit*>(idToDet(id));
50 }
51 
52 
54  mapIdToDet::const_iterator i = theMap.find(id);
55  if (i != theMap.end())
56  return i->second;
57 
58  LogDebug("RPCGeometry")<<"Invalid DetID: no GeomDet associated "<< RPCDetId(id);
59  GeomDet* geom = 0;
60  return geom;
61 }
62 
63 const std::vector<RPCChamber*>& RPCGeometry::chambers() const {
64  return allChambers;
65 }
66 
67 const std::vector<RPCRoll*>& RPCGeometry::rolls() const{
68  return allRolls;
69 }
70 
72  return dynamic_cast<const RPCChamber*>(idToDet(id.chamberId()));
73 }
74 
76  return dynamic_cast<const RPCRoll*>(idToDetUnit(id));
77 }
78 
79 
80 void
82  theDets.push_back(roll);
83  allRolls.push_back(roll);
84  theRolls.push_back(roll);
85  theRollIds.push_back(roll->geographicalId());
86  theDetIds.push_back(roll->geographicalId());
87  GeomDetType* _t = const_cast<GeomDetType*>(&roll->type());
88  theRollTypes.push_back(_t);
89  theMap.insert(std::pair<DetId,GeomDetUnit*>
90  (roll->geographicalId(),roll));
91 }
92 
93 void
95  allChambers.push_back(chamber);
96  theDets.push_back(chamber);
97  theDetIds.push_back(chamber->geographicalId());
98  theMap.insert(std::pair<DetId,GeomDet*>
99  (chamber->geographicalId(),chamber));
100 }
#define LogDebug(id)
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: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
const GeomDetType & type() const
Definition: RPCRoll.cc:36
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
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
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
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