CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
GlobalTrackingGeometry Class Reference

#include <GlobalTrackingGeometry.h>

Inheritance diagram for GlobalTrackingGeometry:
TrackingGeometry

Public Member Functions

virtual const DetIdContainerdetIds () const
 Returm a vector of all GeomDet DetIds (including those of GeomDetUnits) More...
 
virtual const DetContainerdets () const
 Returm a vector of all GeomDet (including all GeomDetUnits) More...
 
virtual const DetTypeContainerdetTypes () const
 Return a vector of all det types. More...
 
virtual const DetIdContainerdetUnitIds () const
 Returm a vector of all GeomDetUnit DetIds. More...
 
virtual const DetUnitContainerdetUnits () const
 Returm a vector of all GeomDetUnit. More...
 
 GlobalTrackingGeometry (std::vector< const TrackingGeometry * > &geos)
 Constructor. More...
 
virtual const GeomDetidToDet (DetId) const
 
virtual const GeomDetUnitidToDetUnit (DetId) const
 Return the pointer to the GeomDetUnit corresponding to a given DetId. More...
 
const TrackingGeometryslaveGeometry (DetId id) const
 Return the pointer to the actual geometry for a given DetId. More...
 
virtual ~GlobalTrackingGeometry ()
 Destructor. More...
 
- Public Member Functions inherited from TrackingGeometry
virtual ~TrackingGeometry ()
 Destructor. More...
 

Private Attributes

DetIdContainer theDetIds
 
DetContainer theDets
 
DetTypeContainer theDetTypes
 
DetIdContainer theDetUnitIds
 
DetUnitContainer theDetUnits
 
std::vector< const
TrackingGeometry * > 
theGeometries
 

Additional Inherited Members

- Public Types inherited from TrackingGeometry
typedef std::vector< GeomDet * > DetContainer
 
typedef std::vector< DetIdDetIdContainer
 
typedef std::vector
< GeomDetType * > 
DetTypeContainer
 
typedef std::vector
< GeomDetUnit * > 
DetUnitContainer
 
typedef __gnu_cxx::hash_map
< unsigned int, GeomDet * > 
mapIdToDet
 
typedef __gnu_cxx::hash_map
< unsigned int, GeomDetUnit * > 
mapIdToDetUnit
 

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.

12  : theGeometries(geos)
13 {}
std::vector< const TrackingGeometry * > theGeometries
GlobalTrackingGeometry::~GlobalTrackingGeometry ( )
virtual

Destructor.

Definition at line 15 of file GlobalTrackingGeometry.cc.

16 {}

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.

120 {
121  if( ! theDetIds.empty() ) return theDetIds;
122  for( std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(), geomEnd = theGeometries.end();
123  geom != geomEnd; ++geom )
124  {
125  if( *geom == 0 ) continue;
126  DetIdContainer detIds(( *geom )->detIds());
127  if( detIds.size() + theDetIds.size() < theDetIds.capacity()) theDetIds.resize( detIds.size() + theDetIds.size());
128  for( DetIdContainer::const_iterator detId = detIds.begin(), detIdEnd = detIds.end(); detId != detIdEnd; ++detId )
129  theDetIds.push_back( *detId );
130  }
131  return theDetIds;
132 }
std::vector< const TrackingGeometry * > theGeometries
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
std::vector< DetId > DetIdContainer
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.

88 {
89  if( ! theDets.empty()) return theDets;
90  for( std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(), geomEnd = theGeometries.end();
91  geom != geomEnd; ++geom )
92  {
93  if( *geom == 0 ) continue;
94  DetContainer dets(( *geom )->dets());
95  if( dets.size() + theDets.size() < theDets.capacity()) theDets.resize( dets.size() + theDets.size());
96  for( DetContainer::const_iterator det = dets.begin(), detEnd = dets.end(); det != detEnd; ++det )
97  theDets.push_back( *det );
98  }
99  return theDets;
100 }
std::vector< const TrackingGeometry * > theGeometries
std::vector< GeomDet * > DetContainer
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
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.

56 {
57  if ( ! theDetTypes.empty() ) return theDetTypes;
58  for( std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(), geomEnd = theGeometries.end();
59  geom != geomEnd; ++geom )
60  {
61  if( *geom == 0 ) continue;
62  DetTypeContainer detTypes(( *geom )->detTypes());
63  if( detTypes.size() + theDetTypes.size() < theDetTypes.capacity()) theDetTypes.resize( detTypes.size() + theDetTypes.size());
64  for( DetTypeContainer::const_iterator detType = detTypes.begin(), detTypeEnd = detTypes.end(); detType != detTypeEnd; ++detType )
65  theDetTypes.push_back( *detType );
66  }
67  return theDetTypes;
68 }
std::vector< const TrackingGeometry * > theGeometries
std::vector< GeomDetType * > DetTypeContainer
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
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.

