CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
GEMDetId Class Reference

#include <GEMDetId.h>

Inheritance diagram for GEMDetId:
DetId

Public Member Functions

int chamber () const
 Chamber id: it identifies a chamber in a ring it goes from 1 to 36. More...
 
GEMDetId chamberId () const
 Return the corresponding ChamberId. More...
 
 GEMDetId ()
 
 GEMDetId (uint32_t id)
 
 GEMDetId (DetId id)
 
 GEMDetId (int region, int ring, int station, int layer, int chamber, int roll)
 Construct from fully qualified identifier. More...
 
int layer () const
 Layer id: each station have two layers of chambers: layer 1 is the inner chamber and layer 2 is the outer chamber (when present) More...
 
bool operator< (const GEMDetId &r) const
 Sort Operator based on the raw detector id. More...
 
int region () const
 Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap. More...
 
int ring () const
 
int roll () const
 
int station () const
 Station id : the station is the pair of chambers at same disk. More...
 
- Public Member Functions inherited from DetId
Detector det () const
 get the detector field from this detid More...
 
 DetId ()
 Create an empty or null id (also for persistence) More...
 
 DetId (uint32_t id)
 Create an id from a raw number. More...
 
 DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
bool null () const
 is this a null id ? More...
 
 operator uint32_t () const
 
bool operator!= (DetId id) const
 inequality More...
 
uint32_t operator() () const
 
bool operator< (DetId id) const
 comparison More...
 
bool operator== (DetId id) const
 equality More...
 
uint32_t rawId () const
 get the raw id More...
 
int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Static Public Attributes

static const int maxChamberId = 36
 
static const int maxLayerId = 2
 
static const int maxRegionId = 1
 
static const int maxRingId = 3
 
static const int maxRollId = 15
 
static const int maxStationId = 4
 
static const int minChamberId = 0
 
static const int minLayerId = 1
 
static const int minRegionId = -1
 
static const int minRingId = 1
 
static const int minRollId = 0
 
static const int minStationId = 1
 
- Static Public Attributes inherited from DetId
static const int kDetOffset = 28
 
static const int kSubdetOffset = 25
 

Private Member Functions

void init (int region, int ring, int station, int layer, int chamber, int roll)
 

Private Attributes

int trind
 

Static Private Attributes

static const uint32_t chamberIdMask_ = ~(RollMask_<<RollStartBit_)
 
static const unsigned int ChamberMask_ = 0X3F
 
static const int ChamberNumBits_ = 6
 
static const int ChamberStartBit_ = StationStartBit_+StationNumBits_
 
static const unsigned int LayerMask_ = 0X1
 
static const int LayerNumBits_ = 1
 
static const int LayerStartBit_ = ChamberStartBit_+ChamberNumBits_
 
static const int RegionMask_ = 0X3
 
static const int RegionNumBits_ = 2
 
static const int RegionStartBit_ = 0
 
static const unsigned int RingMask_ = 0X7
 
static const int RingNumBits_ = 3
 
static const int RingStartBit_ = RegionStartBit_+RegionNumBits_
 
static const unsigned int RollMask_ = 0X1F
 
static const int RollNumBits_ = 5
 
static const int RollStartBit_ = LayerStartBit_+LayerNumBits_
 
static const unsigned int StationMask_ = 0X7
 
static const int StationNumBits_ = 3
 
static const int StationStartBit_ = RingStartBit_+RingNumBits_
 

Additional Inherited Members

- Public Types inherited from DetId
enum  Detector {
  Tracker =1, Muon =2, Ecal =3, Hcal =4,
  Calo =5, Forward =6, VeryForward =7
}
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

DetUnit identifier for GEMs

Definition at line 16 of file GEMDetId.h.

Constructor & Destructor Documentation

GEMDetId::GEMDetId ( )

Definition at line 8 of file GEMDetId.cc.

Referenced by chamberId().

static const int GEM
Definition: MuonSubdetId.h:15
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
GEMDetId::GEMDetId ( uint32_t  id)

