CMS 3D CMS Logo

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

#include <GEMGeometry.h>

Inheritance diagram for GEMGeometry:
TrackingGeometry

Public Member Functions

void add (const GEMRegion *region)
 Add a GEMRegion to the Geometry. More...
 
void add (const GEMStation *station)
 Add a GEMStation to the Geometry. More...
 
void add (const GEMRing *ring)
 Add a GEMRing to the Geometry. More...
 
void add (const GEMSuperChamber *sch)
 Add a GEMSuperChamber to the Geometry. More...
 
void add (const GEMChamber *ch)
 Add a GEMChamber to the Geometry. More...
 
void add (const 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...
 
const DetIdContainerdetIds () const override
 Returm a vector of all GeomDet DetIds (including those of GeomDetUnits) More...
 
const DetContainerdets () const override
 Returm a vector of all GeomDet (including all GeomDetUnits) More...
 
const DetTypeContainerdetTypes () const override
 Return a vector of all det types. More...
 
const DetIdContainerdetUnitIds () const override
 Returm a vector of all GeomDetUnit DetIds. More...
 
const DetContainerdetUnits () const override
 Returm a vector of all GeomDet. 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...
 
bool hasGE11 () const
 
bool hasGE21 () const
 
bool hasME0 () const
 
const GeomDetidToDet (DetId) const override
 
const GeomDetidToDetUnit (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...
 
 ~GEMGeometry () override
 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
 
DetContainer theEtaPartitions
 
DetTypeContainer theEtaPartitionTypes
 
mapIdToDet theMap
 

Friends

class GEMGeometryBuilder
 
class GeometryAligner
 

Additional Inherited Members

- Public Types inherited from TrackingGeometry
using DetContainer = std::vector< const GeomDet * >
 
using DetIdContainer = std::vector< DetId >
 
using DetTypeContainer = std::vector< const GeomDetType * >
 
using mapIdToDet = std::unordered_map< unsigned int, const GeomDet * >
 
using mapIdToDetUnit = std::unordered_map< unsigned int, const GeomDet * >
 

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

Destructor.

Definition at line 11 of file GEMGeometry.cc.

11 {}

Member Function Documentation

void GEMGeometry::add ( const GEMRegion region)

Add a GEMRegion to the Geometry.

Definition at line 81 of file GEMGeometry.cc.

References allRegions.

Referenced by GEMGeometryBuilderFromCondDB::build(), GEMGeometryBuilder::build(), GEMGeometryBuilder::buildRegions(), and counter.Counter::register().

81 { allRegions.emplace_back(region); }
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:131
void GEMGeometry::add ( const GEMStation station)

Add a GEMStation to the Geometry.

Definition at line 83 of file GEMGeometry.cc.

References allStations.

Referenced by counter.Counter::register().

83 { allStations.emplace_back(station); }
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:130
void GEMGeometry::add ( const GEMRing ring)

Add a GEMRing to the Geometry.

Definition at line 85 of file GEMGeometry.cc.

References allRings.

Referenced by counter.Counter::register().

85 { allRings.emplace_back(ring); }
std::vector< const GEMRing * > allRings
Definition: GEMGeometry.h:129
void GEMGeometry::add ( const GEMSuperChamber sch)

Add a GEMSuperChamber to the Geometry.

Definition at line 87 of file GEMGeometry.cc.

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

Referenced by counter.Counter::register().

87  {
88  allSuperChambers.emplace_back(superChamber);
89  theDets.emplace_back(superChamber);
90  theDetIds.emplace_back(superChamber->geographicalId());
91  theMap.insert(std::make_pair((superChamber->geographicalId()).rawId(), superChamber));
92 }
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:128
DetIdContainer theDetIds
Definition: GEMGeometry.h:121
mapIdToDet theMap
Definition: GEMGeometry.h:124
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:69
DetContainer theDets
Definition: GEMGeometry.h:118
void GEMGeometry::add ( const GEMChamber ch)

Add a GEMChamber to the Geometry.

Definition at line 104 of file GEMGeometry.cc.

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

Referenced by counter.Counter::register().

104  {
105  allChambers.emplace_back(chamber);
106  theDets.emplace_back(chamber);
107  theDetIds.emplace_back(chamber->geographicalId());
108  theMap.insert(std::make_pair((chamber->geographicalId()).rawId(), chamber));
109 }
DetIdContainer theDetIds
Definition: GEMGeometry.h:121
mapIdToDet theMap
Definition: GEMGeometry.h:124
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
DetContainer theDets
Definition: GEMGeometry.h:118
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:73
std::vector< const GEMChamber * > allChambers
Definition: GEMGeometry.h:127
void GEMGeometry::add ( const GEMEtaPartition etaPartition)

Add a GEMEtaPartition to the Geometry.

Definition at line 94 of file GEMGeometry.cc.

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

Referenced by counter.Counter::register().

94  {
95  theDets.emplace_back(etaPartition);
96  allEtaPartitions.emplace_back(etaPartition);
97  theEtaPartitions.emplace_back(etaPartition);
98  theEtaPartitionIds.emplace_back(etaPartition->geographicalId());
99  theDetIds.emplace_back(etaPartition->geographicalId());
100  theEtaPartitionTypes.emplace_back(&etaPartition->type());
101  theMap.insert(std::make_pair((etaPartition->geographicalId()).rawId(), etaPartition));
102 }
std::vector< const GEMEtaPartition * > allEtaPartitions
Definition: GEMGeometry.h:126
DetContainer theEtaPartitions
Definition: GEMGeometry.h:117
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:120
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:77
DetIdContainer theDetIds
Definition: GEMGeometry.h:121
mapIdToDet theMap
Definition: GEMGeometry.h:124
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const GeomDetType & type() const override
DetContainer theDets
Definition: GEMGeometry.h:118
DetTypeContainer theEtaPartitionTypes
Definition: GEMGeometry.h:119
const GEMChamber * GEMGeometry::chamber ( GEMDetId  id) const

Definition at line 73 of file GEMGeometry.cc.

References idToDet().

Referenced by add(), GEMPadDigiProducer::beginRun(), GEMGeometryBuilder::buildRegions(), GEMPadDigiProducer::checkGeometry(), and geometryXMLparser.CSCAlignable::index().

73  {
74  return dynamic_cast<const GEMChamber*>(idToDet(id.chamberId()));
75 }
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:25
const std::vector< const GEMChamber * > & GEMGeometry::chambers ( ) const

Return a vector of all GEM chambers.

Definition at line 38 of file GEMGeometry.cc.

References allChambers.

Referenced by FWRecoGeometryESProducer::addGEMGeometry(), GEMPadDigiClusterProducer::selectClusters(), GEMPadDigiClusterProducer::sortClusters(), and GEMGeometryValidate::validateGEMChamberGeometry().

38 { return allChambers; }
std::vector< const GEMChamber * > allChambers
Definition: GEMGeometry.h:127
const GEMGeometry::DetIdContainer & GEMGeometry::detIds ( ) const
overridevirtual

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

Implements TrackingGeometry.

Definition at line 21 of file GEMGeometry.cc.

References theDetIds.

21 { return theDetIds; }
DetIdContainer theDetIds
Definition: GEMGeometry.h:121
const GEMGeometry::DetContainer & GEMGeometry::dets ( ) const
overridevirtual

Returm a vector of all GeomDet (including all GeomDetUnits)

Implements TrackingGeometry.

Definition at line 17 of file GEMGeometry.cc.

References theDets.

Referenced by GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex().

17 { return theDets; }
DetContainer theDets
Definition: GEMGeometry.h:118
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 { return theEtaPartitionTypes; }
DetTypeContainer theEtaPartitionTypes
Definition: GEMGeometry.h:119
const GEMGeometry::DetIdContainer & GEMGeometry::detUnitIds ( ) const
overridevirtual

Returm a vector of all GeomDetUnit DetIds.

Implements TrackingGeometry.

Definition at line 19 of file GEMGeometry.cc.

References theEtaPartitionIds.

19 { return theEtaPartitionIds; }
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:120
const GEMGeometry::DetContainer & GEMGeometry::detUnits ( ) const
overridevirtual

Returm a vector of all GeomDet.

Implements TrackingGeometry.

Definition at line 15 of file GEMGeometry.cc.

References theEtaPartitions.

15 { return theEtaPartitions; }
DetContainer theEtaPartitions
Definition: GEMGeometry.h:117
const GEMEtaPartition * GEMGeometry::etaPartition ( GEMDetId  id) const

Return a GEMEtaPartition given its id.

Definition at line 77 of file GEMGeometry.cc.

References idToDetUnit().

Referenced by add(), GEMStripDigiValidation::analyze(), GEMPadDigiClusterValidation::analyze(), GEMPadDigiValidation::analyze(), GEMSegmentBuilder::build(), GEMCSCSegmentBuilder::build(), and GEMSignalModel::getSimHitBx().

77  {
78  return dynamic_cast<const GEMEtaPartition*>(idToDetUnit(id));
79 }
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: GEMGeometry.cc:23
const std::vector< const GEMEtaPartition * > & GEMGeometry::etaPartitions ( ) const
bool GEMGeometry::hasGE11 ( ) const

Definition at line 113 of file GEMGeometry.cc.

References station().

Referenced by GEMPadDigiProducer::checkGeometry().

113 { return station(1, 1) != nullptr and station(-1, 1) != nullptr; }
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:51
bool GEMGeometry::hasGE21 ( ) const

Definition at line 115 of file GEMGeometry.cc.

References station().

Referenced by GEMPadDigiProducer::beginRun(), and GEMPadDigiProducer::checkGeometry().

115 { return station(1, 2) != nullptr and station(-1, 2) != nullptr; }
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:51
bool GEMGeometry::hasME0 ( ) const

Definition at line 111 of file GEMGeometry.cc.

References station().

Referenced by GEMPadDigiProducer::checkGeometry().

111 { return station(1, 0) != nullptr and station(-1, 0) != nullptr; }
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:51
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 25 of file GEMGeometry.cc.

References mps_fire::i, and theMap.

Referenced by GEMCoPadDigiValidation::analyze(), GEMPadDigiValidation::analyze(), GEMStripDigiValidation::analyze(), GEMPadDigiClusterValidation::analyze(), GEMRecHitValidation::analyze(), GEMSimHitValidation::analyze(), GEMRecHitSource::analyze(), GEMDigiSource::analyze(), chamber(), idToDetUnit(), and superChamber().

25  {
26  mapIdToDet::const_iterator i = theMap.find(GEMDetId(id).rawId());
27  return (i != theMap.end()) ? i->second : nullptr;
28 }
mapIdToDet theMap
Definition: GEMGeometry.h:124
const GeomDet * GEMGeometry::idToDetUnit ( DetId  ) const
overridevirtual

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

Implements TrackingGeometry.

Definition at line 23 of file GEMGeometry.cc.

References idToDet().

Referenced by etaPartition().

23 { return dynamic_cast<const GeomDet*>(idToDet(id)); }
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:25
const GEMRegion * GEMGeometry::region ( int  region) const

Definition at line 42 of file GEMGeometry.cc.

References allRegions, and GEMRegion::region().

42  {
43  for (auto region : allRegions) {
44  if (re != region->region())
45  continue;
46  return region;
47  }
48  return nullptr;
49 }
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:131
const GEMRegion * region(int region) const
Definition: GEMGeometry.cc:42
int region() const
Return the region.
Definition: GEMRegion.cc:64
const std::vector< const GEMRegion * > & GEMGeometry::regions ( ) const
const GEMRing * GEMGeometry::ring ( int  region,
int  station,
int  ring 
) const

Return a GEMRing.

Definition at line 60 of file GEMGeometry.cc.

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

Referenced by geometryXMLparser.CSCAlignable::index().

60  {
61  for (auto ring : allRings) {
62  if (re != ring->region() || st != ring->station() || ri != ring->ring())
63  continue;
64  return ring;
65  }
66  return nullptr;
67 }
int region() const
Return the region number.
Definition: GEMRing.cc:46
int station() const
Return the station number.
Definition: GEMRing.cc:48
const GEMRing * ring(int region, int station, int ring) const
Return a GEMRing.
Definition: GEMGeometry.cc:60
std::vector< const GEMRing * > allRings
Definition: GEMGeometry.h:129
int ring() const
Return the ring number.
Definition: GEMRing.cc:50
const std::vector< const GEMRing * > & GEMGeometry::rings ( ) const

Return a vector of all GEM rings.

Definition at line 34 of file GEMGeometry.cc.

References allRings.

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

Definition at line 51 of file GEMGeometry.cc.

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

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

51  {
52  for (auto station : allStations) {
53  if (re != station->region() || st != station->station())
54  continue;
55  return station;
56  }
57  return nullptr;
58 }
int region() const
Get the region.
Definition: GEMStation.cc:70
int station() const
Get the station.
Definition: GEMStation.cc:72
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:130
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:51
const std::vector< const GEMStation * > & GEMGeometry::stations ( ) const

Return a vector of all GEM stations.

Definition at line 32 of file GEMGeometry.cc.

References allStations.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers().

32 { return allStations; }
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:130
const GEMSuperChamber * GEMGeometry::superChamber ( GEMDetId  id) const

Definition at line 69 of file GEMGeometry.cc.

References idToDet().

Referenced by add(), GEMCoPadDigiValidation::analyze(), and GEMSegmentBuilder::build().

69  {
70  return dynamic_cast<const GEMSuperChamber*>(idToDet(id.superChamberId()));
71 }
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:25
const std::vector< const GEMSuperChamber * > & GEMGeometry::superChambers ( ) const

Return a vector of all GEM super chambers.

Definition at line 36 of file GEMGeometry.cc.

References allSuperChambers.

Referenced by FWRecoGeometryESProducer::addGEMGeometry(), FWTGeoRecoGeometryESProducer::addGEMGeometry(), AlignableMuon::buildGEMEndcap(), and GEMDQMBase::loadChambers().

36 { return allSuperChambers; }
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:128

Friends And Related Function Documentation

friend class GEMGeometryBuilder
friend

Definition at line 32 of file GEMGeometry.h.

friend class GeometryAligner
friend

Definition at line 33 of file GEMGeometry.h.

Member Data Documentation

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

Definition at line 127 of file GEMGeometry.h.

Referenced by add(), and chambers().

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

Definition at line 126 of file GEMGeometry.h.

Referenced by add(), and etaPartitions().

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

Definition at line 131 of file GEMGeometry.h.

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

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

Definition at line 129 of file GEMGeometry.h.

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

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

Definition at line 130 of file GEMGeometry.h.

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

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

Definition at line 128 of file GEMGeometry.h.

Referenced by add(), and superChambers().

DetIdContainer GEMGeometry::theDetIds
private

Definition at line 121 of file GEMGeometry.h.

Referenced by add(), and detIds().

DetContainer GEMGeometry::theDets
private

Definition at line 118 of file GEMGeometry.h.

Referenced by add(), and dets().

DetIdContainer GEMGeometry::theEtaPartitionIds
private

Definition at line 120 of file GEMGeometry.h.

Referenced by add(), and detUnitIds().

DetContainer GEMGeometry::theEtaPartitions
private

Definition at line 117 of file GEMGeometry.h.

Referenced by add(), and detUnits().

DetTypeContainer GEMGeometry::theEtaPartitionTypes
private

Definition at line 119 of file GEMGeometry.h.

Referenced by add(), and detTypes().

mapIdToDet GEMGeometry::theMap
private

Definition at line 124 of file GEMGeometry.h.

Referenced by add(), and idToDet().