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 ( int  region,
int  station 
)

constructor

Definition at line 7 of file GEMStation.cc.

7  :
10 {
11 }
int region_
Definition: GEMStation.h:72
int region() const
Get the region.
Definition: GEMStation.cc:85
int station() const
Get the station.
Definition: GEMStation.cc:89
int station_
Definition: GEMStation.h:73
GEMStation::~GEMStation ( )

destructor

Definition at line 13 of file GEMStation.cc.

13 {}

Member Function Documentation

void GEMStation::add ( GEMRing ring)

Add ring to the station which takes ownership.

Definition at line 28 of file GEMStation.cc.

References rings_.

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

28  {
29  rings_.emplace_back(ring);
30 }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:76
const GeomDet * GEMStation::component ( DetId  id) const

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

Definition at line 41 of file GEMStation.cc.

References ring().

41  {
42  auto detId(GEMDetId(id.rawId()));
43  return ring(detId.ring())->component(id);
44 }
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:60
const GeomDet * component(DetId id) const
Return the sub-component (super chamber) with a given id in this station.
Definition: GEMStation.cc:41
std::vector< const GeomDet * > GEMStation::components ( ) const

Return the super chambers in the station.

Definition at line 32 of file GEMStation.cc.

References mps_fire::result, and rings_.

32  {
33  std::vector<const GeomDet*> result;
34  for (auto ri : rings_) {
35  auto newSch(ri->components());
36  result.insert(result.end(), newSch.begin(), newSch.end());
37  }
38  return result;
39 }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:76
const std::string GEMStation::getName ( void  ) const

Set the station name.

Definition at line 81 of file GEMStation.cc.

References name_.

Referenced by plotting.Plot::draw().

81  {
82  return name_;
83 }
std::string name_
Definition: GEMStation.h:77
std::vector< GEMDetId > GEMStation::ids ( ) const

Return the vector of GEMDetIds in this station.

Definition at line 15 of file GEMStation.cc.

References mps_fire::result, and rings_.

15  {
16  std::vector<GEMDetId> result;
17  for (auto& ri : rings_){
18  std::vector<GEMDetId> newIds(ri->ids());
19  result.insert(result.end(), newIds.begin(), newIds.end());
20  }
21  return result;
22 }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:76
int GEMStation::nRings ( ) const

Return numbers of rings for this station.

Definition at line 73 of file GEMStation.cc.

References rings_.

73  {
74  return rings_.size();
75 }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:76
bool GEMStation::operator== ( const GEMStation st) const

equal if the id is the same

Definition at line 24 of file GEMStation.cc.

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

24  {
25  return (region_ == st.region() && station_ == st.station());
26 }
int region_
Definition: GEMStation.h:72
int region() const
Get the region.
Definition: GEMStation.cc:85
int station() const
Get the station.
Definition: GEMStation.cc:89
int station_
Definition: GEMStation.h:73
int GEMStation::region ( ) const

Get the region.

Definition at line 85 of file GEMStation.cc.

References region_.

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

85  {
86  return region_;
87 }
int region_
Definition: GEMStation.h:72
const GEMRing * GEMStation::ring ( int  ring) const

Get a ring.

Definition at line 60 of file GEMStation.cc.

References rings_.

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

60  {
61  for (auto ri : rings_) {
62  if (ring == ri->ring()) {
63  return ri;
64  }
65  }
66  return nullptr;
67 }
int ring() const
Return the ring number.
Definition: GEMRing.cc:69
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:60
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:76
const std::vector< const GEMRing * > & GEMStation::rings ( ) const

Return the rings in the station.

Definition at line 69 of file GEMStation.cc.

References rings_.

Referenced by GEMBaseValidation::getDCEta().

69  {
70  return rings_;
71 }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:76
void GEMStation::setName ( std::string  name)

Set the station name.

Definition at line 77 of file GEMStation.cc.

References eostools::move(), and name_.

Referenced by GEMGeometryBuilderFromDDD::buildGeometry().

77  {
78  name_ = std::move(name);
79 }
std::string name_
Definition: GEMStation.h:77
def move(src, dest)
Definition: eostools.py:510
int GEMStation::station ( ) const
const GEMSuperChamber * GEMStation::superChamber ( GEMDetId  id) const

Return the chamber corresponding to the given id.

Definition at line 46 of file GEMStation.cc.

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

46  {
47  if (id.region()!=region_ || id.station()!=station_ ) return nullptr; // not in this station
48  return ring(id.ring())->superChamber(id.chamber());
49 }
int region_
Definition: GEMStation.h:72
int region() const
Get the region.
Definition: GEMStation.cc:85
int station() const
Get the station.
Definition: GEMStation.cc:89
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:60
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:39
int station_
Definition: GEMStation.h:73
std::vector< const GEMSuperChamber * > GEMStation::superChambers ( ) const

Return the super chambers in the region.

Definition at line 51 of file GEMStation.cc.

References mps_fire::result, and rings_.

51  {
52  std::vector<const GEMSuperChamber*> result;
53  for (auto ri : rings_ ){
54  std::vector<const GEMSuperChamber*> newSch(ri->superChambers());
55  result.insert(result.end(), newSch.begin(), newSch.end());
56  }
57  return result;
58 }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:76

Member Data Documentation

std::string GEMStation::name_
private

Definition at line 77 of file GEMStation.h.

Referenced by getName(), and setName().

int GEMStation::region_
private

Definition at line 72 of file GEMStation.h.

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

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

Definition at line 76 of file GEMStation.h.

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

int GEMStation::station_
private

Definition at line 73 of file GEMStation.h.

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