CMS 3D CMS Logo

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...
 
GEMDetId superChamberId () const
 Return the corresponding superChamberId. 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 = 2
 
static const int minChamberId = 0
 
static const int minLayerId = 0
 
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_ = 0X3
 
static const int LayerNumBits_ = 2
 
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_
 
static const uint32_t superChamberIdMask_ = chamberIdMask_ + ~(LayerMask_<<LayerStartBit_)
 

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(), and superChamberId().

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
GEMDetId GEMDetId::chamberId ( ) const
inline
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:136
static const int minRingId
Definition: GEMDetId.h:97
static const int minChamberId
Definition: GEMDetId.h:103
int roll() const
Definition: GEMDetId.h:80
static const int maxRollId
Definition: GEMDetId.h:111
int ring() const
Definition: GEMDetId.h:59
static const int minRegionId
Definition: GEMDetId.h:94
static const unsigned int StationMask_
Definition: GEMDetId.h:124
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:115
static const int maxChamberId
Definition: GEMDetId.h:104
static const int maxLayerId
Definition: GEMDetId.h:108
static const int StationStartBit_
Definition: GEMDetId.h:123
static const unsigned int RollMask_
Definition: GEMDetId.h:137
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:128
static const int LayerStartBit_
Definition: GEMDetId.h:132
static const int maxStationId
Definition: GEMDetId.h:101
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:120
static const int minStationId
Definition: GEMDetId.h:100
uint32_t id_
Definition: DetId.h:55
static const unsigned int ChamberMask_
Definition: GEMDetId.h:129
static const int RegionMask_
Definition: GEMDetId.h:116
static const int maxRingId
Definition: GEMDetId.h:98
static const int minLayerId
Definition: GEMDetId.h:107
static const int maxRegionId
Definition: GEMDetId.h:95
static const unsigned int LayerMask_
Definition: GEMDetId.h:133
static const int RingStartBit_
Definition: GEMDetId.h:119
int GEMDetId::layer ( ) const
inline
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
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_, createfilelist::int, minRingId, RingMask_, and RingStartBit_.

Referenced by geometryXMLparser.CSCAlignable::index(), DetIdInfo::info(), fireworks::info(), GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex(), GEMDigiMatcher::matchCoPadsToSimTrack(), GEMDigiMatcher::matchDigisToSimTrack(), GEMDigiMatcher::matchPadsToSimTrack(), GEMRecHitMatcher::matchRecHitsToSimTrack(), and SimHitMatcher::matchSimHitsToSimTrack().

59  {
60  return int((id_>>RingStartBit_) & RingMask_) + minRingId;
61  }
static const int minRingId
Definition: GEMDetId.h:97
static const unsigned int RingMask_
Definition: GEMDetId.h:120
uint32_t id_
Definition: DetId.h:55
static const int RingStartBit_
Definition: GEMDetId.h:119
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_, createfilelist::int, RollMask_, and RollStartBit_.

Referenced by GEMCoPadDigiValidation::analyze(), CSCMotherboardME11GEM::correlateLCTsGEM(), SimHitMatcher::hitPartitions(), init(), CSCMotherboardME21GEM::matchingGEMPads(), CSCMotherboardME11GEM::matchingGEMPads(), SimHitMatcher::matchSimHitsToSimTrack(), GEMRecHitMatcher::partitionNumbers(), GEMDigiMatcher::partitionNumbers(), and GEMDigiMatcher::partitionNumbersWithCoPads().

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

Return the corresponding superChamberId.

Definition at line 90 of file GEMDetId.h.

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

Referenced by GEMGeometryBuilderFromDDD::buildSuperChamber().

90  {
92  }
GEMDetId()
Definition: GEMDetId.cc:8
uint32_t id_
Definition: DetId.h:55
static const uint32_t superChamberIdMask_
Definition: GEMDetId.h:141

Member Data Documentation

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

Definition at line 139 of file GEMDetId.h.

Referenced by chamberId().

const unsigned int GEMDetId::ChamberMask_ = 0X3F
staticprivate

