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) {}

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

20 { stations_.emplace_back(st); }

References stations_.

Referenced by counter.Counter::register().

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

31  {
32  auto detId(GEMDetId(id.rawId()));
33  return station(detId.station())->component(id);
34 }

References station().

◆ components()

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

Return the super chambers in the region.

Definition at line 22 of file GEMRegion.cc.

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 }

References mps_fire::result, and stations_.

◆ ids()

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

Return the vector of GEMDetIds in this ring.

Definition at line 9 of file GEMRegion.cc.

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 }

References mps_fire::result, and stations_.

◆ nStations()

int GEMRegion::nStations ( ) const

Return numbers of stations.

Definition at line 62 of file GEMRegion.cc.

62 { return stations_.size(); }

References stations_.

◆ operator==()

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

equal if the id is the same

Definition at line 18 of file GEMRegion.cc.

18 { return region_ == re.region(); }

References region(), and region_.

◆ region()

int GEMRegion::region ( ) const

Return the region.

Definition at line 64 of file GEMRegion.cc.

64 { return region_; }

References region_.

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

◆ station()

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

Return a station.

Definition at line 51 of file GEMRegion.cc.

51  {
52  for (auto stat : stations_) {
53  if (st == stat->station()) {
54  return stat;
55  }
56  }
57  return nullptr;
58 }

References hgcalPlots::stat, and stations_.

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

◆ stations()

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

Return all stations.

Definition at line 60 of file GEMRegion.cc.

60 { return stations_; }

References stations_.

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

36  {
37  if (id.region() != region_)
38  return nullptr; // not in this region
39  return station(id.station())->ring(id.ring())->superChamber(id);
40 }

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

◆ superChambers()

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

Return the super chambers in the region.

Definition at line 42 of file GEMRegion.cc.

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 }

References mps_fire::result, and stations_.

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

GEMRegion::station
const GEMStation * station(int st) const
Return a station.
Definition: GEMRegion.cc:51
GEMRegion::region_
int region_
Definition: GEMRegion.h:61
GEMRing::superChamber
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:27
hgcalPlots.stat
stat
Definition: hgcalPlots.py:1119
GEMRegion::stations_
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:63
GEMDetId
Definition: GEMDetId.h:18
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
mps_fire.result
result
Definition: mps_fire.py:311
GEMStation::ring
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:53
GEMRegion::component
const GeomDet * component(DetId id) const
Return the sub-component (super chamber) with a given id in this region.
Definition: GEMRegion.cc:31
GEMRegion::region
int region() const
Return the region.
Definition: GEMRegion.cc:64