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

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

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

Destructor.

Definition at line 16 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 118 of file GlobalTrackingGeometry.cc.

References relativeConstraints::geom, query::result, and theGeometries.

118  {
119 
120  static DetIdContainer result;
121  if ( ! result.empty() ) return result;
122  for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin();
123  geom != theGeometries.end(); geom++)
124  {
125  if (*geom == 0) continue;
126  DetIdContainer detIds((*geom)->detIds());
127  if ( detIds.size()+result.size()<result.capacity() ) result.resize(detIds.size()+result.size());
128  for( DetIdContainer::const_iterator detId = detIds.begin(); detId!=detIds.end(); detId++)
129  result.push_back(*detId);
130  }
131  return result;
132 }
std::vector< const TrackingGeometry * > theGeometries
tuple result
Definition: query.py:137
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 86 of file GlobalTrackingGeometry.cc.

References relativeConstraints::geom, query::result, and theGeometries.

86  {
87 
88  static DetContainer result;
89  if ( ! result.empty() ) return result;
90  for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin();
91  geom != theGeometries.end(); geom++)
92  {
93  if (*geom == 0) continue;
94  DetContainer dets((*geom)->dets());
95  if ( dets.size()+result.size()<result.capacity() ) result.resize(dets.size()+result.size());
96  for( DetContainer::const_iterator det = dets.begin(); det!=dets.end(); det++)
97  result.push_back(*det);
98  }
99  return result;
100 }
std::vector< const TrackingGeometry * > theGeometries
std::vector< GeomDet * > DetContainer
tuple result
Definition: query.py:137
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 54 of file GlobalTrackingGeometry.cc.

References relativeConstraints::geom, query::result, and theGeometries.

54  {
55 
56  static DetTypeContainer result;
57  if ( ! result.empty() ) return result;
58  for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin();
59  geom != theGeometries.end(); geom++)
60  {
61  if (*geom == 0) continue;
62  DetTypeContainer detTypes((*geom)->detTypes());
63  if ( detTypes.size()+result.size()<result.capacity() ) result.resize(detTypes.size()+result.size());
64  for( DetTypeContainer::const_iterator detType = detTypes.begin(); detType!=detTypes.end(); detType++)
65  result.push_back(*detType);
66  }
67  return result;
68 }
std::vector< const TrackingGeometry * > theGeometries
tuple result
Definition: query.py:137
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 102 of file GlobalTrackingGeometry.cc.

References relativeConstraints::geom, query::result, and theGeometries.

102  {
103 
104  static DetIdContainer result;
105  if ( ! result.empty() ) return result;
106  for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin();
107  geom != theGeometries.end(); geom++)
108  {
109  if (*geom == 0) continue;
110  DetIdContainer detUnitIds((*geom)->detUnitIds());
111  if ( detUnitIds.size()+result.size()<result.capacity() ) result.resize(detUnitIds.size()+result.size());
112  for( DetIdContainer::const_iterator detUnitId = detUnitIds.begin(); detUnitId!=detUnitIds.end(); detUnitId++)
113  result.push_back(*detUnitId);
114  }
115  return result;
116 }
std::vector< const TrackingGeometry * > theGeometries
tuple result
Definition: query.py:137
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 70 of file GlobalTrackingGeometry.cc.

References relativeConstraints::geom, query::result, and theGeometries.

70  {
71 
72  static DetUnitContainer result;
73  if ( ! result.empty() ) return result;
74  for(std::vector<const TrackingGeometry*>::const_iterator geom = theGeometries.begin();
75  geom != theGeometries.end(); geom++)
76  {
77  if (*geom == 0) continue;
78  DetUnitContainer detUnits((*geom)->detUnits());
79  if ( detUnits.size()+result.size()<result.capacity() ) result.resize(detUnits.size()+result.size());
80  for( DetUnitContainer::const_iterator detUnit = detUnits.begin(); detUnit!=detUnits.end(); detUnit++)
81  result.push_back(*detUnit);
82  }
83  return result;
84 }
std::vector< const TrackingGeometry * > theGeometries
std::vector< GeomDetUnit * > DetUnitContainer
tuple result
Definition: query.py:137
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, 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

Member Data Documentation

std::vector<const TrackingGeometry*> GlobalTrackingGeometry::theGeometries
private

Definition at line 56 of file GlobalTrackingGeometry.h.

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