Construct from a packed id. It is required that the Detector part of id is Muon and the SubDet part is GEM, otherwise an exception is thrown.

Definition at line 11 of file GEMDetId.cc.

References DetId::det(), Exception, MuonSubdetId::GEM, DetId::Muon, and DetId::subdetId().

11  :DetId(id){
13  throw cms::Exception("InvalidDetId") << "GEMDetId ctor:"
14  << " det: " << det()
15  << " subdet: " << subdetId()
16  << " is not a valid GEM id";
17  }
18 }
static const int GEM
Definition: MuonSubdetId.h:15
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
GEMDetId::GEMDetId ( DetId  id)

Definition at line 20 of file GEMDetId.cc.

References DetId::det(), Exception, MuonSubdetId::GEM, DetId::Muon, and DetId::subdetId().

20  :DetId(id) {
22  throw cms::Exception("InvalidDetId") << "GEMDetId ctor:"
23  << " det: " << det()
24  << " subdet: " << subdetId()
25  << " is not a valid GEM id";
26  }
27 }
static const int GEM
Definition: MuonSubdetId.h:15
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
GEMDetId::GEMDetId ( int  region,
int  ring,
int  station,
int  layer,
int  chamber,
int  roll 
)

Construct from fully qualified identifier.

Definition at line 29 of file GEMDetId.cc.

References init().

29  :
31 {
33 }
static const int GEM
Definition: MuonSubdetId.h:15
int roll() const
Definition: GEMDetId.h:80
int ring() const
Definition: GEMDetId.h:59
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: GEMDetId.h:74
void init(int region, int ring, int station, int layer, int chamber, int roll)
Definition: GEMDetId.cc:36
int layer() const
Layer id: each station have two layers of chambers: layer 1 is the inner chamber and layer 2 is the o...
Definition: GEMDetId.h:69
int station() const
Station id : the station is the pair of chambers at same disk.
Definition: GEMDetId.h:64
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
Definition: GEMDetId.h:53

Member Function Documentation

int GEMDetId::chamber ( ) const
inline

Chamber id: it identifies a chamber in a ring it goes from 1 to 36.

Definition at line 74 of file GEMDetId.h.

References ChamberMask_, ChamberStartBit_, DetId::id_, and minChamberId.

Referenced by GEMSuperChamber::chamber(), MuonGEMDetLayerGeometryBuilder::isFront(), and GEMRecHitMatcher::matchRecHitsToSimTrack().

74  {
75  return int((id_>>ChamberStartBit_) & ChamberMask_) + (minChamberId+1);
76  }
static const int minChamberId
Definition: GEMDetId.h:99
static const int ChamberStartBit_
Definition: GEMDetId.h:123
uint32_t id_
Definition: DetId.h:55
static const unsigned int ChamberMask_
Definition: GEMDetId.h:124
GEMDetId GEMDetId::chamberId ( ) const
inline

Return the corresponding ChamberId.

Definition at line 86 of file GEMDetId.h.

References chamberIdMask_, GEMDetId(), and DetId::id_.

Referenced by GEMRecHitMatcher::matchRecHitsToSimTrack().

86  {
87  return GEMDetId(id_ & chamberIdMask_);
88  }
static const uint32_t chamberIdMask_
Definition: GEMDetId.h:134
GEMDetId()
Definition: GEMDetId.cc:8
uint32_t id_
Definition: DetId.h:55
void GEMDetId::init ( int  region,
int  ring,
int  station,
int  layer,
int  chamber,
int  roll 
)
private

Definition at line 36 of file GEMDetId.cc.

References ChamberMask_, ChamberStartBit_, Exception, DetId::id_, LayerMask_, LayerStartBit_, maxChamberId, maxLayerId, maxRegionId, maxRingId, maxRollId, maxStationId, minChamberId, minLayerId, minRegionId, minRingId, minStationId, RegionMask_, RegionStartBit_, RingMask_, RingStartBit_, roll(), RollMask_, RollStartBit_, StationMask_, and StationStartBit_.