Definition at line 129 of file GEMDetId.h.

Referenced by chamber(), and init().

const int GEMDetId::ChamberNumBits_ = 6
staticprivate

Definition at line 127 of file GEMDetId.h.

const int GEMDetId::ChamberStartBit_ = StationStartBit_+StationNumBits_
staticprivate

Definition at line 128 of file GEMDetId.h.

Referenced by chamber(), and init().

const unsigned int GEMDetId::LayerMask_ = 0X3
staticprivate

Definition at line 133 of file GEMDetId.h.

Referenced by init(), and layer().

const int GEMDetId::LayerNumBits_ = 2
staticprivate

Definition at line 131 of file GEMDetId.h.

const int GEMDetId::LayerStartBit_ = ChamberStartBit_+ChamberNumBits_
staticprivate

Definition at line 132 of file GEMDetId.h.

Referenced by init(), and layer().

const int GEMDetId::maxChamberId = 36
static

Definition at line 104 of file GEMDetId.h.

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

const int GEMDetId::maxLayerId = 2
static
const int GEMDetId::maxRegionId = 1
static

Definition at line 95 of file GEMDetId.h.

Referenced by init(), FWRPZViewGeometry::showGEM(), and FW3DViewGeometry::showMuonEndcap().

const int GEMDetId::maxRingId = 3
static

Definition at line 98 of file GEMDetId.h.

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

const int GEMDetId::maxRollId = 15
static

Definition at line 111 of file GEMDetId.h.

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

const int GEMDetId::maxStationId = 2
static
const int GEMDetId::minChamberId = 0
static

Definition at line 103 of file GEMDetId.h.

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

const int GEMDetId::minLayerId = 0
static
const int GEMDetId::minRegionId = -1
static
const int GEMDetId::minRingId = 1
static

Definition at line 97 of file GEMDetId.h.

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

const int GEMDetId::minRollId = 0
static
const int GEMDetId::minStationId = 1
static
const int GEMDetId::RegionMask_ = 0X3
staticprivate

Definition at line 116 of file GEMDetId.h.

Referenced by init(), and region().

const int GEMDetId::RegionNumBits_ = 2
staticprivate

Definition at line 114 of file GEMDetId.h.

const int GEMDetId::RegionStartBit_ = 0
staticprivate

Definition at line 115 of file GEMDetId.h.

Referenced by init(), and region().

const unsigned int GEMDetId::RingMask_ = 0X7
staticprivate

Definition at line 120 of file GEMDetId.h.

Referenced by init(), and ring().

const int GEMDetId::RingNumBits_ = 3
staticprivate

Definition at line 118 of file GEMDetId.h.

const int GEMDetId::RingStartBit_ = RegionStartBit_+RegionNumBits_
staticprivate

Definition at line 119 of file GEMDetId.h.

Referenced by init(), and ring().

const unsigned int GEMDetId::RollMask_ = 0X1F
staticprivate

Definition at line 137 of file GEMDetId.h.

Referenced by init(), and roll().

const int GEMDetId::RollNumBits_ = 5
staticprivate

Definition at line 135 of file GEMDetId.h.

const int GEMDetId::RollStartBit_ = LayerStartBit_+LayerNumBits_
staticprivate

Definition at line 136 of file GEMDetId.h.

Referenced by init(), and roll().

const unsigned int GEMDetId::StationMask_ = 0X7
staticprivate

Definition at line 124 of file GEMDetId.h.

Referenced by init(), and station().

const int GEMDetId::StationNumBits_ = 3
staticprivate

Definition at line 122 of file GEMDetId.h.

const int GEMDetId::StationStartBit_ = RingStartBit_+RingNumBits_
staticprivate

Definition at line 123 of file GEMDetId.h.

Referenced by init(), and station().

const uint32_t GEMDetId::superChamberIdMask_ = chamberIdMask_ + ~(LayerMask_<<LayerStartBit_)
staticprivate

Definition at line 141 of file GEMDetId.h.

Referenced by superChamberId().

int GEMDetId::trind
private

Definition at line 151 of file GEMDetId.h.