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

constructor

Definition at line 4 of file GEMRing.cc.

int region() const
Return the region number.
Definition: GEMRing.cc:46
int station() const
Return the station number.
Definition: GEMRing.cc:48
int ring() const
Return the ring number.
Definition: GEMRing.cc:50
int ring_
Definition: GEMRing.h:65
int region_
Definition: GEMRing.h:63
int station_
Definition: GEMRing.h:64
GEMRing::~GEMRing ( )

destructor

Definition at line 6 of file GEMRing.cc.

6 {}

Member Function Documentation

void GEMRing::add ( GEMSuperChamber ch)

Add super chamber to the ring which takes ownership.

Definition at line 14 of file GEMRing.cc.

References superChambers_.

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

14 { superChambers_.emplace_back(sch); }
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:70
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.

References superChamber().

25 { return superChamber(GEMDetId(id.rawId())); }
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:27
std::vector< const GeomDet * > GEMRing::components ( ) const

Return the super chambers in the ring.

Definition at line 16 of file GEMRing.cc.

References mps_fire::result, and superChambers_.

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 }
tuple result
Definition: mps_fire.py:311
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:70
std::vector< GEMDetId > GEMRing::ids ( ) const

Return the vector of GEMDetIds in this ring.

Definition at line 8 of file GEMRing.cc.

References detIds_.

8 { return detIds_; }
std::vector< GEMDetId > detIds_
Definition: GEMRing.h:67
int GEMRing::nSuperChambers ( ) const

Return numbers of chambers.

Definition at line 44 of file GEMRing.cc.

References superChambers_.

Referenced by GEMGeometryBuilderFromCondDB::build().

44 { return superChambers_.size(); }
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:70
bool GEMRing::operator== ( const GEMRing sch) const

equal if the id is the same

Definition at line 10 of file GEMRing.cc.

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

10  {
11  return (region_ == ri.region() && station_ == ri.station() && ring_ == ri.ring());
12 }
int ring_
Definition: GEMRing.h:65
int region_
Definition: GEMRing.h:63
int station_
Definition: GEMRing.h:64
int GEMRing::region ( ) const

Return the region number.

Definition at line 46 of file GEMRing.cc.

References region_.

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

46 { return region_; }
int region_
Definition: GEMRing.h:63
int GEMRing::ring ( ) const

Return the ring number.

Definition at line 50 of file GEMRing.cc.

References ring_.

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

50 { return ring_; }
int ring_
Definition: GEMRing.h:65
int GEMRing::station ( ) const

Return the station number.

Definition at line 48 of file GEMRing.cc.

References station_.

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

48 { return station_; }
int station_
Definition: GEMRing.h:64
const GEMSuperChamber * GEMRing::superChamber ( GEMDetId  id) const

Return the chamber corresponding to the given id.

Definition at line 27 of file GEMRing.cc.

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

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

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 }
int region() const
Return the region number.
Definition: GEMRing.cc:46
int station() const
Return the station number.
Definition: GEMRing.cc:48
int ring() const
Return the ring number.
Definition: GEMRing.cc:50
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:27
int ring_
Definition: GEMRing.h:65
int region_
Definition: GEMRing.h:63
int station_
Definition: GEMRing.h:64
const GEMSuperChamber * GEMRing::superChamber ( int  sch) const

Definition at line 33 of file GEMRing.cc.

References superChambers_.

33  {
34  for (auto sch : superChambers_) {
35  if (sch->id().chamber() == isch) {
36  return sch;
37  }
38  }
39  return nullptr;
40 }
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:70
const std::vector< const GEMSuperChamber * > & GEMRing::superChambers ( ) const

Return the chambers in the ring.

Definition at line 42 of file GEMRing.cc.

References superChambers_.

42 { return superChambers_; }
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:70

Member Data Documentation

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

Definition at line 67 of file GEMRing.h.

Referenced by ids().

int GEMRing::region_
private

Definition at line 63 of file GEMRing.h.

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

int GEMRing::ring_
private

Definition at line 65 of file GEMRing.h.

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

int GEMRing::station_
private

Definition at line 64 of file GEMRing.h.

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

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

Definition at line 70 of file GEMRing.h.

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