Referenced by GEMDetId().

38 {
39  if ( region < minRegionId || region > maxRegionId ||
40  ring < minRingId || ring > maxRingId ||
41  station < minStationId || station > maxStationId ||
42  layer < minLayerId || layer > maxLayerId ||
43  chamber < minChamberId || chamber > maxChamberId ||
44  roll < minRollId || roll > maxRollId) {
45  throw cms::Exception("InvalidDetId") << "GEMDetId ctor:"
46  << " Invalid parameters: "
47  << " region "<<region
48  << " ring "<<ring
49  << " station "<<station
50  << " layer "<<layer
51  << " chamber "<<chamber
52  << " roll "<<roll
53  << std::endl;
54  }
55  int regionInBits=region-minRegionId;
56  int ringInBits = ring-minRingId;
57  int stationInBits=station-minStationId;
58  int layerInBits=layer-minLayerId;
59  int chamberInBits=chamber-(minChamberId+1);
60  int rollInBits=roll;
61 
62  id_ |= ( regionInBits & RegionMask_) << RegionStartBit_ |
63  ( ringInBits & RingMask_) << RingStartBit_ |
64  ( stationInBits & StationMask_) << StationStartBit_ |
65  ( layerInBits & LayerMask_) << LayerStartBit_ |
66  ( chamberInBits & ChamberMask_) << ChamberStartBit_ |
67  ( rollInBits & RollMask_) << RollStartBit_ ;
68 
69 }
static const int RollStartBit_
Definition: GEMDetId.h:131
static const int minRingId
Definition: GEMDetId.h:93
static const int minChamberId
Definition: GEMDetId.h:99
int roll() const
Definition: GEMDetId.h:80
static const int maxRollId
Definition: GEMDetId.h:106
int ring() const
Definition: GEMDetId.h:59
static const int minRegionId
Definition: GEMDetId.h:90
static const unsigned int StationMask_
Definition: GEMDetId.h:119
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: GEMDetId.h:74
static const int RegionStartBit_
Definition: GEMDetId.h:110
static const int maxChamberId
Definition: GEMDetId.h:100
static const int maxLayerId
Definition: GEMDetId.h:103
static const int StationStartBit_
Definition: GEMDetId.h:118
static const unsigned int RollMask_
Definition: GEMDetId.h:132
int layer() const
Layer id: each station have two layers of chambers: layer 1 is the inner chamber and layer 2 is the o...
Definition: GEMDetId.h:69
int station() const
Station id : the station is the pair of chambers at same disk.
Definition: GEMDetId.h:64
static const int ChamberStartBit_
Definition: GEMDetId.h:123
static const int LayerStartBit_
Definition: GEMDetId.h:127
static const int maxStationId
Definition: GEMDetId.h:97
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
Definition: GEMDetId.h:53
static const unsigned int RingMask_
Definition: GEMDetId.h:115
static const int minStationId
Definition: GEMDetId.h:96
uint32_t id_
Definition: DetId.h:55
static const unsigned int ChamberMask_
Definition: GEMDetId.h:124
static const int RegionMask_
Definition: GEMDetId.h:111
static const int maxRingId
Definition: GEMDetId.h:94
static const int minLayerId
Definition: GEMDetId.h:102
static const int maxRegionId
Definition: GEMDetId.h:91
static const unsigned int LayerMask_
Definition: GEMDetId.h:128
static const int RingStartBit_
Definition: GEMDetId.h:114
int GEMDetId::layer ( ) const
inline

Layer id: each station have two layers of chambers: layer 1 is the inner chamber and layer 2 is the outer chamber (when present)

Definition at line 69 of file GEMDetId.h.

References DetId::id_, LayerMask_, LayerStartBit_, and minLayerId.

Referenced by operator<().

