CMS 3D CMS Logo

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::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::~GEMGeometry ( )
override

Destructor.

Definition at line 11 of file GEMGeometry.cc.

11 {}

Member Function Documentation

◆ add() [1/6]

void GEMGeometry::add ( const GEMRegion region)

Add a GEMRegion to the Geometry.

Definition at line 81 of file GEMGeometry.cc.

References allRegions, and region().

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
const GEMRegion * region(int region) const
Definition: GEMGeometry.cc:42

◆ add() [2/6]

void GEMGeometry::add ( const GEMStation station)

Add a GEMStation to the Geometry.

Definition at line 83 of file GEMGeometry.cc.

References allStations, and station().

Referenced by counter.Counter::register().

83 { allStations.emplace_back(station); }
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:130
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:51

◆ add() [3/6]

void GEMGeometry::add ( const GEMRing ring)

Add a GEMRing to the Geometry.

Definition at line 85 of file GEMGeometry.cc.

References allRings, and ring().

Referenced by counter.Counter::register().

85 { allRings.emplace_back(ring); }
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

◆ add() [4/6]

void GEMGeometry::add ( const GEMSuperChamber sch)

Add a GEMSuperChamber to the Geometry.

Definition at line 87 of file GEMGeometry.cc.

References allSuperChambers, GeomDet::geographicalId(), nano_mu_digi_cff::rawId, 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
DetContainer theDets
Definition: GEMGeometry.h:118
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:69

◆ add() [5/6]

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(), nano_mu_digi_cff::rawId, 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
std::vector< const GEMChamber * > allChambers
Definition: GEMGeometry.h:127
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:73

◆ add() [6/6]

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(), nano_mu_digi_cff::rawId, 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);
99  theDetIds.emplace_back(etaPartition->geographicalId());
100  theEtaPartitionTypes.emplace_back(&etaPartition->type());
101  theMap.insert(std::make_pair((etaPartition->geographicalId()).rawId(), etaPartition));
102 }
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:77
std::vector< const GEMEtaPartition * > allEtaPartitions
Definition: GEMGeometry.h:126
DetContainer theEtaPartitions
Definition: GEMGeometry.h:117
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:120
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

◆ chamber()

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

◆ chambers()

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(), and GEMGeometryValidate::validateGEMChamberGeometry().

38 { return allChambers; }
std::vector< const GEMChamber * > allChambers
Definition: GEMGeometry.h:127

◆ detIds()

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

◆ dets()

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

◆ detTypes()

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

◆ detUnitIds()

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

◆ detUnits()

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

◆ etaPartition()

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(), GEMSegmentBuilder::build(), GEMCSCSegmentBuilder::build(), L1TMuon::GeometryTranslator::getGEMSpecificPoint(), GEMSignalModel::getSimHitBx(), and GEMRecHitProducer::produce().

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

◆ etaPartitions()

const std::vector< const GEMEtaPartition * > & GEMGeometry::etaPartitions ( ) const

◆ hasGE11()

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

◆ hasGE21()

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

◆ hasME0()

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

◆ idToDet()

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, nano_mu_digi_cff::rawId, and theMap.

Referenced by 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

◆ idToDetUnit()

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

◆ region()

const GEMRegion * GEMGeometry::region ( int  region) const

Definition at line 42 of file GEMGeometry.cc.

References allRegions, and GEMRegion::region().

Referenced by add().

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
int region() const
Return the region.
Definition: GEMRegion.cc:64
const GEMRegion * region(int region) const
Definition: GEMGeometry.cc:42

◆ regions()

const std::vector< const GEMRegion * > & GEMGeometry::regions ( ) const

Return a vector of all GEM regions.

Definition at line 30 of file GEMGeometry.cc.

References allRegions.

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

30 { return allRegions; }
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:131

◆ ring()

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 add(), and 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
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 station() const
Return the station number.
Definition: GEMRing.cc:48
int ring() const
Return the ring number.
Definition: GEMRing.cc:50

◆ rings()

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

◆ station()

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 add(), 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
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:130
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:51
int station() const
Get the station.
Definition: GEMStation.cc:72

◆ stations()

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(), and AlignableMuon::buildGEMEndcap().

32 { return allStations; }
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:130

◆ superChamber()

const GEMSuperChamber * GEMGeometry::superChamber ( GEMDetId  id) const

Definition at line 69 of file GEMGeometry.cc.

References idToDet().

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

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

◆ superChambers()

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(), and AlignableMuon::buildGEMEndcap().

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

Friends And Related Function Documentation

◆ GEMGeometryBuilder

friend class GEMGeometryBuilder
friend

Definition at line 32 of file GEMGeometry.h.

◆ GeometryAligner

friend class GeometryAligner
friend

Definition at line 33 of file GEMGeometry.h.

Member Data Documentation

◆ allChambers

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

Definition at line 127 of file GEMGeometry.h.

Referenced by add(), and chambers().

◆ allEtaPartitions

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

Definition at line 126 of file GEMGeometry.h.

Referenced by add(), and etaPartitions().

◆ allRegions

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

Definition at line 131 of file GEMGeometry.h.

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

◆ allRings

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

Definition at line 129 of file GEMGeometry.h.

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

◆ allStations

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

Definition at line 130 of file GEMGeometry.h.

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

◆ allSuperChambers

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

Definition at line 128 of file GEMGeometry.h.

Referenced by add(), and superChambers().

◆ theDetIds

DetIdContainer GEMGeometry::theDetIds
private

Definition at line 121 of file GEMGeometry.h.

Referenced by add(), and detIds().

◆ theDets

DetContainer GEMGeometry::theDets
private

Definition at line 118 of file GEMGeometry.h.

Referenced by add(), and dets().

◆ theEtaPartitionIds

DetIdContainer GEMGeometry::theEtaPartitionIds
private

Definition at line 120 of file GEMGeometry.h.

Referenced by add(), and detUnitIds().

◆ theEtaPartitions

DetContainer GEMGeometry::theEtaPartitions
private

Definition at line 117 of file GEMGeometry.h.

Referenced by add(), and detUnits().

◆ theEtaPartitionTypes

DetTypeContainer GEMGeometry::theEtaPartitionTypes
private

Definition at line 119 of file GEMGeometry.h.

Referenced by add(), and detTypes().

◆ theMap

mapIdToDet GEMGeometry::theMap
private

Definition at line 124 of file GEMGeometry.h.

Referenced by add(), and idToDet().