#include <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 |
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 | |
DetIdContainer | theDetIds |
DetContainer | theDets |
DetTypeContainer | theDetTypes |
DetIdContainer | theDetUnitIds |
DetUnitContainer | theDetUnits |
std::vector< const TrackingGeometry * > | theGeometries |
Single entry point to the tracker and muon geometries. 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).
ESProducer for GlobalTrackingGeometry in MuonGeometryRecord
Definition at line 21 of file GlobalTrackingGeometry.h.
GlobalTrackingGeometry::GlobalTrackingGeometry | ( | std::vector< const TrackingGeometry * > & | 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 119 of file GlobalTrackingGeometry.cc.
References relativeConstraints::geom, theDetIds, and theGeometries.
{ if( ! theDetIds.empty() ) return theDetIds; for( std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(), geomEnd = theGeometries.end(); geom != geomEnd; ++geom ) { if( *geom == 0 ) continue; DetIdContainer detIds(( *geom )->detIds()); if( detIds.size() + theDetIds.size() < theDetIds.capacity()) theDetIds.resize( detIds.size() + theDetIds.size()); for( DetIdContainer::const_iterator detId = detIds.begin(), detIdEnd = detIds.end(); detId != detIdEnd; ++detId ) theDetIds.push_back( *detId ); } return theDetIds; }
const TrackingGeometry::DetContainer & GlobalTrackingGeometry::dets | ( | ) | const [virtual] |
Returm a vector of all GeomDet (including all GeomDetUnits)
Implements TrackingGeometry.
Definition at line 87 of file GlobalTrackingGeometry.cc.
References relativeConstraints::geom, theDets, and theGeometries.
{ if( ! theDets.empty()) return theDets; for( std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(), geomEnd = theGeometries.end(); geom != geomEnd; ++geom ) { if( *geom == 0 ) continue; DetContainer dets(( *geom )->dets()); if( dets.size() + theDets.size() < theDets.capacity()) theDets.resize( dets.size() + theDets.size()); for( DetContainer::const_iterator det = dets.begin(), detEnd = dets.end(); det != detEnd; ++det ) theDets.push_back( *det ); } return theDets; }
const TrackingGeometry::DetTypeContainer & GlobalTrackingGeometry::detTypes | ( | ) | const [virtual] |
Return a vector of all det types.
Implements TrackingGeometry.
Definition at line 55 of file GlobalTrackingGeometry.cc.
References relativeConstraints::geom, theDetTypes, and theGeometries.
{ if ( ! theDetTypes.empty() ) return theDetTypes; for( std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(), geomEnd = theGeometries.end(); geom != geomEnd; ++geom ) { if( *geom == 0 ) continue; DetTypeContainer detTypes(( *geom )->detTypes()); if( detTypes.size() + theDetTypes.size() < theDetTypes.capacity()) theDetTypes.resize( detTypes.size() + theDetTypes.size()); for( DetTypeContainer::const_iterator detType = detTypes.begin(), detTypeEnd = detTypes.end(); detType != detTypeEnd; ++detType ) theDetTypes.push_back( *detType ); } return theDetTypes; }
const TrackingGeometry::DetIdContainer & GlobalTrackingGeometry::detUnitIds | ( | ) | const [virtual] |
Returm a vector of all GeomDetUnit DetIds.
Implements TrackingGeometry.
Definition at line 103 of file GlobalTrackingGeometry.cc.
References relativeConstraints::geom, theDetUnitIds, and theGeometries.
{ if( ! theDetUnitIds.empty()) return theDetUnitIds; for( std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(), geomEnd = theGeometries.end(); geom != geomEnd; ++geom ) { if( *geom == 0 ) continue; DetIdContainer detUnitIds(( *geom )->detUnitIds()); if( detUnitIds.size() + theDetUnitIds.size() < theDetUnitIds.capacity()) theDetUnitIds.resize( detUnitIds.size() + theDetUnitIds.size()); for( DetIdContainer::const_iterator detUnitId = detUnitIds.begin(), detUnitIdEnd = detUnitIds.end(); detUnitId != detUnitIdEnd; ++detUnitId ) theDetUnitIds.push_back( *detUnitId ); } return theDetUnitIds; }
const TrackingGeometry::DetUnitContainer & GlobalTrackingGeometry::detUnits | ( | ) | const [virtual] |
Returm a vector of all GeomDetUnit.
Implements TrackingGeometry.
Definition at line 71 of file GlobalTrackingGeometry.cc.
References relativeConstraints::geom, theDetUnits, and theGeometries.
{ if( ! theDetUnits.empty()) return theDetUnits; for( std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(), geomEnd = theGeometries.end(); geom != geomEnd; ++geom ) { if( *geom == 0 ) continue; DetUnitContainer detUnits(( *geom )->detUnits()); if( detUnits.size() + theDetUnits.size() < theDetUnits.capacity()) theDetUnits.resize( detUnits.size() + theDetUnits.size()); for( DetUnitContainer::const_iterator detUnit = detUnits.begin(), detUnitEnd = detUnits.end(); detUnit != detUnitEnd; ++detUnit ) theDetUnits.push_back( *detUnit ); } return theDetUnits; }
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 DTTimingExtractor::fillTiming(), CSCTimingExtractor::fillTiming(), MuonDetIdAssociator::getDetIdPoints(), MuonDetIdAssociator::getGeomDet(), and MuonDetIdAssociator::insideElement().
{ const TrackingGeometry* tg = slaveGeometry(id); if (tg != 0) { return tg->idToDet(id); } else { return 0; } }
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().
{ const TrackingGeometry* tg = slaveGeometry(id); if (tg != 0) { return tg->idToDetUnit(id); } else { return 0; } }
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 Exception, customizeTrackingMonitorSeedNumber::idx, DetId::Muon, and theGeometries.
Referenced by MuonDetIdAssociator::getValidDetIds(), idToDet(), and idToDetUnit().
{ int idx = id.det()-1; if (id.det() == DetId::Muon) { idx+=id.subdetId()-1; } if (theGeometries[idx]==0) throw cms::Exception("NoGeometry") << "No Tracking Geometry is available for DetId " << id.rawId() << std::endl; return theGeometries[idx]; }
DetIdContainer GlobalTrackingGeometry::theDetIds [mutable, private] |
Definition at line 66 of file GlobalTrackingGeometry.h.
Referenced by detIds().
DetContainer GlobalTrackingGeometry::theDets [mutable, private] |
Definition at line 64 of file GlobalTrackingGeometry.h.
Referenced by dets().
DetTypeContainer GlobalTrackingGeometry::theDetTypes [mutable, private] |
Definition at line 62 of file GlobalTrackingGeometry.h.
Referenced by detTypes().
DetIdContainer GlobalTrackingGeometry::theDetUnitIds [mutable, private] |
Definition at line 65 of file GlobalTrackingGeometry.h.
Referenced by detUnitIds().
DetUnitContainer GlobalTrackingGeometry::theDetUnits [mutable, private] |
Definition at line 63 of file GlobalTrackingGeometry.h.
Referenced by detUnits().
std::vector<const TrackingGeometry*> GlobalTrackingGeometry::theGeometries [private] |
Definition at line 57 of file GlobalTrackingGeometry.h.
Referenced by detIds(), dets(), detTypes(), detUnitIds(), detUnits(), and slaveGeometry().