CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
virtual const GeomDetcomponent (DetId id) const
 Return the sub-component (super chamber) with a given id in this station. More...
 
virtual 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 5 of file GEMStation.cc.

5  :
8 {
9 }
int region_
Definition: GEMStation.h:72
int region() const
Get the region.
Definition: GEMStation.cc:83
int station() const
Get the station.
Definition: GEMStation.cc:87
int station_
Definition: GEMStation.h:73
GEMStation::~GEMStation ( )

destructor

Definition at line 11 of file GEMStation.cc.

11 {}

Member Function Documentation

void GEMStation::add ( GEMRing ring)

Add ring to the station which takes ownership.

Definition at line 26 of file GEMStation.cc.

References rings_.

Referenced by GEMGeometryBuilderFromDDD::buildGeometry().

26  {
27  rings_.push_back(ring);
28 }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:76
const GeomDet * GEMStation::component ( DetId  id) const
virtual

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

Definition at line 39 of file GEMStation.cc.

References component(), and ring().

Referenced by component().

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

Return the super chambers in the station.

Definition at line 30 of file GEMStation.cc.

References query::result, and rings_.

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

Set the station name.

Definition at line 79 of file GEMStation.cc.

References name_.

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

Return the vector of GEMDetIds in this station.

Definition at line 13 of file GEMStation.cc.

References query::result, and rings_.

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

Return numbers of rings for this station.

Definition at line 71 of file GEMStation.cc.

References rings_.

71  {
72  return rings_.size();
73 }
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 22 of file GEMStation.cc.

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

22  {
23  return (region_ == st.region() && station_ == st.station());
24 }
int region_
Definition: GEMStation.h:72
int region() const
Get the region.
Definition: GEMStation.cc:83
int station() const
Get the station.
Definition: GEMStation.cc:87
int station_
Definition: GEMStation.h:73
int GEMStation::region ( ) const

Get the region.

Definition at line 83 of file GEMStation.cc.

References region_.

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

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

Get a ring.

Definition at line 58 of file GEMStation.cc.

References rings_.

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

58  {
59  for (auto ri : rings_) {
60  if (ring == ri->ring()) {
61  return ri;
62  }
63  }
64  return 0;
65 }
int ring() const
Return the ring number.
Definition: GEMRing.cc:69
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:58
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 67 of file GEMStation.cc.

References rings_.

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

Set the station name.

Definition at line 75 of file GEMStation.cc.

References mergeVDriftHistosByStation::name, and name_.

Referenced by GEMGeometryBuilderFromDDD::buildGeometry().

75  {
76  name_ = name;
77 }
std::string name_
Definition: GEMStation.h:77
int GEMStation::station ( ) const

Get the station.

Definition at line 87 of file GEMStation.cc.

References station_.

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

87  {
88  return station_;
89 }
int station_
Definition: GEMStation.h:73
const GEMSuperChamber * GEMStation::superChamber ( GEMDetId  id) const

Return the chamber corresponding to the given id.

Definition at line 44 of file GEMStation.cc.

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

44  {
45  if (id.region()!=region_ || id.station()!=station_ ) return 0; // not in this station
46  return ring(id.ring())->superChamber(id.chamber());
47 }
int region_
Definition: GEMStation.h:72
int region() const
Get the region.
Definition: GEMStation.cc:83
int station() const
Get the station.
Definition: GEMStation.cc:87
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:58
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 49 of file GEMStation.cc.

References query::result, and rings_.

49  {
50  std::vector<const GEMSuperChamber*> result;
51  for (auto ri : rings_ ){
52  std::vector<const GEMSuperChamber*> newSch(ri->superChambers());
53  result.insert(result.end(), newSch.begin(), newSch.end());
54  }
55  return result;
56 }
tuple result
Definition: query.py:137
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().