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

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:
2006/06/14 18:18:14
Revision:
1.6
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 14 of file GlobalTrackingGeometry.cc.

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

Destructor.

Definition at line 16 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 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;
}
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, UserOptions_cff::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 56 of file GlobalTrackingGeometry.h.

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