CMS 3D CMS Logo

RPCGeometry.cc
Go to the documentation of this file.
1 
9 
11 
13  // delete all the chamber associated to the geometry
14  //for (std::vector<RPCChamber*>::const_iterator ich = allChambers.begin();
15  // ich != allChambers.end(); ++ich){
16  // delete (*ich);
17  //}
18 }
19 
21 
23 
25 
27 
29 
30 const GeomDet* RPCGeometry::idToDetUnit(DetId id) const { return dynamic_cast<const GeomDet*>(idToDet(id)); }
31 
33  mapIdToDet::const_iterator i = theMap.find(id);
34  if (i != theMap.end())
35  return i->second;
36 
37  LogDebug("RPCGeometry") << "Invalid DetID: no GeomDet associated " << RPCDetId(id);
38  GeomDet* geom = nullptr;
39  return geom;
40 }
41 
42 const std::vector<const RPCChamber*>& RPCGeometry::chambers() const { return allChambers; }
43 
44 const std::vector<const RPCRoll*>& RPCGeometry::rolls() const { return allRolls; }
45 
47  return dynamic_cast<const RPCChamber*>(idToDet(id.chamberId()));
48 }
49 
50 const RPCRoll* RPCGeometry::roll(RPCDetId id) const { return dynamic_cast<const RPCRoll*>(idToDetUnit(id)); }
51 
53  theDets.emplace_back(roll);
54  allRolls.emplace_back(roll);
55  theRolls.emplace_back(roll);
56  theRollIds.emplace_back(roll->geographicalId());
57  theDetIds.emplace_back(roll->geographicalId());
58  GeomDetType* _t = const_cast<GeomDetType*>(&roll->type());
59  theRollTypes.emplace_back(_t);
60  theMap.insert(std::pair<DetId, GeomDetUnit*>(roll->geographicalId(), roll));
61 }
62 
64  allChambers.emplace_back(chamber);
65  theDets.emplace_back(chamber);
66  theDetIds.emplace_back(chamber->geographicalId());
67  theMap.insert(std::pair<DetId, GeomDet*>(chamber->geographicalId(), chamber));
68 }
RPCRoll
Definition: RPCRoll.h:12
RPCGeometry::~RPCGeometry
~RPCGeometry() override
Destructor.
Definition: RPCGeometry.cc:12
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
RPCRoll::type
const GeomDetType & type() const override
Definition: RPCRoll.cc:20
GeomDet
Definition: GeomDet.h:27
RPCDetId
Definition: RPCDetId.h:16
RPCGeometry::theRollTypes
DetTypeContainer theRollTypes
Definition: RPCGeometry.h:72
RPCGeometry::detTypes
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: RPCGeometry.cc:20
GeomDetType
Definition: GeomDetType.h:9
RPCGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: RPCGeometry.cc:22
RPCGeometry::roll
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:50
RPCGeometry::detUnitIds
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: RPCGeometry.cc:26
RPCGeometry::allRolls
std::vector< const RPCRoll * > allRolls
Definition: RPCGeometry.h:79
RPCChamber
Definition: RPCChamber.h:19
RPCGeometry::chambers
const std::vector< const RPCChamber * > & chambers() const
Return a vector of all RPC chambers.
Definition: RPCGeometry.cc:42
RPCGeometry::idToDetUnit
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:30
RPCGeometry::detIds
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: RPCGeometry.cc:28
DetId
Definition: DetId.h:17
RPCGeometry::add
void add(RPCRoll *roll)
Add a RPC roll to the Geometry.
Definition: RPCGeometry.cc:52
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
RPCGeometry::RPCGeometry
RPCGeometry()
Default constructor.
Definition: RPCGeometry.cc:10
RPCGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: RPCGeometry.cc:24
RPCGeometry::theRollIds
DetIdContainer theRollIds
Definition: RPCGeometry.h:73
RPCGeometry::theRolls
DetContainer theRolls
Definition: RPCGeometry.h:70
TrackingGeometry::DetTypeContainer
std::vector< const GeomDetType * > DetTypeContainer
Definition: TrackingGeometry.h:28
TrackingGeometry::DetIdContainer
std::vector< DetId > DetIdContainer
Definition: TrackingGeometry.h:30
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
TrackingGeometry::DetContainer
std::vector< const GeomDet * > DetContainer
Definition: TrackingGeometry.h:29
RPCGeometry::chamber
const RPCChamber * chamber(RPCDetId id) const
Definition: RPCGeometry.cc:46
GeomDet.h
RPCGeometry::allChambers
std::vector< const RPCChamber * > allChambers
Definition: RPCGeometry.h:80
RPCGeometry::theDetIds
DetIdContainer theDetIds
Definition: RPCGeometry.h:74
RPCGeometry::theDets
DetContainer theDets
Definition: RPCGeometry.h:71
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
RPCGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: RPCGeometry.cc:32
RPCGeometry::rolls
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:44
RPCGeometry.h
RPCGeometry::theMap
mapIdToDet theMap
Definition: RPCGeometry.h:77