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
GEMGeometry Class Reference

#include <GEMGeometry.h>

Inheritance diagram for GEMGeometry:
TrackingGeometry

Public Member Functions

void add (GEMRegion *region)
 Add a GEMRegion to the Geometry. More...
 
void add (GEMStation *station)
 Add a GEMStation to the Geometry. More...
 
void add (GEMRing *ring)
 Add a GEMRing to the Geometry. More...
 
void add (GEMSuperChamber *sch)
 Add a GEMSuperChamber to the Geometry. More...
 
void add (GEMChamber *ch)
 Add a GEMChamber to the Geometry. More...
 
void add (GEMEtaPartition *etaPartition)
 Add a GEMEtaPartition to the Geometry. More...
 
const GEMChamberchamber (GEMDetId id) const
 
const std::vector< const
GEMChamber * > & 
chambers () const
 Return a vector of all GEM chambers. More...
 
virtual const DetIdContainerdetIds () const override
 Returm a vector of all GeomDet DetIds (including those of GeomDetUnits) More...
 
virtual const DetContainerdets () const override
 Returm a vector of all GeomDet (including all GeomDetUnits) More...
 
virtual const DetTypeContainerdetTypes () const override
 Return a vector of all det types. More...
 
virtual const DetIdContainerdetUnitIds () const override
 Returm a vector of all GeomDetUnit DetIds. More...
 
virtual const DetUnitContainerdetUnits () const override
 Returm a vector of all GeomDetUnit. More...
 
const GEMEtaPartitionetaPartition (GEMDetId id) const
 Return a GEMEtaPartition given its id. More...
 
const std::vector< const
GEMEtaPartition * > & 
etaPartitions () const
 Return a vector of all GEM eta partitions. More...
 
 GEMGeometry ()
 Default constructor. More...
 
virtual const GeomDetidToDet (DetId) const override
 
virtual const GeomDetUnitidToDetUnit (DetId) const override
 Return the pointer to the GeomDetUnit corresponding to a given DetId. More...
 
const GEMRegionregion (int region) const
 
const std::vector< const
GEMRegion * > & 
regions () const
 Return a vector of all GEM regions. More...
 
const GEMRingring (int region, int station, int ring) const
 Return a GEMRing. More...
 
const std::vector< const
GEMRing * > & 
rings () const
 Return a vector of all GEM rings. More...
 
const GEMStationstation (int region, int station) const
 
const std::vector< const
GEMStation * > & 
stations () const
 Return a vector of all GEM stations. More...
 
const GEMSuperChambersuperChamber (GEMDetId id) const
 
const std::vector< const
GEMSuperChamber * > & 
superChambers () const
 Return a vector of all GEM super chambers. More...
 
virtual ~GEMGeometry ()
 Destructor. More...
 
- Public Member Functions inherited from TrackingGeometry
virtual ~TrackingGeometry ()
 Destructor. More...
 

Private Attributes

std::vector< const GEMChamber * > allChambers
 
std::vector< const
GEMEtaPartition * > 
allEtaPartitions
 
std::vector< const GEMRegion * > allRegions
 
std::vector< const GEMRing * > allRings
 
std::vector< const GEMStation * > allStations
 
std::vector< const
GEMSuperChamber * > 
allSuperChambers
 
DetIdContainer theDetIds
 
DetContainer theDets
 
DetIdContainer theEtaPartitionIds
 
DetUnitContainer theEtaPartitions
 
DetTypeContainer theEtaPartitionTypes
 
mapIdToDet theMap
 

Additional Inherited Members

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

Detailed Description

The model of the geometry of GEM.

Author
M. Maggi - INFN Bari

Definition at line 24 of file GEMGeometry.h.

Constructor & Destructor Documentation

GEMGeometry::GEMGeometry ( )

Default constructor.

Implementation of the Model for GEM Geometry

Author
M. Maggi - INFN Bari

Definition at line 9 of file GEMGeometry.cc.

9 {}
GEMGeometry::~GEMGeometry ( )
virtual

Destructor.

Definition at line 11 of file GEMGeometry.cc.

11 {}

Member Function Documentation

void GEMGeometry::add ( GEMRegion region)

Add a GEMRegion to the Geometry.

Definition at line 108 of file GEMGeometry.cc.

References allRegions.

Referenced by GEMGeometryBuilderFromDDD::buildGeometry(), and counter.Counter::register().

108  {
109  allRegions.push_back(region);
110 }
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:126
void GEMGeometry::add ( GEMStation station)

Add a GEMStation to the Geometry.

Definition at line 113 of file GEMGeometry.cc.

References allStations.

Referenced by counter.Counter::register().

113  {
114  allStations.push_back(station);
115 }
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:125
void GEMGeometry::add ( GEMRing ring)

Add a GEMRing to the Geometry.

