test
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
GEMRing Class Reference

#include <GEMRing.h>

Public Member Functions

void add (GEMSuperChamber *ch)
 Add super chamber to the ring which takes ownership. More...
 
virtual const GeomDetcomponent (DetId id) const
 Return the sub-component (super chamber) with a given id in this ring. More...
 
virtual 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.

4  :
7  ring_(ring)
8 {}
int region() const
Return the region number.
Definition: GEMRing.cc:61
int station() const
Return the station number.
Definition: GEMRing.cc:65
int ring() const
Return the ring number.
Definition: GEMRing.cc:69
int ring_
Definition: GEMRing.h:67
int region_
Definition: GEMRing.h:65
int station_
Definition: GEMRing.h:66
GEMRing::~GEMRing ( )

destructor

Definition at line 10 of file GEMRing.cc.

10 {}

Member Function Documentation

void GEMRing::add ( GEMSuperChamber ch)

Add super chamber to the ring which takes ownership.

Definition at line 22 of file GEMRing.cc.

References superChambers_.

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

22  {
23  superChambers_.push_back(sch);
24 }
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:72
const GeomDet * GEMRing::component ( DetId  id) const
virtual

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

Definition at line 35 of file GEMRing.cc.

References superChamber().

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

Return the super chambers in the ring.

Definition at line 26 of file GEMRing.cc.

References mps_fire::result, and superChambers_.

26  {
27  std::vector<const GeomDet*> result;
28  for (auto sch : superChambers_) {
29  auto newSch(sch->components());
30  result.insert(result.end(), newSch.begin(), newSch.end());
31  }
32  return result;
33 }
tuple result
Definition: mps_fire.py:83
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:72
std::vector< GEMDetId > GEMRing::ids ( ) const

Return the vector of GEMDetIds in this ring.

Definition at line 12 of file GEMRing.cc.

References detIds_.

12  {
13  return detIds_;
14 }
std::vector< GEMDetId > detIds_
Definition: GEMRing.h:69
int GEMRing::nSuperChambers ( ) const

Return numbers of chambers.

Definition at line 57 of file GEMRing.cc.

References superChambers_.

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

equal if the id is the same

Definition at line 16 of file GEMRing.cc.

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

16  {
17  return ( region_ == ri.region() &&
18  station_ == ri.station() &&
19  ring_ == ri.ring() );
20 }
int ring_
Definition: GEMRing.h:67
int region_
Definition: GEMRing.h:65
int station_
Definition: GEMRing.h:66
int GEMRing::region ( ) const

Return the region number.

Definition at line 61 of file GEMRing.cc.

References region_.

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

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

Return the ring number.

Definition at line 69 of file GEMRing.cc.

References ring_.

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

69  {
70  return ring_;
71 }
int ring_
Definition: GEMRing.h:67
int GEMRing::station ( ) const

Return the station number.

Definition at line 65 of file GEMRing.cc.

References station_.

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

65  {
66  return station_;
67 }
int station_
Definition: GEMRing.h:66
const GEMSuperChamber * GEMRing::superChamber ( GEMDetId  id) const

Return the chamber corresponding to the given id.

Definition at line 39 of file GEMRing.cc.

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

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

39  {
40  if (id.region()!=region_ || id.station()!=station_ || id.ring()!=ring_) return 0; // not in this station
41  return superChamber(id.chamber());
42 }
int region() const
Return the region number.
Definition: GEMRing.cc:61
int station() const
Return the station number.
Definition: GEMRing.cc:65
int ring() const
Return the ring number.
Definition: GEMRing.cc:69
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:39
int ring_
Definition: GEMRing.h:67
int region_
Definition: GEMRing.h:65
int station_
Definition: GEMRing.h:66
const GEMSuperChamber * GEMRing::superChamber ( int  sch) const

Definition at line 44 of file GEMRing.cc.

References superChambers_.

44  {
45  for (auto sch : superChambers_) {
46  if (sch->id().chamber() == isch) {
47  return sch;
48  }
49  }
50  return 0;
51 }
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:72
const std::vector< const GEMSuperChamber * > & GEMRing::superChambers ( ) const

Return the chambers in the ring.

Definition at line 53 of file GEMRing.cc.

References superChambers_.

53  {
54  return superChambers_;
55 }
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:72

Member Data Documentation

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

Definition at line 69 of file GEMRing.h.

Referenced by ids().

int GEMRing::region_
private

Definition at line 65 of file GEMRing.h.

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

int GEMRing::ring_
private

Definition at line 67 of file GEMRing.h.

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

int GEMRing::station_
private

Definition at line 66 of file GEMRing.h.

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

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

Definition at line 72 of file GEMRing.h.

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