104 {
105  if( ! theDetUnitIds.empty()) return theDetUnitIds;
106  for( std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(), geomEnd = theGeometries.end();
107  geom != geomEnd; ++geom )
108  {
109  if( *geom == 0 ) continue;
110  DetIdContainer detUnitIds(( *geom )->detUnitIds());
111  if( detUnitIds.size() + theDetUnitIds.size() < theDetUnitIds.capacity()) theDetUnitIds.resize( detUnitIds.size() + theDetUnitIds.size());
112  for( DetIdContainer::const_iterator detUnitId = detUnitIds.begin(), detUnitIdEnd = detUnitIds.end(); detUnitId != detUnitIdEnd; ++detUnitId )
113  theDetUnitIds.push_back( *detUnitId );
114  }
115  return theDetUnitIds;
116 }
std::vector< const TrackingGeometry * > theGeometries
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
std::vector< DetId > DetIdContainer
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.

72 {
73  if( ! theDetUnits.empty()) return theDetUnits;
74  for( std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin(), geomEnd = theGeometries.end();
75  geom != geomEnd; ++geom )
76  {
77  if( *geom == 0 ) continue;
78  DetUnitContainer detUnits(( *geom )->detUnits());
79  if( detUnits.size() + theDetUnits.size() < theDetUnits.capacity()) theDetUnits.resize( detUnits.size() + theDetUnits.size());
80  for( DetUnitContainer::const_iterator detUnit = detUnits.begin(), detUnitEnd = detUnits.end(); detUnit != detUnitEnd; ++detUnit )
81  theDetUnits.push_back( *detUnit );
82  }
83  return theDetUnits;
84 }
std::vector< const TrackingGeometry * > theGeometries
std::vector< GeomDetUnit * > DetUnitContainer
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
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 CSCTimingExtractor::fillTiming(), DTTimingExtractor::fillTiming(), MuonDetIdAssociator::getDetIdPoints(), MuonDetIdAssociator::getGeomDet(), and MuonDetIdAssociator::insideElement().

30  {
31 
32  const TrackingGeometry* tg = slaveGeometry(id);
33 
34  if (tg != 0) {
35  return tg->idToDet(id);
36  } else {
37  return 0;
38  }
39 }
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
virtual const GeomDet * idToDet(DetId) const =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().

18  {
19 
20  const TrackingGeometry* tg = slaveGeometry(id);
21 
22  if (tg != 0) {
23  return tg->idToDetUnit(id);
24  } else {
25  return 0;
26  }
27 }
virtual const GeomDetUnit * idToDetUnit(DetId) const =0
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.
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 edm::hlt::Exception, customizeTrackingMonitorSeedNumber::idx, DetId::Muon, and theGeometries.

Referenced by MuonDetIdAssociator::getValidDetIds(), idToDet(), and idToDetUnit().

41  {
42 
43  int idx = id.det()-1;
44  if (id.det() == DetId::Muon) {
45 
46  idx+=id.subdetId()-1;
47  }
48 
49  if (theGeometries[idx]==0) throw cms::Exception("NoGeometry") << "No Tracking Geometry is available for DetId " << id.rawId() << std::endl;
50 
51  return theGeometries[idx];
52 }
std::vector< const TrackingGeometry * > theGeometries
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...

Member Data Documentation

DetIdContainer GlobalTrackingGeometry::theDetIds
mutableprivate

Definition at line 66 of file GlobalTrackingGeometry.h.

Referenced by detIds().

DetContainer GlobalTrackingGeometry::theDets
mutableprivate

Definition at line 64 of file GlobalTrackingGeometry.h.

Referenced by dets().

DetTypeContainer GlobalTrackingGeometry::theDetTypes
mutableprivate

Definition at line 62 of file GlobalTrackingGeometry.h.

Referenced by detTypes().

DetIdContainer GlobalTrackingGeometry::theDetUnitIds
mutableprivate

Definition at line 65 of file GlobalTrackingGeometry.h.

Referenced by detUnitIds().

DetUnitContainer GlobalTrackingGeometry::theDetUnits
mutableprivate

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