CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GEMRegion Class Reference

#include <GEMRegion.h>

Public Member Functions

void add (GEMStation *st)
 Add station to the region which takes ownership. More...
 
const GeomDetcomponent (DetId id) const
 Return the sub-component (super chamber) with a given id in this region. More...
 
std::vector< const GeomDet * > components () const
 Return the super chambers in the region. More...
 
 GEMRegion (int region)
 constructor More...
 
std::vector< GEMDetIdids () const
 Return the vector of GEMDetIds in this ring. More...
 
int nStations () const
 Return numbers of stations. More...
 
bool operator== (const GEMRegion &reg) const
 equal if the id is the same More...
 
int region () const
 Return the region. More...
 
const GEMStationstation (int st) const
 Return a station. More...
 
const std::vector< const GEMStation * > & stations () const
 Return all stations. More...
 
const GEMSuperChambersuperChamber (GEMDetId id) const
 Return the super chamber corresponding to the given id. More...
 
std::vector< const GEMSuperChamber * > superChambers () const
 Return the super chambers in the region. More...
 
 ~GEMRegion ()
 destructor More...
 

Private Attributes

int region_
 
std::vector< const GEMStation * > stations_
 

Detailed Description

Model of a GEM Region

A region has maximal 5 stations

Author
S. Dildick

Definition at line 19 of file GEMRegion.h.

Constructor & Destructor Documentation

◆ GEMRegion()

GEMRegion::GEMRegion ( int  region)

constructor

Definition at line 5 of file GEMRegion.cc.

5 : region_(region) {}
int region() const
Return the region.
Definition: GEMRegion.cc:64
int region_
Definition: GEMRegion.h:61

◆ ~GEMRegion()

GEMRegion::~GEMRegion ( )

destructor

Definition at line 7 of file GEMRegion.cc.

7 {}

Member Function Documentation

◆ add()

void GEMRegion::add ( GEMStation st)

Add station to the region which takes ownership.

Definition at line 20 of file GEMRegion.cc.

References stations_.

Referenced by counter.Counter::register().

20 { stations_.emplace_back(st); }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:63

◆ component()

const GeomDet * GEMRegion::component ( DetId  id) const

Return the sub-component (super chamber) with a given id in this region.

Definition at line 31 of file GEMRegion.cc.

References station().

31  {
32  auto detId(GEMDetId(id.rawId()));
33  return station(detId.station())->component(id);
34 }
const GeomDet * component(DetId id) const
Return the sub-component (super chamber) with a given id in this region.
Definition: GEMRegion.cc:31
const GEMStation * station(int st) const
Return a station.
Definition: GEMRegion.cc:51

◆ components()

std::vector< const GeomDet * > GEMRegion::components ( ) const

Return the super chambers in the region.

Definition at line 22 of file GEMRegion.cc.

References mps_fire::result, and stations_.

22  {
23  std::vector<const GeomDet*> result;
24  for (auto st : stations_) {
25  auto newSch(st->components());
26  result.insert(result.end(), newSch.begin(), newSch.end());
27  }
28  return result;
29 }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:63

◆ ids()

std::vector< GEMDetId > GEMRegion::ids ( ) const

Return the vector of GEMDetIds in this ring.

Definition at line 9 of file GEMRegion.cc.

References mps_fire::result, and stations_.

9  {
10  std::vector<GEMDetId> result;
11  for (auto st : stations_) {
12  std::vector<GEMDetId> newIds(st->ids());
13  result.insert(result.end(), newIds.begin(), newIds.end());
14  }
15  return result;
16 }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:63

◆ nStations()

int GEMRegion::nStations ( ) const

Return numbers of stations.

Definition at line 62 of file GEMRegion.cc.

References stations_.

62 { return stations_.size(); }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:63

◆ operator==()

bool GEMRegion::operator== ( const GEMRegion reg) const

equal if the id is the same

Definition at line 18 of file GEMRegion.cc.

References region(), and region_.

18 { return region_ == re.region(); }
int region_
Definition: GEMRegion.h:61

◆ region()

int GEMRegion::region ( ) const

Return the region.

Definition at line 64 of file GEMRegion.cc.

References region_.

Referenced by AlignableMuon::buildGEMEndcap(), operator==(), GEMGeometry::region(), and superChamber().

64 { return region_; }
int region_
Definition: GEMRegion.h:61

◆ station()

const GEMStation * GEMRegion::station ( int  st) const

Return a station.

Definition at line 51 of file GEMRegion.cc.

References edm_modernize_messagelogger::stat, and stations_.

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

51  {
52  for (auto stat : stations_) {
53  if (st == stat->station()) {
54  return stat;
55  }
56  }
57  return nullptr;
58 }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:63

◆ stations()

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

Return all stations.

Definition at line 60 of file GEMRegion.cc.

References stations_.

60 { return stations_; }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:63

◆ superChamber()

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

Return the super chamber corresponding to the given id.

Definition at line 36 of file GEMRegion.cc.

References region(), region_, GEMStation::ring(), relativeConstraints::ring, station(), and GEMRing::superChamber().

36  {
37  if (id.region() != region_)
38  return nullptr; // not in this region
39  return station(id.station())->ring(id.ring())->superChamber(id);
40 }
int region() const
Return the region.
Definition: GEMRegion.cc:64
int region_
Definition: GEMRegion.h:61
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:53
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:27
const GEMStation * station(int st) const
Return a station.
Definition: GEMRegion.cc:51

◆ superChambers()

std::vector< const GEMSuperChamber * > GEMRegion::superChambers ( ) const

Return the super chambers in the region.

Definition at line 42 of file GEMRegion.cc.

References mps_fire::result, and stations_.

42  {
43  std::vector<const GEMSuperChamber*> result;
44  for (auto st : stations_) {
45  std::vector<const GEMSuperChamber*> newSch(st->superChambers());
46  result.insert(result.end(), newSch.begin(), newSch.end());
47  }
48  return result;
49 }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:63

Member Data Documentation

◆ region_

int GEMRegion::region_
private

Definition at line 61 of file GEMRegion.h.

Referenced by operator==(), region(), and superChamber().

◆ stations_

std::vector<const GEMStation*> GEMRegion::stations_
private

Definition at line 63 of file GEMRegion.h.

Referenced by add(), components(), ids(), nStations(), station(), stations(), and superChambers().