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
GEMRegion Class Reference

#include <GEMRegion.h>

Public Member Functions

void add (GEMStation *st)
 Add station to the region which takes ownership. More...
 
virtual const GeomDetcomponent (DetId id) const
 Return the sub-component (super chamber) with a given id in this region. More...
 
virtual std::vector< const
GeomDet * > 
components () const
 Return the super chambers in the region. More...
 
 GEMRegion (int region)
 constructor More...
 
std::vector< GEMDetIdids () const
 Return the vector of GEMDetIds in this ring. More...
 
int nStations () const
 Return numbers of stations. More...
 
bool operator== (const GEMRegion &reg) const
 equal if the id is the same More...
 
int region () const
 Return the region. More...
 
const GEMStationstation (int st) const
 Return a station. More...
 
const std::vector< const
GEMStation * > & 
stations () const
 Return all stations. More...
 
const GEMSuperChambersuperChamber (GEMDetId id) const
 Return the super chamber corresponding to the given id. More...
 
std::vector< const
GEMSuperChamber * > 
superChambers () const
 Return the super chambers in the region. More...
 
 ~GEMRegion ()
 destructor More...
 

Private Attributes

int region_
 
std::vector< const GEMStation * > stations_
 

Detailed Description

Model of a GEM Region

A region has maximal 5 stations

Author
S. Dildick

Definition at line 19 of file GEMRegion.h.

Constructor & Destructor Documentation

GEMRegion::GEMRegion ( int  region)

constructor

Definition at line 5 of file GEMRegion.cc.

5  :
7 {
8 }
int region() const
Return the region.
Definition: GEMRegion.cc:74
int region_
Definition: GEMRegion.h:63
GEMRegion::~GEMRegion ( )

destructor

Definition at line 10 of file GEMRegion.cc.

10 {}

Member Function Documentation

void GEMRegion::add ( GEMStation st)

Add station to the region which takes ownership.

Definition at line 25 of file GEMRegion.cc.

References stations_.

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

25  {
26  stations_.push_back(st);
27 }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:65
const GeomDet * GEMRegion::component ( DetId  id) const
virtual

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

Definition at line 38 of file GEMRegion.cc.

References station().

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

Return the super chambers in the region.

Definition at line 29 of file GEMRegion.cc.

References mps_fire::result, and stations_.

29  {
30  std::vector<const GeomDet*> result;
31  for (auto st : stations_) {
32  auto newSch(st->components());
33  result.insert(result.end(), newSch.begin(), newSch.end());
34  }
35  return result;
36 }
tuple result
Definition: mps_fire.py:84
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:65
std::vector< GEMDetId > GEMRegion::ids ( ) const

Return the vector of GEMDetIds in this ring.

Definition at line 12 of file GEMRegion.cc.

References mps_fire::result, and stations_.

12  {
13  std::vector<GEMDetId> result;
14  for (auto st : stations_ ){
15  std::vector<GEMDetId> newIds(st->ids());
16  result.insert(result.end(), newIds.begin(), newIds.end());
17  }
18  return result;
19 }
tuple result
Definition: mps_fire.py:84
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:65
int GEMRegion::nStations ( ) const

Return numbers of stations.

Definition at line 70 of file GEMRegion.cc.

References stations_.

70  {
71  return stations_.size();
72 }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:65
bool GEMRegion::operator== ( const GEMRegion reg) const

equal if the id is the same

Definition at line 21 of file GEMRegion.cc.

References region(), and region_.

21  {
22  return region_ == re.region();
23 }
int region_
Definition: GEMRegion.h:63
int GEMRegion::region ( ) const

Return the region.

Definition at line 74 of file GEMRegion.cc.

References region_.

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

74  {
75  return region_;
76 }
int region_
Definition: GEMRegion.h:63
const GEMStation * GEMRegion::station ( int  st) const

Return a station.

Definition at line 57 of file GEMRegion.cc.

References stations_.

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

57  {
58  for (auto stat : stations_) {
59  if (st == stat->station()) {
60  return stat;
61  }
62  }
63  return 0;
64 }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:65
const std::vector< const GEMStation * > & GEMRegion::stations ( ) const

Return all stations.

Definition at line 66 of file GEMRegion.cc.

References stations_.

66  {
67  return stations_;
68 }
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:65
const GEMSuperChamber * GEMRegion::superChamber ( GEMDetId  id) const

Return the super chamber corresponding to the given id.

Definition at line 43 of file GEMRegion.cc.

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

43  {
44  if (id.region()!=region_ ) return 0; // not in this region
45  return station(id.station())->ring(id.ring())->superChamber(id);
46 }
const GEMStation * station(int st) const
Return a station.
Definition: GEMRegion.cc:57
int region() const
Return the region.
Definition: GEMRegion.cc:74
int region_
Definition: GEMRegion.h:63
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
std::vector< const GEMSuperChamber * > GEMRegion::superChambers ( ) const

Return the super chambers in the region.

Definition at line 48 of file GEMRegion.cc.

References mps_fire::result, and stations_.

48  {
49  std::vector<const GEMSuperChamber*> result;
50  for (auto st : stations_) {
51  std::vector<const GEMSuperChamber*> newSch(st->superChambers());
52  result.insert(result.end(), newSch.begin(), newSch.end());
53  }
54  return result;
55 }
tuple result
Definition: mps_fire.py:84
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:65

Member Data Documentation

int GEMRegion::region_
private

Definition at line 63 of file GEMRegion.h.

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

std::vector<const GEMStation*> GEMRegion::stations_
private

Definition at line 65 of file GEMRegion.h.

Referenced by add(), components(), ids(), nStations(), station(), stations(), and superChambers().