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 GEMChamber *ch)
 Add a GEMChamber to the Geometry. More...
 
void add (const GEMEtaPartition *etaPartition)
 Add a GEMEtaPartition to the Geometry. More...
 
void add (const GEMRegion *region)
 Add a GEMRegion to the Geometry. More...
 
void add (const GEMRing *ring)
 Add a GEMRing to the Geometry. More...
 
void add (const GEMStation *station)
 Add a GEMStation to the Geometry. More...
 
void add (const GEMSuperChamber *sch)
 Add a GEMSuperChamber 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...
 
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 GEMChamber ch)

Add a GEMChamber to the Geometry.

Definition at line 104 of file GEMGeometry.cc.

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 }

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

Referenced by counter.Counter::register().

◆ add() [2/6]

void GEMGeometry::add ( const GEMEtaPartition etaPartition)

Add a GEMEtaPartition to the Geometry.

Definition at line 94 of file GEMGeometry.cc.

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 }

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

Referenced by counter.Counter::register().

◆ add() [3/6]

void GEMGeometry::add ( const GEMRegion region)

Add a GEMRegion to the Geometry.

Definition at line 81 of file GEMGeometry.cc.

81 { allRegions.emplace_back(region); }

References allRegions, and region().

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

◆ add() [4/6]

void GEMGeometry::add ( const GEMRing ring)

Add a GEMRing to the Geometry.

Definition at line 85 of file GEMGeometry.cc.

85 { allRings.emplace_back(ring); }

References allRings, and ring().

Referenced by counter.Counter::register().

◆ add() [5/6]

void GEMGeometry::add ( const GEMStation station)

Add a GEMStation to the Geometry.

Definition at line 83 of file GEMGeometry.cc.

83 { allStations.emplace_back(station); }

References allStations, and station().

Referenced by counter.Counter::register().

◆ add() [6/6]

void GEMGeometry::add ( const GEMSuperChamber sch)

Add a GEMSuperChamber to the Geometry.

Definition at line 87 of file GEMGeometry.cc.

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 }

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

Referenced by counter.Counter::register().

◆ chamber()

const GEMChamber * GEMGeometry::chamber ( GEMDetId  id) const

Definition at line 73 of file GEMGeometry.cc.

73  {
74  return dynamic_cast<const GEMChamber*>(idToDet(id.chamberId()));
75 }

References idToDet().

Referenced by add(), GEMGeometryBuilderFromDDD::build(), CSCUpgradeMotherboardLUTGenerator::generateLUTsME11(), CSCUpgradeMotherboardLUTGenerator::generateLUTsME21(), and geometryXMLparser.CSCAlignable::index().

◆ chambers()

const std::vector< const GEMChamber * > & GEMGeometry::chambers ( ) const

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

21 { return theDetIds; }

References theDetIds.

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

17 { return theDets; }

References theDets.

Referenced by GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex().

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

13 { return theEtaPartitionTypes; }

References theEtaPartitionTypes.

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

19 { return theEtaPartitionIds; }

References theEtaPartitionIds.

◆ detUnits()

const GEMGeometry::DetContainer & GEMGeometry::detUnits ( ) const
overridevirtual

Returm a vector of all GeomDet.

Implements TrackingGeometry.

Definition at line 15 of file GEMGeometry.cc.

15 { return theEtaPartitions; }

References theEtaPartitions.

◆ etaPartition()

const GEMEtaPartition * GEMGeometry::etaPartition ( GEMDetId  id) const

Return a GEMEtaPartition given its id.

Definition at line 77 of file GEMGeometry.cc.

77  {
78  return dynamic_cast<const GEMEtaPartition*>(idToDetUnit(id));
79 }

References idToDetUnit().

Referenced by add(), GEMSegmentBuilder::build(), GEMCSCSegmentBuilder::build(), L1TMuon::GeometryTranslator::getGEMSpecificPoint(), GEMSignalModel::getSimHitBx(), and GEMRecHitProducer::produce().

◆ etaPartitions()

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

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

25  {
26  mapIdToDet::const_iterator i = theMap.find(GEMDetId(id).rawId());
27  return (i != theMap.end()) ? i->second : nullptr;
28 }

References mps_fire::i, and theMap.

Referenced by GEMDQMSource::analyze(), MuonGEMDetLayerGeometryBuilder::buildLayer(), chamber(), idToDetUnit(), and superChamber().

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

23 { return dynamic_cast<const GeomDet*>(idToDet(id)); }

References idToDet().

Referenced by etaPartition().

◆ region()

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

Definition at line 42 of file GEMGeometry.cc.

42  {
43  for (auto region : allRegions) {
44  if (re != region->region())
45  continue;
46  return region;
47  }
48  return nullptr;
49 }

References allRegions, and GEMRegion::region().

Referenced by add().

◆ regions()

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

Return a vector of all GEM regions.

Definition at line 30 of file GEMGeometry.cc.

30 { return allRegions; }

References allRegions.

Referenced by GEMCheckGeometry::bookHistograms().

◆ ring()

const GEMRing * GEMGeometry::ring ( int  region,
int  station,
int  ring 
) const

Return a GEMRing.

Definition at line 60 of file GEMGeometry.cc.

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 }

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

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

◆ rings()

const std::vector< const GEMRing * > & GEMGeometry::rings ( ) const

Return a vector of all GEM rings.

