CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/Geometry/GEMGeometry/src/GEMGeometry.cc

Go to the documentation of this file.
00001 
00006 #include <Geometry/GEMGeometry/interface/GEMGeometry.h>
00007 #include <Geometry/CommonDetUnit/interface/GeomDetUnit.h>
00008 
00009 GEMGeometry::GEMGeometry(){}
00010 
00011 
00012 GEMGeometry::~GEMGeometry(){}  
00013 
00014  
00015 const GEMGeometry::DetTypeContainer&  GEMGeometry::detTypes() const{
00016   return theEtaPartitionTypes;
00017 }
00018 
00019 
00020 const GEMGeometry::DetUnitContainer& GEMGeometry::detUnits() const{
00021   return theEtaPartitions;
00022 }
00023 
00024 
00025 const GEMGeometry::DetContainer& GEMGeometry::dets() const{
00026   return theDets;
00027 }
00028 
00029   
00030 const GEMGeometry::DetIdContainer& GEMGeometry::detUnitIds() const{
00031   return theEtaPartitionIds;
00032 }
00033 
00034 
00035 const GEMGeometry::DetIdContainer& GEMGeometry::detIds() const{
00036   return theDetIds;
00037 }
00038 
00039 
00040 const GeomDetUnit* GEMGeometry::idToDetUnit(DetId id) const{
00041   return dynamic_cast<const GeomDetUnit*>(idToDet(id));
00042 }
00043 
00044 const GeomDet* GEMGeometry::idToDet(DetId id) const{
00045   mapIdToDet::const_iterator i = theMap.find(id);
00046   return (i != theMap.end()) ?
00047     i->second : 0 ;
00048 }
00049 
00050 /*
00051 const std::vector<GEMChamber*>& GEMGeometry::chambers() const {
00052   return allChambers;
00053 }
00054 */
00055 
00056 
00057 const std::vector<GEMEtaPartition*>& GEMGeometry::etaPartitions() const{
00058   return allEtaPartitions;
00059 }
00060 
00061 //const GEMChamber* GEMGeometry::chamber(GEMDetId id) const{
00062 //  return dynamic_cast<const GEMChamber*>(idToDet(id.chamberId()));
00063 //}
00064 
00065 const GEMEtaPartition* GEMGeometry::etaPartition(GEMDetId id) const{
00066   return dynamic_cast<const GEMEtaPartition*>(idToDetUnit(id));
00067 }
00068 
00069 
00070 void
00071 GEMGeometry::add(GEMEtaPartition* etaPartition){
00072   theDets.push_back(etaPartition);
00073   allEtaPartitions.push_back(etaPartition);
00074   theEtaPartitions.push_back(etaPartition);
00075   theEtaPartitionIds.push_back(etaPartition->geographicalId());
00076   theDetIds.push_back(etaPartition->geographicalId());
00077   GeomDetType* _t = const_cast<GeomDetType*>(&etaPartition->type());
00078   theEtaPartitionTypes.push_back(_t);
00079   theMap.insert(std::pair<DetId,GeomDetUnit*>
00080                 (etaPartition->geographicalId(),etaPartition));
00081 }
00082 
00083 /*
00084 void
00085 GEMGeometry::add(GEMChamber* chamber){
00086   allChambers.push_back(chamber);
00087   theDets.push_back(chamber);
00088   theDetIds.push_back(chamber->geographicalId());
00089   theMap.insert(std::pair<DetId,GeomDet*>
00090                 (chamber->geographicalId(),chamber));
00091 }
00092 */