#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 | |
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 118 of file GlobalTrackingGeometry.cc.
References relativeConstraints::geom, query::result, and theGeometries.
{ static DetIdContainer result; if ( ! result.empty() ) return result; for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(); geom != theGeometries.end(); geom++) { if (*geom == 0) continue; DetIdContainer detIds((*geom)->detIds()); if ( detIds.size()+result.size()<result.capacity() ) result.resize(detIds.size()+result.size()); for( DetIdContainer::const_iterator detId = detIds.begin(); detId!=detIds.end(); detId++) result.push_back(*detId); } return result; }
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 relativeConstraints::geom, query::result, and theGeometries.
{ static DetContainer result; if ( ! result.empty() ) return result; for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(); geom != theGeometries.end(); geom++) { if (*geom == 0) continue; DetContainer dets((*geom)->dets()); if ( dets.size()+result.size()<result.capacity() ) result.resize(dets.size()+result.size()); for( DetContainer::const_iterator det = dets.begin(); det!=dets.end(); det++) result.push_back(*det); } return result; }
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 relativeConstraints::geom, query::result, and theGeometries.
{ static DetTypeContainer result; if ( ! result.empty() ) return result; for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(); geom != theGeometries.end(); geom++) { if (*geom == 0) continue; DetTypeContainer detTypes((*geom)->detTypes()); if ( detTypes.size()+result.size()<result.capacity() ) result.resize(detTypes.size()+result.size()); for( DetTypeContainer::const_iterator detType = detTypes.begin(); detType!=detTypes.end(); detType++) result.push_back(*detType); } return result; }
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 relativeConstraints::geom, query::result, and theGeometries.
{ static DetIdContainer result; if ( ! result.empty() ) return result; for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(); geom != theGeometries.end(); geom++) { if (*geom == 0) continue; DetIdContainer detUnitIds((*geom)->detUnitIds()); if ( detUnitIds.size()+result.size()<result.capacity() ) result.resize(detUnitIds.size()+result.size()); for( DetIdContainer::const_iterator detUnitId = detUnitIds.begin(); detUnitId!=detUnitIds.end(); detUnitId++) result.push_back(*detUnitId); } return result; }
const TrackingGeometry::DetUnitContainer & GlobalTrackingGeometry::detUnits | ( | ) | const [virtual] |
Returm a vector of all GeomDetUnit.
Implements TrackingGeometry.
Definition at line 70 of file GlobalTrackingGeometry.cc.
References relativeConstraints::geom, query::result, and theGeometries.
{ static DetUnitContainer result; if ( ! result.empty() ) return result; for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(); geom != theGeometries.end(); geom++) { if (*geom == 0) continue; DetUnitContainer detUnits((*geom)->detUnits()); if ( detUnits.size()+result.size()<result.capacity() ) result.resize(detUnits.size()+result.size()); for( DetUnitContainer::const_iterator detUnit = detUnits.begin(); detUnit!=detUnits.end(); detUnit++) result.push_back(*detUnit); } return result; }
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, 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]; }
std::vector<const TrackingGeometry*> GlobalTrackingGeometry::theGeometries [private] |
Definition at line 56 of file GlobalTrackingGeometry.h.
Referenced by detIds(), dets(), detTypes(), detUnitIds(), detUnits(), and slaveGeometry().