CMS 3D CMS Logo

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

List of all members.

Public Member Functions

int chamber () const
 Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
GEMDetId chamberId () const
 Return the corresponding ChamberId.
 GEMDetId ()
 GEMDetId (int region, int ring, int station, int layer, int chamber, int roll)
 Construct from fully qualified identifier.
 GEMDetId (uint32_t id)
 GEMDetId (DetId id)
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)
bool operator< (const GEMDetId &r) const
 Sort Operator based on the raw detector id.
int region () const
 Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
int ring () const
int roll () const
int station () const
 Station id : the station is the pair of chambers at same disk.

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

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_

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().

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().

                             :DetId(id){
  if (det()!=DetId::Muon || subdetId()!=MuonSubdetId::GEM) {
    throw cms::Exception("InvalidDetId") << "GEMDetId ctor:"
                                         << " det: " << det()
                                         << " subdet: " << subdetId()
                                         << " is not a valid GEM id";  
  }
}
GEMDetId::GEMDetId ( DetId  id)

Definition at line 20 of file GEMDetId.cc.

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

                          :DetId(id) {
  if (det()!=DetId::Muon || subdetId()!=MuonSubdetId::GEM) {
    throw cms::Exception("InvalidDetId") << "GEMDetId ctor:"
                                         << " det: " << det()
                                         << " subdet: " << subdetId()
                                         << " is not a valid GEM id";  
  }
}
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().


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.

                     {
    return int((id_>>ChamberStartBit_) & ChamberMask_) + (minChamberId+1);
  }
GEMDetId GEMDetId::chamberId ( ) const [inline]

Return the corresponding ChamberId.

Definition at line 86 of file GEMDetId.h.

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

                             {
    return GEMDetId(id_ & chamberIdMask_);
  }
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().

{
  if ( region     < minRegionId    || region    > maxRegionId ||
       ring       < minRingId      || ring      > maxRingId ||
       station    < minStationId   || station   > maxStationId ||
       layer      < minLayerId     || layer     > maxLayerId ||
       chamber    < minChamberId   || chamber   > maxChamberId ||
       roll       < minRollId      || roll      > maxRollId) {
    throw cms::Exception("InvalidDetId") << "GEMDetId ctor:" 
                                         << " Invalid parameters: " 
                                         << " region "<<region
                                         << " ring "<<ring
                                         << " station "<<station
                                         << " layer "<<layer
                                         << " chamber "<<chamber
                                         << " roll "<<roll
                                         << std::endl;
  }
  int regionInBits=region-minRegionId;
  int ringInBits = ring-minRingId;
  int stationInBits=station-minStationId;
  int layerInBits=layer-minLayerId;
  int chamberInBits=chamber-(minChamberId+1);
  int rollInBits=roll;
  
  id_ |= ( regionInBits    & RegionMask_)    << RegionStartBit_    | 
         ( ringInBits      & RingMask_)      << RingStartBit_      |
         ( stationInBits   & StationMask_)   << StationStartBit_   |
         ( layerInBits     & LayerMask_)     << LayerStartBit_     |
         ( chamberInBits   & ChamberMask_)    << ChamberStartBit_  |
         ( rollInBits      & RollMask_)      << RollStartBit_        ;
   
}
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<().

                   {
    return int((id_>>LayerStartBit_) & LayerMask_) + minLayerId;
  }
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().

                                           {
    if (r.station() == this->station()  ){
      if (this->layer() ==  r.layer()  ){
        return this->rawId()<r.rawId();
      }
      else{
        return (this->layer() < r.layer());
      }
    }
    else {
      return this->station() < r.station();
    }
  }
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 GEMSimAverage::simulateNoise().

                    {
    return int((id_>>RegionStartBit_) & RegionMask_) + minRegionId;
  }
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_.

                  {
      return int((id_>>RingStartBit_) & RingMask_) + minRingId;
  }
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().

                  {
    return int((id_>>RollStartBit_) & RollMask_); // value 0 is used as wild card
  }
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 operator<().

                     {
    return int((id_>>StationStartBit_) & StationMask_) + minStationId;
  }

Member Data Documentation

const uint32_t GEMDetId::chamberIdMask_ = ~(RollMask_<<RollStartBit_) [static, private]

Definition at line 134 of file GEMDetId.h.

Referenced by chamberId().

const unsigned int GEMDetId::ChamberMask_ = 0X3F [static, private]

Definition at line 124 of file GEMDetId.h.

Referenced by chamber(), and init().

const int GEMDetId::ChamberNumBits_ = 6 [static, private]

Definition at line 122 of file GEMDetId.h.

Definition at line 123 of file GEMDetId.h.

Referenced by chamber(), and init().

const unsigned int GEMDetId::LayerMask_ = 0X1 [static, private]

Definition at line 128 of file GEMDetId.h.

Referenced by init(), and layer().

const int GEMDetId::LayerNumBits_ = 1 [static, private]

Definition at line 126 of file GEMDetId.h.

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 init().

const int GEMDetId::maxLayerId = 2 [static]

Definition at line 103 of file GEMDetId.h.

Referenced by 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 init().

const int GEMDetId::maxRollId = 15 [static]

Definition at line 106 of file GEMDetId.h.

Referenced by init().

const int GEMDetId::maxStationId = 4 [static]

Definition at line 97 of file GEMDetId.h.

Referenced by init().

const int GEMDetId::minChamberId = 0 [static]

Definition at line 99 of file GEMDetId.h.

Referenced by chamber(), and init().

const int GEMDetId::minLayerId = 1 [static]

Definition at line 102 of file GEMDetId.h.

Referenced by 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 init(), and ring().

const int GEMDetId::minRollId = 0 [static]

Definition at line 105 of file GEMDetId.h.

const int GEMDetId::minStationId = 1 [static]

Definition at line 96 of file GEMDetId.h.

Referenced by init(), and station().

const int GEMDetId::RegionMask_ = 0X3 [static, private]

Definition at line 111 of file GEMDetId.h.

Referenced by init(), and region().

const int GEMDetId::RegionNumBits_ = 2 [static, private]

Definition at line 109 of file GEMDetId.h.

const int GEMDetId::RegionStartBit_ = 0 [static, private]

Definition at line 110 of file GEMDetId.h.

Referenced by init(), and region().

const unsigned int GEMDetId::RingMask_ = 0X7 [static, private]

Definition at line 115 of file GEMDetId.h.

Referenced by init(), and ring().

const int GEMDetId::RingNumBits_ = 3 [static, private]

Definition at line 113 of file GEMDetId.h.

Definition at line 114 of file GEMDetId.h.

Referenced by init(), and ring().

const unsigned int GEMDetId::RollMask_ = 0X1F [static, private]

Definition at line 132 of file GEMDetId.h.

Referenced by init(), and roll().

const int GEMDetId::RollNumBits_ = 5 [static, private]

Definition at line 130 of file GEMDetId.h.

const int GEMDetId::RollStartBit_ = LayerStartBit_+LayerNumBits_ [static, private]

Definition at line 131 of file GEMDetId.h.

Referenced by init(), and roll().

const unsigned int GEMDetId::StationMask_ = 0X7 [static, private]

Definition at line 119 of file GEMDetId.h.

Referenced by init(), and station().

const int GEMDetId::StationNumBits_ = 3 [static, private]

Definition at line 117 of file GEMDetId.h.

const int GEMDetId::StationStartBit_ = RingStartBit_+RingNumBits_ [static, private]

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.