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.

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

22 { rings_.emplace_back(ring); }

References ring(), and rings_.

Referenced by counter.Counter::register().

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

33  {
34  auto detId(GEMDetId(id.rawId()));
35  return ring(detId.ring())->component(id);
36 }

References ring().

◆ components()

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

Return the super chambers in the station.

Definition at line 24 of file GEMStation.cc.

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 }

References mps_fire::result, and rings_.

◆ getName()

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

Set the station name.

Definition at line 68 of file GEMStation.cc.

68 { return name_; }

References name_.

Referenced by plotting.Plot::draw().

◆ ids()

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

Return the vector of GEMDetIds in this station.

Definition at line 11 of file GEMStation.cc.

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 }

References mps_fire::result, and rings_.

◆ nRings()

int GEMStation::nRings ( ) const

Return numbers of rings for this station.

Definition at line 64 of file GEMStation.cc.

64 { return rings_.size(); }

References rings_.

◆ operator==()

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

equal if the id is the same

Definition at line 20 of file GEMStation.cc.

20 { return (region_ == st.region() && station_ == st.station()); }

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

◆ region()

int GEMStation::region ( ) const

Get the region.

Definition at line 70 of file GEMStation.cc.

70 { return region_; }

References region_.

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

◆ ring()

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

Get a ring.

Definition at line 53 of file GEMStation.cc.

53  {
54  for (auto ri : rings_) {
55  if (ring == ri->ring()) {
56  return ri;
57  }
58  }
59  return nullptr;
60 }

References GEMRing::ring(), and rings_.

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

◆ rings()

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

Return the rings in the station.

Definition at line 62 of file GEMStation.cc.

62 { return rings_; }

References rings_.

◆ setName()

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

Set the station name.

Definition at line 66 of file GEMStation.cc.

66 { name_ = std::move(name); }

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

◆ station()

int GEMStation::station ( ) const

Get the station.

Definition at line 72 of file GEMStation.cc.

72 { return station_; }

References station_.

Referenced by geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), operator==(), GEMGeometry::station(), and superChamber().

◆ superChamber()

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

Return the chamber corresponding to the given id.

Definition at line 38 of file GEMStation.cc.

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 }

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

◆ superChambers()

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

Return the super chambers in the region.

Definition at line 44 of file GEMStation.cc.

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 }

References mps_fire::result, and rings_.

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

GEMStation::rings_
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74
GEMStation::name_
std::string name_
Definition: GEMStation.h:75
GEMStation::component
const GeomDet * component(DetId id) const
Return the sub-component (super chamber) with a given id in this station.
Definition: GEMStation.cc:33
GEMRing::superChamber
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:27
GEMRing::ring
int ring() const
Return the ring number.
Definition: GEMRing.cc:50
GEMStation::station_
int station_
Definition: GEMStation.h:71
GEMStation::region_
int region_
Definition: GEMStation.h:70
GEMStation::station
int station() const
Get the station.
Definition: GEMStation.cc:72
GEMDetId
Definition: GEMDetId.h:18
eostools.move
def move(src, dest)
Definition: eostools.py:511
GEMStation::region
int region() const
Get the region.
Definition: GEMStation.cc:70
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
mps_fire.result
result
Definition: mps_fire.py:311
GEMStation::ring
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:53