69  {
70  return int((id_>>LayerStartBit_) & LayerMask_) + minLayerId;
71  }
static const int LayerStartBit_
Definition: GEMDetId.h:127
uint32_t id_
Definition: DetId.h:55
static const int minLayerId
Definition: GEMDetId.h:102
static const unsigned int LayerMask_
Definition: GEMDetId.h:128
bool GEMDetId::operator< ( const GEMDetId r) const
inline

Sort Operator based on the raw detector id.

Definition at line 38 of file GEMDetId.h.

References layer(), DetId::rawId(), and station().

38  {
39  if (r.station() == this->station() ){
40  if (this->layer() == r.layer() ){
41  return this->rawId()<r.rawId();
42  }
43  else{
44  return (this->layer() < r.layer());
45  }
46  }
47  else {
48  return this->station() < r.station();
49  }
50  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int layer() const
Layer id: each station have two layers of chambers: layer 1 is the inner chamber and layer 2 is the o...
Definition: GEMDetId.h:69
int station() const
Station id : the station is the pair of chambers at same disk.
Definition: GEMDetId.h:64
int GEMDetId::region ( ) const
inline

Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.

Definition at line 53 of file GEMDetId.h.

References DetId::id_, minRegionId, RegionMask_, and RegionStartBit_.

Referenced by GEMCheckGeometry::bookHistograms(), and GEMRecHitMatcher::matchRecHitsToSimTrack().

53  {
54  return int((id_>>RegionStartBit_) & RegionMask_) + minRegionId;
55  }
static const int minRegionId
Definition: GEMDetId.h:90
static const int RegionStartBit_
Definition: GEMDetId.h:110
uint32_t id_
Definition: DetId.h:55
static const int RegionMask_
Definition: GEMDetId.h:111
int GEMDetId::ring ( ) const
inline

Ring id: GEM are installed only on ring 1 the ring is the group of chambers with same r (distance of beam axis) and increasing phi

Definition at line 59 of file GEMDetId.h.

References DetId::id_, minRingId, RingMask_, and RingStartBit_.

Referenced by GEMRecHitMatcher::matchRecHitsToSimTrack().

59  {
60  return int((id_>>RingStartBit_) & RingMask_) + minRingId;
61  }
static const int minRingId
Definition: GEMDetId.h:93
static const unsigned int RingMask_
Definition: GEMDetId.h:115
uint32_t id_
Definition: DetId.h:55
static const int RingStartBit_
Definition: GEMDetId.h:114
int GEMDetId::roll ( ) const
inline

Roll id (also known as eta partition): each chamber is divided along the strip direction in several parts (rolls) GEM up to 10

Definition at line 80 of file GEMDetId.h.

References DetId::id_, RollMask_, and RollStartBit_.

Referenced by init(), and GEMRecHitMatcher::partitionNumbers().

80  {
81  return int((id_>>RollStartBit_) & RollMask_); // value 0 is used as wild card
82  }
static const int RollStartBit_
Definition: GEMDetId.h:131
static const unsigned int RollMask_
Definition: GEMDetId.h:132
uint32_t id_
Definition: DetId.h:55
int GEMDetId::station ( ) const
inline

Station id : the station is the pair of chambers at same disk.

Definition at line 64 of file GEMDetId.h.

References DetId::id_, minStationId, StationMask_, and StationStartBit_.

Referenced by GEMRecHitMatcher::matchRecHitsToSimTrack(), and operator<().

64  {
65  return int((id_>>StationStartBit_) & StationMask_) + minStationId;
66  }
static const unsigned int StationMask_
Definition: GEMDetId.h:119
static const int StationStartBit_
Definition: GEMDetId.h:118
static const int minStationId
Definition: GEMDetId.h:96
uint32_t id_
Definition: DetId.h:55

Member Data Documentation

const uint32_t GEMDetId::chamberIdMask_ = ~(RollMask_<<RollStartBit_)
staticprivate

Definition at line 134 of file GEMDetId.h.

Referenced by chamberId().

const unsigned int GEMDetId::ChamberMask_ = 0X3F
staticprivate

Definition at line 124 of file GEMDetId.h.

Referenced by chamber(), and init().

const int GEMDetId::ChamberNumBits_ = 6
staticprivate

Definition at line 122 of file GEMDetId.h.

const int GEMDetId::ChamberStartBit_ = StationStartBit_+StationNumBits_
staticprivate

Definition at line 123 of file GEMDetId.h.

Referenced by chamber(), and init().

const unsigned int GEMDetId::LayerMask_ = 0X1
staticprivate

Definition at line 128 of file GEMDetId.h.

Referenced by init(), and layer().

const int GEMDetId::LayerNumBits_ = 1
staticprivate

Definition at line 126 of file GEMDetId.h.

const int GEMDetId::LayerStartBit_ = ChamberStartBit_+ChamberNumBits_
staticprivate

Definition at line 127 of file GEMDetId.h.

Referenced by init(), and layer().

const int GEMDetId::maxChamberId = 36
static

Definition at line 100 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(), and init().

const int GEMDetId::maxLayerId = 2
static

Definition at line 103 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(), and init().

const int GEMDetId::maxRegionId = 1
static

Definition at line 91 of file GEMDetId.h.

Referenced by init().

const int GEMDetId::maxRingId = 3
static

Definition at line 94 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(), and init().

const int GEMDetId::maxRollId = 15
static

Definition at line 106 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(), and init().

const int GEMDetId::maxStationId = 4
static

Definition at line 97 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(), and init().

const int GEMDetId::minChamberId = 0
static

Definition at line 99 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(), chamber(), and init().

const int GEMDetId::minLayerId = 1
static

Definition at line 102 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(), init(), and layer().

const int GEMDetId::minRegionId = -1
static

Definition at line 90 of file GEMDetId.h.

Referenced by init(), and region().

const int GEMDetId::minRingId = 1
static

Definition at line 93 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(), init(), and ring().

const int GEMDetId::minRollId = 0
static

Definition at line 105 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers().

const int GEMDetId::minStationId = 1
static

Definition at line 96 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers(), init(), and station().

const int GEMDetId::RegionMask_ = 0X3
staticprivate

Definition at line 111 of file GEMDetId.h.

Referenced by init(), and region().

const int GEMDetId::RegionNumBits_ = 2
staticprivate

Definition at line 109 of file GEMDetId.h.

const int GEMDetId::RegionStartBit_ = 0
staticprivate

Definition at line 110 of file GEMDetId.h.

Referenced by init(), and region().

const unsigned int GEMDetId::RingMask_ = 0X7
staticprivate

Definition at line 115 of file GEMDetId.h.

Referenced by init(), and ring().

const int GEMDetId::RingNumBits_ = 3
staticprivate

Definition at line 113 of file GEMDetId.h.

const int GEMDetId::RingStartBit_ = RegionStartBit_+RegionNumBits_
staticprivate

Definition at line 114 of file GEMDetId.h.

Referenced by init(), and ring().

const unsigned int GEMDetId::RollMask_ = 0X1F
staticprivate

Definition at line 132 of file GEMDetId.h.

Referenced by init(), and roll().

const int GEMDetId::RollNumBits_ = 5
staticprivate

Definition at line 130 of file GEMDetId.h.

const int GEMDetId::RollStartBit_ = LayerStartBit_+LayerNumBits_
staticprivate

Definition at line 131 of file GEMDetId.h.

Referenced by init(), and roll().

const unsigned int GEMDetId::StationMask_ = 0X7
staticprivate

Definition at line 119 of file GEMDetId.h.

Referenced by init(), and station().

const int GEMDetId::StationNumBits_ = 3
staticprivate

Definition at line 117 of file GEMDetId.h.

const int GEMDetId::StationStartBit_ = RingStartBit_+RingNumBits_
staticprivate

Definition at line 118 of file GEMDetId.h.

Referenced by init(), and station().

int GEMDetId::trind
private

Definition at line 144 of file GEMDetId.h.