CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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...
 
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.

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

destructor

Definition at line 9 of file GEMStation.cc.

9 {}

Member Function Documentation

void GEMStation::add ( GEMRing ring)

Add ring to the station which takes ownership.

Definition at line 22 of file GEMStation.cc.

References rings_.

Referenced by GEMGeometryBuilderFromCondDB::build(), GEMGeometryBuilder::buildRegions(), and counter.Counter::register().

22 { rings_.emplace_back(ring); }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74
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
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 }
tuple result
Definition: mps_fire.py:311
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74
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
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 }
tuple result
Definition: mps_fire.py:311
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74
int GEMStation::nRings ( ) const

Return numbers of rings for this station.

Definition at line 64 of file GEMStation.cc.

References rings_.

Referenced by GEMGeometryBuilderFromCondDB::build().

64 { return rings_.size(); }
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74
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() const
Get the station.
Definition: GEMStation.cc:72
int station_
Definition: GEMStation.h:71
int GEMStation::region ( ) const

Get the region.

Definition at line 70 of file GEMStation.cc.

References region_.

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

70 { return region_; }
int region_
Definition: GEMStation.h:70
const GEMRing * GEMStation::ring ( int  ring) const

Get a ring.

Definition at line 53 of file GEMStation.cc.

References rings_.

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

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

Set the station name.

Definition at line 66 of file GEMStation.cc.

References eostools::move(), and name_.

Referenced by GEMGeometryBuilderFromCondDB::build(), and GEMGeometryBuilder::buildRegions().

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

Return the chamber corresponding to the given id.

Definition at line 38 of file GEMStation.cc.

References 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
int station() const
Get the station.
Definition: GEMStation.cc:72
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
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_.

Referenced by GEMBaseValidation::bookDetectorOccupancy(), GEMOfflineDQMBase::getNumEtaPartitions(), GEMDQMBase::getNumEtaPartitions(), GEMOfflineDQMBase::setDetLabelsEta(), and GEMOfflineDQMBase::setDetLabelsVFAT().

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 }
tuple result
Definition: mps_fire.py:311
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74

Member Data Documentation

std::string GEMStation::name_
private

Definition at line 75 of file GEMStation.h.

Referenced by getName(), and setName().

int GEMStation::region_
private

Definition at line 70 of file GEMStation.h.

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

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

int GEMStation::station_
private

Definition at line 71 of file GEMStation.h.

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