![]() |
![]() |
#include <Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h>
Public Member Functions | |
virtual const DetIdContainer & | detIds () const |
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits). | |
virtual const DetContainer & | dets () const |
Returm a vector of all GeomDet (including all GeomDetUnits). | |
virtual const DetTypeContainer & | detTypes () const |
Return a vector of all det types. | |
virtual const DetIdContainer & | detUnitIds () const |
Returm a vector of all GeomDetUnit DetIds. | |
virtual const DetUnitContainer & | detUnits () const |
Returm a vector of all GeomDetUnit. | |
GlobalTrackingGeometry (std::vector< const TrackingGeometry * > &geos) | |
Constructor. | |
virtual const GeomDet * | idToDet (DetId) const |
Return the pointer to the GeomDet corresponding to a given DetId (valid also for GeomDetUnits). | |
virtual const GeomDetUnit * | idToDetUnit (DetId) const |
Return the pointer to the GeomDetUnit corresponding to a given DetId. | |
const TrackingGeometry * | slaveGeometry (DetId id) const |
Return the pointer to the actual geometry for a given DetId. | |
virtual | ~GlobalTrackingGeometry () |
Destructor. | |
Private Attributes | |
std::vector< const TrackingGeometry * > | theGeometries |
ESProducer for GlobalTrackingGeometry in MuonGeometryRecord.
The main purpose is to provide the methods idToDetUnit(DetId) and idToDet(DetId) that allow to get an element of the geometry given its DetId, regardless of wich subdetector it belongs.
The slave geometries (TrackerGeometry, DTGeometry, CSCGeometry, RPCGeometry) are accessible with the method slaveGeometry(DetId).
Definition at line 21 of file GlobalTrackingGeometry.h.
GlobalTrackingGeometry::GlobalTrackingGeometry | ( | std::vector< const TrackingGeometry * > & | geos | ) |
Constructor.
Definition at line 14 of file GlobalTrackingGeometry.cc.
00014 : theGeometries(geos) {}
GlobalTrackingGeometry::~GlobalTrackingGeometry | ( | ) | [virtual] |
const TrackingGeometry::DetIdContainer & GlobalTrackingGeometry::detIds | ( | ) | const [virtual] |
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits).
Implements TrackingGeometry.
Definition at line 118 of file GlobalTrackingGeometry.cc.
References detId, HLT_VtxMuL3::result, and theGeometries.
00118 { 00119 00120 static DetIdContainer result; 00121 if ( ! result.empty() ) return result; 00122 for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(); 00123 geom != theGeometries.end(); geom++) 00124 { 00125 if (*geom == 0) continue; 00126 DetIdContainer detIds((*geom)->detIds()); 00127 if ( detIds.size()+result.size()<result.capacity() ) result.resize(detIds.size()+result.size()); 00128 for( DetIdContainer::const_iterator detId = detIds.begin(); detId!=detIds.end(); detId++) 00129 result.push_back(*detId); 00130 } 00131 return result; 00132 }
const TrackingGeometry::DetContainer & GlobalTrackingGeometry::dets | ( | ) | const [virtual] |
Returm a vector of all GeomDet (including all GeomDetUnits).
Implements TrackingGeometry.
Definition at line 86 of file GlobalTrackingGeometry.cc.
References HLT_VtxMuL3::result, and theGeometries.
00086 { 00087 00088 static DetContainer result; 00089 if ( ! result.empty() ) return result; 00090 for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(); 00091 geom != theGeometries.end(); geom++) 00092 { 00093 if (*geom == 0) continue; 00094 DetContainer dets((*geom)->dets()); 00095 if ( dets.size()+result.size()<result.capacity() ) result.resize(dets.size()+result.size()); 00096 for( DetContainer::const_iterator det = dets.begin(); det!=dets.end(); det++) 00097 result.push_back(*det); 00098 } 00099 return result; 00100 }
const TrackingGeometry::DetTypeContainer & GlobalTrackingGeometry::detTypes | ( | ) | const [virtual] |
Return a vector of all det types.
Implements TrackingGeometry.
Definition at line 54 of file GlobalTrackingGeometry.cc.
References HLT_VtxMuL3::result, and theGeometries.
00054 { 00055 00056 static DetTypeContainer result; 00057 if ( ! result.empty() ) return result; 00058 for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(); 00059 geom != theGeometries.end(); geom++) 00060 { 00061 if (*geom == 0) continue; 00062 DetTypeContainer detTypes((*geom)->detTypes()); 00063 if ( detTypes.size()+result.size()<result.capacity() ) result.resize(detTypes.size()+result.size()); 00064 for( DetTypeContainer::const_iterator detType = detTypes.begin(); detType!=detTypes.end(); detType++) 00065 result.push_back(*detType); 00066 } 00067 return result; 00068 }
const TrackingGeometry::DetIdContainer & GlobalTrackingGeometry::detUnitIds | ( | ) | const [virtual] |
Returm a vector of all GeomDetUnit DetIds.
Implements TrackingGeometry.
Definition at line 102 of file GlobalTrackingGeometry.cc.
References HLT_VtxMuL3::result, and theGeometries.
00102 { 00103 00104 static DetIdContainer result; 00105 if ( ! result.empty() ) return result; 00106 for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(); 00107 geom != theGeometries.end(); geom++) 00108 { 00109 if (*geom == 0) continue; 00110 DetIdContainer detUnitIds((*geom)->detUnitIds()); 00111 if ( detUnitIds.size()+result.size()<result.capacity() ) result.resize(detUnitIds.size()+result.size()); 00112 for( DetIdContainer::const_iterator detUnitId = detUnitIds.begin(); detUnitId!=detUnitIds.end(); detUnitId++) 00113 result.push_back(*detUnitId); 00114 } 00115 return result; 00116 }
const TrackingGeometry::DetUnitContainer & GlobalTrackingGeometry::detUnits | ( | ) | const [virtual] |
Returm a vector of all GeomDetUnit.
Implements TrackingGeometry.
Definition at line 70 of file GlobalTrackingGeometry.cc.
References HLT_VtxMuL3::result, and theGeometries.
00070 { 00071 00072 static DetUnitContainer result; 00073 if ( ! result.empty() ) return result; 00074 for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(); 00075 geom != theGeometries.end(); geom++) 00076 { 00077 if (*geom == 0) continue; 00078 DetUnitContainer detUnits((*geom)->detUnits()); 00079 if ( detUnits.size()+result.size()<result.capacity() ) result.resize(detUnits.size()+result.size()); 00080 for( DetUnitContainer::const_iterator detUnit = detUnits.begin(); detUnit!=detUnits.end(); detUnit++) 00081 result.push_back(*detUnit); 00082 } 00083 return result; 00084 }
Return the pointer to the GeomDet corresponding to a given DetId (valid also for GeomDetUnits).
Implements TrackingGeometry.
Definition at line 30 of file GlobalTrackingGeometry.cc.
References TrackingGeometry::idToDet(), and slaveGeometry().
Referenced by MuonTimingExtractor::fillTiming(), MuonDetIdAssociator::getDetIdPoints(), MuonDetIdAssociator::getGeomDet(), VisEventSetupService::globalPosition(), VisEventSetupService::idToDet(), MuonDetIdAssociator::insideElement(), and VisEventSetupService::localPosition().
00030 { 00031 00032 const TrackingGeometry* tg = slaveGeometry(id); 00033 00034 if (tg != 0) { 00035 return tg->idToDet(id); 00036 } else { 00037 return 0; 00038 } 00039 }
const GeomDetUnit * GlobalTrackingGeometry::idToDetUnit | ( | DetId | ) | const [virtual] |
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Implements TrackingGeometry.
Definition at line 18 of file GlobalTrackingGeometry.cc.
References TrackingGeometry::idToDetUnit(), and slaveGeometry().
Referenced by VisEventSetupService::localPosition(), VisEventSetupService::localPositions(), and VisEventSetupService::toGlobal().
00018 { 00019 00020 const TrackingGeometry* tg = slaveGeometry(id); 00021 00022 if (tg != 0) { 00023 return tg->idToDetUnit(id); 00024 } else { 00025 return 0; 00026 } 00027 }
const TrackingGeometry * GlobalTrackingGeometry::slaveGeometry | ( | DetId | id | ) | const |
Return the pointer to the actual geometry for a given DetId.
Definition at line 41 of file GlobalTrackingGeometry.cc.
References lat::endl(), Exception, DetId::Muon, and theGeometries.
Referenced by MuonDetIdAssociator::getASetOfValidDetIds(), idToDet(), and idToDetUnit().
00041 { 00042 00043 int idx = id.det()-1; 00044 if (id.det() == DetId::Muon) { 00045 00046 idx+=id.subdetId()-1; 00047 } 00048 00049 if (theGeometries[idx]==0) throw cms::Exception("NoGeometry") << "No Tracking Geometry is available for DetId " << id.rawId() << std::endl; 00050 00051 return theGeometries[idx]; 00052 }
std::vector<const TrackingGeometry*> GlobalTrackingGeometry::theGeometries [private] |
Definition at line 56 of file GlobalTrackingGeometry.h.
Referenced by detIds(), dets(), detTypes(), detUnitIds(), detUnits(), and slaveGeometry().