CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GEMRing Class Reference

#include <GEMRing.h>

Public Member Functions

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

Private Attributes

std::vector< GEMDetIddetIds_
 
int region_
 
int ring_
 
int station_
 
std::vector< const GEMSuperChamber * > superChambers_
 

Detailed Description

Model of a GEM Ring

A ring is composed of 36 super chambers

Author
S. Dildick

Definition at line 18 of file GEMRing.h.

Constructor & Destructor Documentation

◆ GEMRing()

GEMRing::GEMRing ( int  region,
int  station,
int  ring 
)

constructor

Definition at line 4 of file GEMRing.cc.

◆ ~GEMRing()

GEMRing::~GEMRing ( )

destructor

Definition at line 6 of file GEMRing.cc.

6 {}

Member Function Documentation

◆ add()

void GEMRing::add ( GEMSuperChamber ch)

Add super chamber to the ring which takes ownership.

Definition at line 14 of file GEMRing.cc.

14 { superChambers_.emplace_back(sch); }

References superChambers_.

Referenced by counter.Counter::register().

◆ component()

const GeomDet * GEMRing::component ( DetId  id) const

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

Definition at line 25 of file GEMRing.cc.

25 { return superChamber(GEMDetId(id.rawId())); }

References superChamber().

◆ components()

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

Return the super chambers in the ring.

Definition at line 16 of file GEMRing.cc.

16  {
17  std::vector<const GeomDet*> result;
18  for (auto sch : superChambers_) {
19  auto newSch(sch->components());
20  result.insert(result.end(), newSch.begin(), newSch.end());
21  }
22  return result;
23 }

References mps_fire::result, and superChambers_.

◆ ids()

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

Return the vector of GEMDetIds in this ring.

Definition at line 8 of file GEMRing.cc.

8 { return detIds_; }

References detIds_.

◆ nSuperChambers()

int GEMRing::nSuperChambers ( ) const

Return numbers of chambers.

Definition at line 44 of file GEMRing.cc.

44 { return superChambers_.size(); }

References superChambers_.

◆ operator==()

bool GEMRing::operator== ( const GEMRing sch) const

equal if the id is the same

Definition at line 10 of file GEMRing.cc.

10  {
11  return (region_ == ri.region() && station_ == ri.station() && ring_ == ri.ring());
12 }

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

◆ region()

int GEMRing::region ( ) const

Return the region number.

Definition at line 46 of file GEMRing.cc.

46 { return region_; }

References region_.

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

◆ ring()

int GEMRing::ring ( ) const

Return the ring number.

Definition at line 50 of file GEMRing.cc.

50 { return ring_; }

References ring_.

Referenced by geometryXMLparser.CSCAlignable::index(), operator==(), GEMStation::ring(), GEMGeometry::ring(), and superChamber().

◆ station()

int GEMRing::station ( ) const

Return the station number.

Definition at line 48 of file GEMRing.cc.

48 { return station_; }

References station_.

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

◆ superChamber() [1/2]

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

Return the chamber corresponding to the given id.

Definition at line 27 of file GEMRing.cc.

27  {
28  if (id.region() != region_ || id.station() != station_ || id.ring() != ring_)
29  return nullptr; // not in this station
30  return superChamber(id.chamber());
31 }

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

Referenced by component(), GEMStation::superChamber(), and GEMRegion::superChamber().

◆ superChamber() [2/2]

const GEMSuperChamber * GEMRing::superChamber ( int  sch) const

Definition at line 33 of file GEMRing.cc.

33  {
34  for (auto sch : superChambers_) {
35  if (sch->id().chamber() == isch) {
36  return sch;
37  }
38  }
39  return nullptr;
40 }

References superChambers_.

◆ superChambers()

const std::vector< const GEMSuperChamber * > & GEMRing::superChambers ( ) const

Return the chambers in the ring.

Definition at line 42 of file GEMRing.cc.

42 { return superChambers_; }

References superChambers_.

Member Data Documentation

◆ detIds_

std::vector<GEMDetId> GEMRing::detIds_
private

Definition at line 67 of file GEMRing.h.

Referenced by ids().

◆ region_

int GEMRing::region_
private

Definition at line 63 of file GEMRing.h.

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

◆ ring_

int GEMRing::ring_
private

Definition at line 65 of file GEMRing.h.

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

◆ station_

int GEMRing::station_
private

Definition at line 64 of file GEMRing.h.

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

◆ superChambers_

std::vector<const GEMSuperChamber*> GEMRing::superChambers_
private

Definition at line 70 of file GEMRing.h.

Referenced by add(), components(), nSuperChambers(), superChamber(), and superChambers().

GEMRing::region
int region() const
Return the region number.
Definition: GEMRing.cc:46
GEMRing::station
int station() const
Return the station number.
Definition: GEMRing.cc:48
GEMRing::ring_
int ring_
Definition: GEMRing.h:65
GEMRing::superChamber
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:27
GEMRing::region_
int region_
Definition: GEMRing.h:63
GEMRing::ring
int ring() const
Return the ring number.
Definition: GEMRing.cc:50
GEMRing::detIds_
std::vector< GEMDetId > detIds_
Definition: GEMRing.h:67
GEMRing::station_
int station_
Definition: GEMRing.h:64
GEMDetId
Definition: GEMDetId.h:17
GEMRing::superChambers_
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:70
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
mps_fire.result
result
Definition: mps_fire.py:303