CMS 3D CMS Logo

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

#include <GEMStation.h>

Public Member Functions

void add (GEMRing *ring)
 Add ring to the station which takes ownership. More...
 
const GeomDetcomponent (DetId id) const
 Return the sub-component (super chamber) with a given id in this station. More...
 
std::vector< const GeomDet * > components () const
 Return the super chambers in the station. More...
 
 GEMStation (int region, int station)
 constructor More...
 
const std::string getName () const
 Set the station name. More...
 
std::vector< GEMDetIdids () const
 Return the vector of GEMDetIds in this station. More...
 
int nRings () const
 Return numbers of rings for this station. More...
 
bool operator== (const GEMStation &st) const
 equal if the id is the same More...
 
int region () const
 Get the region. More...
 
const GEMRingring (int ring) const
 Get a ring. More...
 
const std::vector< const GEMRing * > & rings () const
 Return the rings in the station. More...
 
void setName (std::string name)
 Set the station name. More...
 
int station () const
 Get the station. More...
 
const GEMSuperChambersuperChamber (GEMDetId id) const
 Return the chamber corresponding to the given id. More...
 
std::vector< const GEMSuperChamber * > superChambers () const
 Return the super chambers in the region. More...
 
 ~GEMStation ()
 destructor More...
 

Private Attributes

std::string name_
 
int region_
 
std::vector< const GEMRing * > rings_
 
int station_
 

Detailed Description

Model of a GEM Station

A station is composed of maximal 3 rings

Author
S. Dildick

Definition at line 19 of file GEMStation.h.

Constructor & Destructor Documentation

◆ GEMStation()

GEMStation::GEMStation ( int  region,
int  station 
)

constructor

Definition at line 7 of file GEMStation.cc.

int region_
Definition: GEMStation.h:70
int region() const
Get the region.
Definition: GEMStation.cc:70
int station_
Definition: GEMStation.h:71
int station() const
Get the station.
Definition: GEMStation.cc:72

◆ ~GEMStation()

GEMStation::~GEMStation ( )

destructor

Definition at line 9 of file GEMStation.cc.

9 {}

Member Function Documentation

◆ add()

void GEMStation::add ( GEMRing ring)

Add ring to the station which takes ownership.

Definition at line 22 of file GEMStation.cc.

References ring(), and rings_.

Referenced by counter.Counter::register().

22 { rings_.emplace_back(ring); }
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:53
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74

◆ component()

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

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

Definition at line 33 of file GEMStation.cc.

References ring().

33  {
34  auto detId(GEMDetId(id.rawId()));
35  return ring(detId.ring())->component(id);
36 }
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:53
const GeomDet * component(DetId id) const
Return the sub-component (super chamber) with a given id in this station.
Definition: GEMStation.cc:33

◆ components()

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

Return the super chambers in the station.

Definition at line 24 of file GEMStation.cc.

References mps_fire::result, and rings_.

24  {
25  std::vector<const GeomDet*> result;
26  for (auto ri : rings_) {
27  auto newSch(ri->components());
28  result.insert(result.end(), newSch.begin(), newSch.end());
29  }
30  return result;
31 }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74

◆ getName()

const std::string GEMStation::getName ( void  ) const

Set the station name.

Definition at line 68 of file GEMStation.cc.

References name_.

Referenced by plotting.Plot::draw().

68 { return name_; }
std::string name_
Definition: GEMStation.h:75

◆ ids()

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

Return the vector of GEMDetIds in this station.

Definition at line 11 of file GEMStation.cc.

References mps_fire::result, and rings_.

11  {
12  std::vector<GEMDetId> result;
13  for (auto& ri : rings_) {
14  std::vector<GEMDetId> newIds(ri->ids());
15  result.insert(result.end(), newIds.begin(), newIds.end());
16  }
17  return result;
18 }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74

◆ nRings()

int GEMStation::nRings ( ) const

Return numbers of rings for this station.

Definition at line 64 of file GEMStation.cc.

References rings_.

64 { return rings_.size(); }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74

◆ operator==()

bool GEMStation::operator== ( const GEMStation st) const

equal if the id is the same

Definition at line 20 of file GEMStation.cc.

References region(), region_, station(), and station_.

20 { return (region_ == st.region() && station_ == st.station()); }
int region_
Definition: GEMStation.h:70
int region() const
Get the region.
Definition: GEMStation.cc:70
int station_
Definition: GEMStation.h:71
int station() const
Get the station.
Definition: GEMStation.cc:72

◆ region()

int GEMStation::region ( ) const

Get the region.

Definition at line 70 of file GEMStation.cc.

References region_.

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

70 { return region_; }
int region_
Definition: GEMStation.h:70

◆ ring()

const GEMRing * GEMStation::ring ( int  ring) const

Get a ring.

Definition at line 53 of file GEMStation.cc.

References GEMRing::ring(), and rings_.

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

53  {
54  for (auto ri : rings_) {
55  if (ring == ri->ring()) {
56  return ri;
57  }
58  }
59  return nullptr;
60 }
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:53
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74
int ring() const
Return the ring number.
Definition: GEMRing.cc:50

◆ rings()

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

Return the rings in the station.

Definition at line 62 of file GEMStation.cc.

References rings_.

62 { return rings_; }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74

◆ setName()

void GEMStation::setName ( std::string  name)

Set the station name.

Definition at line 66 of file GEMStation.cc.

References eostools::move(), Skims_PA_cff::name, and name_.

66 { name_ = std::move(name); }
std::string name_
Definition: GEMStation.h:75
def move(src, dest)
Definition: eostools.py:511

◆ station()

int GEMStation::station ( ) const

◆ superChamber()

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

Return the chamber corresponding to the given id.

Definition at line 38 of file GEMStation.cc.

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

38  {
39  if (id.region() != region_ || id.station() != station_)
40  return nullptr; // not in this station
41  return ring(id.ring())->superChamber(id.chamber());
42 }
int region_
Definition: GEMStation.h:70
int region() const
Get the region.
Definition: GEMStation.cc:70
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
int station_
Definition: GEMStation.h:71
int station() const
Get the station.
Definition: GEMStation.cc:72

◆ superChambers()

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

Return the super chambers in the region.

Definition at line 44 of file GEMStation.cc.

References mps_fire::result, and rings_.

44  {
45  std::vector<const GEMSuperChamber*> result;
46  for (auto ri : rings_) {
47  std::vector<const GEMSuperChamber*> newSch(ri->superChambers());
48  result.insert(result.end(), newSch.begin(), newSch.end());
49  }
50  return result;
51 }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74

Member Data Documentation

◆ name_

std::string GEMStation::name_
private

Definition at line 75 of file GEMStation.h.

Referenced by getName(), and setName().

◆ region_

int GEMStation::region_
private

Definition at line 70 of file GEMStation.h.

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

◆ rings_

std::vector<const GEMRing*> GEMStation::rings_
private

Definition at line 74 of file GEMStation.h.

Referenced by add(), components(), ids(), nRings(), ring(), rings(), and superChambers().

◆ station_

int GEMStation::station_
private

Definition at line 71 of file GEMStation.h.

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