Definition at line 118 of file GEMGeometry.cc.

References allRings.

Referenced by counter.Counter::register().

118  {
119  allRings.push_back(ring);
120 }
std::vector< const GEMRing * > allRings
Definition: GEMGeometry.h:124
void GEMGeometry::add ( GEMSuperChamber sch)

Add a GEMSuperChamber to the Geometry.

Definition at line 123 of file GEMGeometry.cc.

References allSuperChambers, GeomDet::geographicalId(), superChamber(), theDetIds, theDets, and theMap.

Referenced by counter.Counter::register().

123  {
124  allSuperChambers.push_back(superChamber);
125  theDets.push_back(superChamber);
126  theDetIds.push_back(superChamber->geographicalId());
127  theMap.insert(std::pair<DetId,GeomDet*>
129 }
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:123
DetIdContainer theDetIds
Definition: GEMGeometry.h:116
mapIdToDet theMap
Definition: GEMGeometry.h:119
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:91
DetContainer theDets
Definition: GEMGeometry.h:113
void GEMGeometry::add ( GEMChamber ch)

Add a GEMChamber to the Geometry.

Definition at line 144 of file GEMGeometry.cc.

References allChambers, chamber(), GeomDet::geographicalId(), theDetIds, theDets, and theMap.

Referenced by counter.Counter::register().

144  {
145  allChambers.push_back(chamber);
146  theDets.push_back(chamber);
147  theDetIds.push_back(chamber->geographicalId());
148  theMap.insert(std::pair<DetId,GeomDet*>
150 }
DetIdContainer theDetIds
Definition: GEMGeometry.h:116
mapIdToDet theMap
Definition: GEMGeometry.h:119
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
DetContainer theDets
Definition: GEMGeometry.h:113
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:99
std::vector< const GEMChamber * > allChambers
Definition: GEMGeometry.h:122
void GEMGeometry::add ( GEMEtaPartition etaPartition)

Add a GEMEtaPartition to the Geometry.

Definition at line 132 of file GEMGeometry.cc.

References allEtaPartitions, etaPartition(), GeomDet::geographicalId(), theDetIds, theDets, theEtaPartitionIds, theEtaPartitions, theEtaPartitionTypes, theMap, and GEMEtaPartition::type().

Referenced by counter.Counter::register().

132  {
133  theDets.push_back(etaPartition);
134  allEtaPartitions.push_back(etaPartition);
135  theEtaPartitions.push_back(etaPartition);
136  theEtaPartitionIds.push_back(etaPartition->geographicalId());
137  theDetIds.push_back(etaPartition->geographicalId());
138  theEtaPartitionTypes.push_back(&etaPartition->type());
139  theMap.insert(std::pair<DetId,const GeomDetUnit*>
140  (etaPartition->geographicalId(),etaPartition));
141 }
std::vector< const GEMEtaPartition * > allEtaPartitions
Definition: GEMGeometry.h:121
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:115
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:103
DetIdContainer theDetIds
Definition: GEMGeometry.h:116
mapIdToDet theMap
Definition: GEMGeometry.h:119
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
const GeomDetType & type() const
DetContainer theDets
Definition: GEMGeometry.h:113
DetUnitContainer theEtaPartitions
Definition: GEMGeometry.h:112
DetTypeContainer theEtaPartitionTypes
Definition: GEMGeometry.h:114
const GEMChamber * GEMGeometry::chamber ( GEMDetId  id) const

Definition at line 99 of file GEMGeometry.cc.

References idToDet().

Referenced by add(), GEMGeometryBuilderFromDDD::buildGeometry(), CSCMotherboardME21GEM::createGEMRollEtaLUT(), CSCMotherboardME11GEM::createGEMRollEtaLUT(), geometryXMLparser.CSCAlignable::index(), CSCMotherboardME21GEM::run(), and CSCMotherboardME11GEM::run().

99  {
100  return dynamic_cast<const GEMChamber*>(idToDet(id.chamberId()));
101 }
virtual const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:38
const std::vector< const GEMChamber * > & GEMGeometry::chambers ( ) const

Return a vector of all GEM chambers.

Definition at line 59 of file GEMGeometry.cc.

References allChambers.

Referenced by GEMGeometryBuilderFromDDD::buildGeometry().

59  {
60  return allChambers;
61 }
std::vector< const GEMChamber * > allChambers
Definition: GEMGeometry.h:122
const GEMGeometry::DetIdContainer & GEMGeometry::detIds ( ) const
overridevirtual

Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)

Implements TrackingGeometry.

Definition at line 29 of file GEMGeometry.cc.

References theDetIds.

29  {
30  return theDetIds;
31 }
DetIdContainer theDetIds
Definition: GEMGeometry.h:116
const GEMGeometry::DetContainer & GEMGeometry::dets ( ) const
overridevirtual

Returm a vector of all GeomDet (including all GeomDetUnits)

Implements TrackingGeometry.

Definition at line 21 of file GEMGeometry.cc.

References theDets.

Referenced by GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex().

21  {
22  return theDets;
23 }
DetContainer theDets
Definition: GEMGeometry.h:113
const GEMGeometry::DetTypeContainer & GEMGeometry::detTypes ( ) const
overridevirtual

Return a vector of all det types.

Implements TrackingGeometry.

Definition at line 13 of file GEMGeometry.cc.

References theEtaPartitionTypes.

13  {
14  return theEtaPartitionTypes;
15 }
DetTypeContainer theEtaPartitionTypes
Definition: GEMGeometry.h:114
const GEMGeometry::DetIdContainer & GEMGeometry::detUnitIds ( ) const
overridevirtual

Returm a vector of all GeomDetUnit DetIds.

Implements TrackingGeometry.

Definition at line 25 of file GEMGeometry.cc.

References theEtaPartitionIds.

25  {
26  return theEtaPartitionIds;
27 }
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:115
const GEMGeometry::DetUnitContainer & GEMGeometry::detUnits ( ) const
overridevirtual

Returm a vector of all GeomDetUnit.

Implements TrackingGeometry.

Definition at line 17 of file GEMGeometry.cc.

References theEtaPartitions.

17  {
18  return theEtaPartitions;
19 }
DetUnitContainer theEtaPartitions
Definition: GEMGeometry.h:112
const GEMEtaPartition * GEMGeometry::etaPartition ( GEMDetId  id) const

Return a GEMEtaPartition given its id.

Definition at line 103 of file GEMGeometry.cc.

References idToDetUnit().

Referenced by add(), GEMCSCSegmentBuilder::build(), GEMGeometryBuilderFromDDD::buildGeometry(), and GEMSimpleModel::getSimHitBx().

103  {
104  return dynamic_cast<const GEMEtaPartition*>(idToDetUnit(id));
105 }
virtual const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: GEMGeometry.cc:33
const std::vector< const GEMEtaPartition * > & GEMGeometry::etaPartitions ( ) const

Return a vector of all GEM eta partitions.

Definition at line 63 of file GEMGeometry.cc.

References allEtaPartitions.

Referenced by FWRecoGeometryESProducer::addGEMGeometry(), FWTGeoRecoGeometryESProducer::addGEMGeometry(), GEMGeometryBuilderFromDDD::buildGeometry(), GEMPadDigiProducer::buildPads(), and GEMDigiProducer::produce().

63  {
64  return allEtaPartitions;
65 }
std::vector< const GEMEtaPartition * > allEtaPartitions
Definition: GEMGeometry.h:121
const GeomDet * GEMGeometry::idToDet ( DetId  ) const
overridevirtual

Return the pointer to the GeomDet corresponding to a given DetId (valid also for GeomDetUnits)

Implements TrackingGeometry.

Definition at line 38 of file GEMGeometry.cc.

References i, and theMap.

Referenced by chamber(), and idToDetUnit().

38  {
39  mapIdToDet::const_iterator i = theMap.find(id);
40  return (i != theMap.end()) ? i->second : 0;
41 }
int i
Definition: DBlmapReader.cc:9
mapIdToDet theMap
Definition: GEMGeometry.h:119
const GeomDetUnit * GEMGeometry::idToDetUnit ( DetId  ) const
overridevirtual

Return the pointer to the GeomDetUnit corresponding to a given DetId.

Implements TrackingGeometry.

Definition at line 33 of file GEMGeometry.cc.

References idToDet().

Referenced by etaPartition().

33  {
34  return dynamic_cast<const GeomDetUnit*>(idToDet(id));
35 }
virtual const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:38
const GEMRegion * GEMGeometry::region ( int  region) const

Definition at line 67 of file GEMGeometry.cc.

References allRegions, and GEMRegion::region().

67  {
68  for (auto region : allRegions) {
69  if (re != region->region()) continue;
70  return region;
71  }
72  return 0;
73 }
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:126
const GEMRegion * region(int region) const
Definition: GEMGeometry.cc:67
int region() const
Return the region.
Definition: GEMRegion.cc:74
const std::vector< const GEMRegion * > & GEMGeometry::regions ( ) const

Return a vector of all GEM regions.

Definition at line 43 of file GEMGeometry.cc.

References allRegions.

43  {
44  return allRegions;
45 }
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:126
const GEMRing * GEMGeometry::ring ( int  region,
int  station,
int  ring 
) const

Return a GEMRing.

Definition at line 83 of file GEMGeometry.cc.

References allRings, GEMRing::region(), GEMRing::ring(), and GEMRing::station().

Referenced by geometryXMLparser.CSCAlignable::index().

83  {
84  for (auto ring : allRings) {
85  if (re != ring->region() || st != ring->station() || ri != ring->ring()) continue;
86  return ring;
87  }
88  return 0;
89 }
int region() const
Return the region number.
Definition: GEMRing.cc:61
int station() const
Return the station number.
Definition: GEMRing.cc:65
const GEMRing * ring(int region, int station, int ring) const
Return a GEMRing.
Definition: GEMGeometry.cc:83
std::vector< const GEMRing * > allRings
Definition: GEMGeometry.h:124
int ring() const
Return the ring number.
Definition: GEMRing.cc:69
const std::vector< const GEMRing * > & GEMGeometry::rings ( ) const

Return a vector of all GEM rings.

Definition at line 51 of file GEMGeometry.cc.

References allRings.

51  {
52  return allRings;
53 }
std::vector< const GEMRing * > allRings
Definition: GEMGeometry.h:124
const GEMStation * GEMGeometry::station ( int  region,
int  station 
) const

Definition at line 75 of file GEMGeometry.cc.

References allStations, GEMStation::region(), and GEMStation::station().

Referenced by geometryXMLparser.DTAlignable::index(), and geometryXMLparser.CSCAlignable::index().

75  {
76  for (auto station : allStations) {
77  if (re != station->region() || st != station->station()) continue;
78  return station;
79  }
80  return 0;
81 }
int region() const
Get the region.
Definition: GEMStation.cc:83
int station() const
Get the station.
Definition: GEMStation.cc:87
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:125
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:75
const std::vector< const GEMStation * > & GEMGeometry::stations ( ) const

Return a vector of all GEM stations.

Definition at line 47 of file GEMGeometry.cc.

References allStations.

Referenced by CSCMotherboardME21GEM::run().

47  {
48  return allStations;
49 }
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:125
const GEMSuperChamber * GEMGeometry::superChamber ( GEMDetId  id) const

Definition at line 91 of file GEMGeometry.cc.

References allSuperChambers.

Referenced by add(), CSCMotherboardME21GEM::retrieveGEMCoPads(), CSCMotherboardME11GEM::retrieveGEMCoPads(), CSCMotherboardME21GEM::retrieveGEMPads(), and CSCMotherboardME11GEM::retrieveGEMPads().

91  {
92  for (auto sch : allSuperChambers){
93  if (sch->id() != id) continue;
94  return sch;
95  }
96  return 0;
97 }
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:123
const std::vector< const GEMSuperChamber * > & GEMGeometry::superChambers ( ) const

Return a vector of all GEM super chambers.

Definition at line 55 of file GEMGeometry.cc.

References allSuperChambers.

Referenced by GEMGeometryBuilderFromDDD::buildGeometry().

55  {
56  return allSuperChambers;
57 }
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:123

Member Data Documentation

std::vector<const GEMChamber*> GEMGeometry::allChambers
private

Definition at line 122 of file GEMGeometry.h.

Referenced by add(), and chambers().

std::vector<const GEMEtaPartition*> GEMGeometry::allEtaPartitions
private

Definition at line 121 of file GEMGeometry.h.

Referenced by add(), and etaPartitions().

std::vector<const GEMRegion*> GEMGeometry::allRegions
private

Definition at line 126 of file GEMGeometry.h.

Referenced by add(), region(), and regions().

std::vector<const GEMRing*> GEMGeometry::allRings
private

Definition at line 124 of file GEMGeometry.h.

Referenced by add(), ring(), and rings().

std::vector<const GEMStation*> GEMGeometry::allStations
private

Definition at line 125 of file GEMGeometry.h.

Referenced by add(), station(), and stations().

std::vector<const GEMSuperChamber*> GEMGeometry::allSuperChambers
private

Definition at line 123 of file GEMGeometry.h.

Referenced by add(), superChamber(), and superChambers().

DetIdContainer GEMGeometry::theDetIds
private

Definition at line 116 of file GEMGeometry.h.

Referenced by add(), and detIds().

DetContainer GEMGeometry::theDets
private

Definition at line 113 of file GEMGeometry.h.

Referenced by add(), and dets().

DetIdContainer GEMGeometry::theEtaPartitionIds
private

Definition at line 115 of file GEMGeometry.h.

Referenced by add(), and detUnitIds().

DetUnitContainer GEMGeometry::theEtaPartitions
private

Definition at line 112 of file GEMGeometry.h.

Referenced by add(), and detUnits().

DetTypeContainer GEMGeometry::theEtaPartitionTypes
private

Definition at line 114 of file GEMGeometry.h.

Referenced by add(), and detTypes().

mapIdToDet GEMGeometry::theMap
private

Definition at line 119 of file GEMGeometry.h.

Referenced by add(), and idToDet().