Definition at line 34 of file GEMGeometry.cc.

34 { return allRings; }

References allRings.

◆ station()

const GEMStation * GEMGeometry::station ( int  region,
int  station 
) const

Definition at line 51 of file GEMGeometry.cc.

51  {
52  for (auto station : allStations) {
53  if (re != station->region() || st != station->station())
54  continue;
55  return station;
56  }
57  return nullptr;
58 }

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

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

◆ stations()

const std::vector< const GEMStation * > & GEMGeometry::stations ( ) const

Return a vector of all GEM stations.

Definition at line 32 of file GEMGeometry.cc.

32 { return allStations; }

References allStations.

◆ superChamber()

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

Definition at line 69 of file GEMGeometry.cc.

69  {
70  return dynamic_cast<const GEMSuperChamber*>(idToDet(id.superChamberId()));
71 }

References idToDet().

Referenced by add(), GEMSegmentBuilder::build(), CSCGEMMotherboard::maxPads(), CSCGEMMotherboard::maxRolls(), and CSCGEMMotherboard::retrieveGEMPads().

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

36 { return allSuperChambers; }

References allSuperChambers.

Referenced by FWRecoGeometryESProducer::addGEMGeometry(), and FWTGeoRecoGeometryESProducer::addGEMGeometry().

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 123 of file GEMGeometry.h.

Referenced by add(), and chambers().

◆ allEtaPartitions

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

Definition at line 122 of file GEMGeometry.h.

Referenced by add(), and etaPartitions().

◆ allRegions

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

Definition at line 127 of file GEMGeometry.h.

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

◆ allRings

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

Definition at line 125 of file GEMGeometry.h.

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

◆ allStations

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

Definition at line 126 of file GEMGeometry.h.

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

◆ allSuperChambers

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

Definition at line 124 of file GEMGeometry.h.

Referenced by add(), and superChambers().

◆ theDetIds

DetIdContainer GEMGeometry::theDetIds
private

Definition at line 117 of file GEMGeometry.h.

Referenced by add(), and detIds().

◆ theDets

DetContainer GEMGeometry::theDets
private

Definition at line 114 of file GEMGeometry.h.

Referenced by add(), and dets().

◆ theEtaPartitionIds

DetIdContainer GEMGeometry::theEtaPartitionIds
private

Definition at line 116 of file GEMGeometry.h.

Referenced by add(), and detUnitIds().

◆ theEtaPartitions

DetContainer GEMGeometry::theEtaPartitions
private

Definition at line 113 of file GEMGeometry.h.

Referenced by add(), and detUnits().

◆ theEtaPartitionTypes

DetTypeContainer GEMGeometry::theEtaPartitionTypes
private

Definition at line 115 of file GEMGeometry.h.

Referenced by add(), and detTypes().

◆ theMap

mapIdToDet GEMGeometry::theMap
private

Definition at line 120 of file GEMGeometry.h.

Referenced by add(), and idToDet().

GEMRing::region
int region() const
Return the region number.
Definition: GEMRing.cc:46
GEMGeometry::theEtaPartitionTypes
DetTypeContainer theEtaPartitionTypes
Definition: GEMGeometry.h:115
GEMGeometry::allEtaPartitions
std::vector< const GEMEtaPartition * > allEtaPartitions
Definition: GEMGeometry.h:122
GEMGeometry::region
const GEMRegion * region(int region) const
Definition: GEMGeometry.cc:42
GEMRing::station
int station() const
Return the station number.
Definition: GEMRing.cc:48
GEMGeometry::theEtaPartitionIds
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:116
mps_fire.i
i
Definition: mps_fire.py:355
GEMEtaPartition::type
const GeomDetType & type() const override
Definition: GEMEtaPartition.cc:22
GEMGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:25
GEMGeometry::idToDetUnit
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: GEMGeometry.cc:23
GEMGeometry::ring
const GEMRing * ring(int region, int station, int ring) const
Return a GEMRing.
Definition: GEMGeometry.cc:60
GEMGeometry::allRings
std::vector< const GEMRing * > allRings
Definition: GEMGeometry.h:125
GEMGeometry::theEtaPartitions
DetContainer theEtaPartitions
Definition: GEMGeometry.h:113
GEMGeometry::allSuperChambers
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:124
GEMRing::ring
int ring() const
Return the ring number.
Definition: GEMRing.cc:50
GEMGeometry::theMap
mapIdToDet theMap
Definition: GEMGeometry.h:120
GEMGeometry::theDetIds
DetIdContainer theDetIds
Definition: GEMGeometry.h:117
GEMGeometry::station
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:51
GEMGeometry::theDets
DetContainer theDets
Definition: GEMGeometry.h:114
GEMStation::station
int station() const
Get the station.
Definition: GEMStation.cc:72
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
GEMGeometry::allStations
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:126
GEMDetId
Definition: GEMDetId.h:17
GEMGeometry::allChambers
std::vector< const GEMChamber * > allChambers
Definition: GEMGeometry.h:123
GEMStation::region
int region() const
Get the region.
Definition: GEMStation.cc:70
GEMGeometry::superChamber
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:69
GEMGeometry::chamber
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:73
GEMGeometry::allRegions
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:127
GEMRegion::region
int region() const
Return the region.
Definition: GEMRegion.cc:64
GEMGeometry::etaPartition
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:77