CMS 3D CMS Logo

Public Member Functions | Private Attributes

GlobalTrackingGeometry Class Reference

#include <GlobalTrackingGeometry.h>

Inheritance diagram for GlobalTrackingGeometry:
TrackingGeometry

List of all members.

Public Member Functions

virtual const DetIdContainerdetIds () const
 Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
virtual const DetContainerdets () const
 Returm a vector of all GeomDet (including all GeomDetUnits)
virtual const DetTypeContainerdetTypes () const
 Return a vector of all det types.
virtual const DetIdContainerdetUnitIds () const
 Returm a vector of all GeomDetUnit DetIds.
virtual const DetUnitContainerdetUnits () const
 Returm a vector of all GeomDetUnit.
 GlobalTrackingGeometry (std::vector< const TrackingGeometry * > &geos)
 Constructor.
virtual const GeomDetidToDet (DetId) const
virtual const GeomDetUnitidToDetUnit (DetId) const
 Return the pointer to the GeomDetUnit corresponding to a given DetId.
const TrackingGeometryslaveGeometry (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

Detailed Description

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).

Date:
2012/07/24 13:48:28
Revision:
1.7
Author:
M. Sani

ESProducer for GlobalTrackingGeometry in MuonGeometryRecord

Date:
2011/08/16 14:54:34
Revision:
1.1
Author:
Matteo Sani

Definition at line 21 of file GlobalTrackingGeometry.h.


Constructor & Destructor Documentation

GlobalTrackingGeometry::GlobalTrackingGeometry ( std::vector< const TrackingGeometry * > &  geos)

Constructor.

Definition at line 11 of file GlobalTrackingGeometry.cc.

    : theGeometries(geos)
{}
GlobalTrackingGeometry::~GlobalTrackingGeometry ( ) [virtual]

Destructor.

Definition at line 15 of file GlobalTrackingGeometry.cc.

{}

Member Function Documentation

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;
}
const GeomDet * GlobalTrackingGeometry::idToDet ( DetId  ) const [virtual]

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];
}

Member Data Documentation

Definition at line 66 of file GlobalTrackingGeometry.h.

Referenced by detIds().

Definition at line 64 of file GlobalTrackingGeometry.h.

Referenced by dets().

Definition at line 62 of file GlobalTrackingGeometry.h.

Referenced by detTypes().

Definition at line 65 of file GlobalTrackingGeometry.h.

Referenced by detUnitIds().

Definition at line 63 of file GlobalTrackingGeometry.h.

Referenced by detUnits().

Definition at line 57 of file GlobalTrackingGeometry.h.

Referenced by detIds(), dets(), detTypes(), detUnitIds(), detUnits(), and slaveGeometry().