test
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<const RPCChamber*>& RPCGeometry::chambers() const {
64  return allChambers;
65 }
66 
67 const std::vector<const 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
std::vector< GeomDetType const * > DetTypeContainer
int i
Definition: DBlmapReader.cc:9
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
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 override
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:77
virtual const DetUnitContainer & detUnits() const override
Returm a vector of all GeomDetUnit.
Definition: RPCGeometry.cc:28
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