CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes
GEMDetId Class Reference

#include <GEMDetId.h>

Inheritance diagram for GEMDetId:
DetId

Public Member Functions

int chamber () const
 
GEMDetId chamberId () const
 
 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
 
GEMDetId layerId () const
 
int nlayers () const
 
bool operator!= (const GEMDetId &gen) const
 
bool operator< (const GEMDetId &r) const
 
GEMDetIdoperator= (const DetId &gen)
 
bool operator== (const GEMDetId &gen) const
 
int region () const
 
int ring () const
 
int roll () const
 
int station () const
 
GEMDetId superChamberId () const
 
bool v11Format () const
 
uint32_t v12Form () const
 
- Public Member Functions inherited from DetId
constexpr Detector det () const
 get the detector field from this detid More...
 
constexpr DetId ()
 Create an empty or null id (also for persistence) More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. More...
 
constexpr DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr bool null () const
 is this a null id ? More...
 
constexpr operator uint32_t () const
 
constexpr bool operator!= (DetId id) const
 inequality More...
 
constexpr uint32_t operator() () const
 
constexpr bool operator< (DetId id) const
 comparison More...
 
constexpr bool operator== (DetId id) const
 equality More...
 
constexpr uint32_t rawId () const
 get the raw id More...
 
constexpr int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Static Public Member Functions

static uint32_t v12Form (const uint32_t &inpid)
 

Static Public Attributes

static int32_t maxChamberId = 36
 
static int32_t maxLayerId = 2
 
static int32_t maxLayerId0 = 6
 
static int32_t maxRegionId = 1
 
static int32_t maxRingId = 3
 
static int32_t maxRollId = 15
 
static int32_t maxStationId = 2
 
static int32_t minChamberId = 0
 
static int32_t minLayerId = 0
 
static int32_t minRegionId = -1
 
static int32_t minRingId = 1
 
static int32_t minRollId = 0
 
static int32_t minStationId = 1
 
static int32_t minStationId0 = 0
 
- Static Public Attributes inherited from DetId
static const int kDetMask = 0xF
 
static const int kDetOffset = 28
 
static const int kSubdetMask = 0x7
 
static const int kSubdetOffset = 25
 

Private Member Functions

void v12FromV11 (const uint32_t &rawid)
 

Static Private Member Functions

static void unpackId (const uint32_t &rawid, int &region, int &ring, int &station, int &layer, int &chamber, int &roll)
 

Static Private Attributes

static uint32_t chamberIdMask = ~(RollMask << RollStartBit)
 
static uint32_t ChamberMask = 0x3F
 
static uint32_t ChamberNumBits = 6
 
static uint32_t ChamberStartBit = StationStartBit + StationNumBits
 
static uint32_t ChamberStartBitM = RegionStartBit + RegionNumBits
 
static uint32_t FormatMask = 0x1
 
static uint32_t FormatNumBits = 1
 
static uint32_t FormatStartBit = RollStartBit + RollNumBits
 
static uint32_t kGEMIdFormat = 0x1000000
 
static uint32_t kMuonIdMask = 0xF0000000
 
static uint32_t LayerMask = 0x1F
 
static uint32_t LayerMaskP = 0x3
 
static uint32_t LayerNumBits = 5
 
static uint32_t LayerNumBitsP = 2
 
static uint32_t LayerStartBit = ChamberStartBit + ChamberNumBits
 
static uint32_t LayerStartBitM = ChamberStartBitM + ChamberNumBits
 
static uint32_t RegionMask = 0x3
 
static uint32_t RegionNumBits = 2
 
static uint32_t RegionStartBit = 0
 
static uint32_t RingMask = 0x7
 
static uint32_t RingNumBits = 3
 
static uint32_t RingStartBit = RegionStartBit + RegionNumBits
 
static uint32_t RollMask = 0x1F
 
static uint32_t RollNumBits = 5
 
static uint32_t RollStartBit = LayerStartBit + LayerNumBits
 
static uint32_t RollStartBitM = LayerStartBitM + LayerNumBits
 
static uint32_t RollStartBitP = LayerStartBit + LayerNumBitsP
 
static uint32_t StationMask = 0x7
 
static uint32_t StationNumBits = 3
 
static uint32_t StationStartBit = RingStartBit + RingNumBits
 
static 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, HGCalEE = 8,
  HGCalHSi = 9, HGCalHSc = 10, HGCalTrigger = 11
}
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

DetUnit identifier for GEMs

Definition at line 17 of file GEMDetId.h.

Constructor & Destructor Documentation

GEMDetId::GEMDetId ( )
inline

Create a null detId

Definition at line 70 of file GEMDetId.h.

Referenced by chamberId(), layerId(), and superChamberId().

static constexpr int GEM
Definition: MuonSubdetId.h:14
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
GEMDetId::GEMDetId ( uint32_t  id)
inline

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 73 of file GEMDetId.h.

References DetId::det(), Exception, MuonSubdetId::GEM, DetId::id_, MuonSubdetId::ME0, DetId::Muon, DetId::subdetId(), v11Format(), and v12Form().

73  : DetId(id) {
75  throw cms::Exception("InvalidDetId")
76  << "GEMDetId ctor: det: " << det() << " subdet: " << subdetId() << " is not a valid GEM id\n";
77 
78  if (v11Format())
79  id_ = v12Form(id);
80  }
static constexpr int GEM
Definition: MuonSubdetId.h:14
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr int ME0
Definition: MuonSubdetId.h:15
uint32_t v12Form() const
Definition: GEMDetId.h:206
bool v11Format() const
Definition: GEMDetId.h:162
uint32_t id_
Definition: DetId.h:69
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
GEMDetId::GEMDetId ( DetId  id)
inline

Construct from a generic cell ID

Definition at line 82 of file GEMDetId.h.

References DetId::det(), Exception, MuonSubdetId::GEM, DetId::id_, MuonSubdetId::ME0, DetId::Muon, DetId::rawId(), DetId::subdetId(), v11Format(), and v12Form().

82  : DetId(id) {
84  throw cms::Exception("InvalidDetId")
85  << "GEMDetId ctor: det: " << det() << " subdet: " << subdetId() << " is not a valid GEM id\n";
86  if (v11Format())
87  id_ = v12Form(id.rawId());
88  }
static constexpr int GEM
Definition: MuonSubdetId.h:14
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr int ME0
Definition: MuonSubdetId.h:15
uint32_t v12Form() const
Definition: GEMDetId.h:206
bool v11Format() const
Definition: GEMDetId.h:162
uint32_t id_
Definition: DetId.h:69
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
GEMDetId::GEMDetId ( int  region,
int  ring,
int  station,
int  layer,
int  chamber,
int  roll 
)
inline

Construct from fully qualified identifier.

Definition at line 90 of file GEMDetId.h.

References ChamberMask, Exception, DetId::id_, kGEMIdFormat, minLayerId, minRegionId, minRingId, minStationId0, RegionMask, roll(), and StationMask.

92  if (region < minRegionId || region > maxRegionId || ring < minRingId || ring > maxRingId ||
93  station < minStationId0 || station > maxStationId || layer < minLayerId || layer > maxLayerId0 ||
94  chamber < minChamberId || chamber > maxChamberId || roll < minRollId || roll > maxRollId)
95  throw cms::Exception("InvalidDetId")
96  << "GEMDetId ctor: Invalid parameters: region " << region << " ring " << ring << " station " << station
97  << " layer " << layer << " chamber " << chamber << " roll " << roll << std::endl;
98 
99  int regionInBits = region - minRegionId;
100  int ringInBits = ring - minRingId;
101  int stationInBits = station - minStationId0;
102  int layerInBits = layer - minLayerId;
103  int chamberInBits = chamber - (minChamberId + 1);
104  int rollInBits = roll;
105 
106  id_ |= ((regionInBits & RegionMask) << RegionStartBit | (ringInBits & RingMask) << RingStartBit |
107  (stationInBits & StationMask) << StationStartBit | (layerInBits & LayerMask) << LayerStartBit |
108  (chamberInBits & ChamberMask) << ChamberStartBit | (rollInBits & RollMask) << RollStartBit | kGEMIdFormat);
109  }
static int32_t maxRollId
Definition: GEMDetId.h:33
static constexpr int GEM
Definition: MuonSubdetId.h:14
static uint32_t RollStartBit
Definition: GEMDetId.h:56
static int32_t maxLayerId0
Definition: GEMDetId.h:30
static uint32_t LayerStartBit
Definition: GEMDetId.h:51
int roll() const
Definition: GEMDetId.h:188
int ring() const
Definition: GEMDetId.h:170
static int32_t maxStationId
Definition: GEMDetId.h:26
static int32_t minRegionId
Definition: GEMDetId.h:19
static uint32_t StationStartBit
Definition: GEMDetId.h:43
int chamber() const
Definition: GEMDetId.h:177
static uint32_t StationMask
Definition: GEMDetId.h:44
static int32_t minStationId0
Definition: GEMDetId.h:23
static uint32_t RingStartBit
Definition: GEMDetId.h:40
static uint32_t RegionStartBit
Definition: GEMDetId.h:37
static uint32_t RegionMask
Definition: GEMDetId.h:38
static uint32_t kGEMIdFormat
Definition: GEMDetId.h:63
int layer() const
Definition: GEMDetId.h:184
int station() const
Definition: GEMDetId.h:173
static int32_t maxChamberId
Definition: GEMDetId.h:28
static uint32_t RingMask
Definition: GEMDetId.h:41
std::bitset< maskSIZE > RollMask
Definition: RPCRollMask.h:7
int region() const
Definition: GEMDetId.h:165
static int32_t minRingId
Definition: GEMDetId.h:21
uint32_t id_
Definition: DetId.h:69
static uint32_t LayerMask
Definition: GEMDetId.h:53
static int32_t maxRegionId
Definition: GEMDetId.h:20
static int32_t maxRingId
Definition: GEMDetId.h:22
static uint32_t ChamberStartBit
Definition: GEMDetId.h:46
static int32_t minLayerId
Definition: GEMDetId.h:29
static uint32_t ChamberMask
Definition: GEMDetId.h:48
static int32_t minChamberId
Definition: GEMDetId.h:27
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

Member Function Documentation

int GEMDetId::chamber ( ) const
inline
GEMDetId GEMDetId::chamberId ( ) const
inline
int GEMDetId::layer ( ) const
inline

Layer id: each station have two layers of chambers for GE1 and GE2: layer 1 is the inner chamber and layer 2 is the outer chamber For ME0 there are 6 layers of chambers

Definition at line 184 of file GEMDetId.h.

References DetId::id_.

Referenced by GEMDQMSource::analyze(), GEMDQMStatusDigi::analyze(), GEMDQMSourceDigi::bookHistograms(), GEMDQMSource::bookHistograms(), GEMDQMStatusDigi::bookHistogramsChamberPart(), GEMDQMStatusDigi::bookHistogramsStationPart(), GEMGeometryBuilderFromCondDB::build(), GEMGeometryBuilderFromDDD::build(), GEMGeometryParsFromDD::buildGeometry(), reco::HitPattern::encode(), GEMCSCSegFit::fit2(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), DetIdInfo::info(), fireworks::info(), EMTFGEMDetId::layer(), GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex(), EMTFSubsystemCollector::make_copad_gem(), GEMSimHitMatcher::matchSimHitsToSimTrack(), SimHitMatcher::matchSimHitsToSimTrack(), GEMDigiMatcher::nLayersWithDigisInSuperChamber(), GEMDigiMatcher::nLayersWithPadsInSuperChamber(), operator!=(), operator<(), operator==(), GEMDQMStatusDigi::seekIdxSummary(), GEMDQMStatusDigi::SetInfoChambers(), and v12Form().

184 { return (static_cast<int>((id_ >> LayerStartBit) & LayerMask) + minLayerId); }
static uint32_t LayerStartBit
Definition: GEMDetId.h:51
uint32_t id_
Definition: DetId.h:69
static uint32_t LayerMask
Definition: GEMDetId.h:53
static int32_t minLayerId
Definition: GEMDetId.h:29
GEMDetId GEMDetId::layerId ( ) const
inline

Return the corresponding LayerId (mask eta partition)

Definition at line 199 of file GEMDetId.h.

References GEMDetId(), and DetId::id_.

199 { return GEMDetId(id_ & chamberIdMask); }
GEMDetId()
Definition: GEMDetId.h:70
static uint32_t chamberIdMask
Definition: GEMDetId.h:65
uint32_t id_
Definition: DetId.h:69
int GEMDetId::nlayers ( ) const
inline

Return total # of layers for this type of detector

Definition at line 202 of file GEMDetId.h.

References station().

202  {
203  return ((station() == 0) ? maxLayerId0 : ((station() > maxStationId) ? 0 : maxLayerId));
204  }
static int32_t maxLayerId0
Definition: GEMDetId.h:30
static int32_t maxStationId
Definition: GEMDetId.h:26
int station() const
Definition: GEMDetId.h:173
static int32_t maxLayerId
Definition: GEMDetId.h:31
bool GEMDetId::operator!= ( const GEMDetId gen) const
inline

Definition at line 138 of file GEMDetId.h.

References chamber(), DetId::id_, layer(), DetId::rawId(), region(), ring(), roll(), station(), and unpackId().

138  {
139  uint32_t rawid = gen.rawId();
140  if (rawid == id_)
141  return false;
142  int reg(0), ri(0), stn(-1), lay(0), chamb(0), rol(0);
143  unpackId(rawid, reg, ri, stn, lay, chamb, rol);
144  return (((id_ & kMuonIdMask) != (rawid & kMuonIdMask)) || (reg != region()) || (ri != ring()) ||
145  (stn != station()) || (lay != layer()) || (chamb != chamber()) || (rol != roll()));
146  }
int roll() const
Definition: GEMDetId.h:188
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int ring() const
Definition: GEMDetId.h:170
int chamber() const
Definition: GEMDetId.h:177
int layer() const
Definition: GEMDetId.h:184
int station() const
Definition: GEMDetId.h:173
int region() const
Definition: GEMDetId.h:165
static uint32_t kMuonIdMask
Definition: GEMDetId.h:64
uint32_t id_
Definition: DetId.h:69
static void unpackId(const uint32_t &rawid, int &region, int &ring, int &station, int &layer, int &chamber, int &roll)
Definition: GEMDetId.h:232
bool GEMDetId::operator< ( const GEMDetId r) const
inline

Sort Operator based on the raw detector id

Definition at line 149 of file GEMDetId.h.

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

149  {
150  if (r.station() == this->station()) {
151  if (this->layer() == r.layer()) {
152  return this->rawId() < r.rawId();
153  } else {
154  return (this->layer() < r.layer());
155  }
156  } else {
157  return this->station() < r.station();
158  }
159  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int layer() const
Definition: GEMDetId.h:184
int station() const
Definition: GEMDetId.h:173
GEMDetId& GEMDetId::operator= ( const DetId gen)
inline

Assignment from a generic cell id

Definition at line 112 of file GEMDetId.h.

References TauDecayModes::dec, DetId::det(), Exception, MuonSubdetId::GEM, DetId::id_, MuonSubdetId::ME0, DetId::null(), DetId::rawId(), DetId::subdetId(), v11Format(), and v12Form().

112  {
113  if (!gen.null()) {
114  int subdet = gen.subdetId();
115  if (gen.det() != Muon || (subdet != MuonSubdetId::GEM && subdet != MuonSubdetId::ME0))
116  throw cms::Exception("InvalidDetId")
117  << "GEMDetId ctor: Cannot assign GEMDetID from " << std::hex << gen.rawId() << std::dec;
118  if (v11Format())
119  id_ = v12Form(gen.rawId());
120  else
121  id_ = gen.rawId();
122  } else {
123  id_ = gen.rawId();
124  }
125  return (*this);
126  }
static constexpr int GEM
Definition: MuonSubdetId.h:14
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Definition: Muon.py:1
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr int ME0
Definition: MuonSubdetId.h:15
uint32_t v12Form() const
Definition: GEMDetId.h:206
bool v11Format() const
Definition: GEMDetId.h:162
uint32_t id_
Definition: DetId.h:69
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
bool GEMDetId::operator== ( const GEMDetId gen) const
inline

Comparison operator

Definition at line 129 of file GEMDetId.h.

References chamber(), DetId::id_, layer(), DetId::rawId(), region(), ring(), roll(), station(), and unpackId().

129  {
130  uint32_t rawid = gen.rawId();
131  if (rawid == id_)
132  return true;
133  int reg(0), ri(0), stn(-1), lay(0), chamb(0), rol(0);
134  unpackId(rawid, reg, ri, stn, lay, chamb, rol);
135  return (((id_ & kMuonIdMask) == (rawid & kMuonIdMask)) && (reg == region()) && (ri == ring()) &&
136  (stn == station()) && (lay == layer()) && (chamb == chamber()) && (rol == roll()));
137  }
int roll() const
Definition: GEMDetId.h:188
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int ring() const
Definition: GEMDetId.h:170
int chamber() const
Definition: GEMDetId.h:177
int layer() const
Definition: GEMDetId.h:184
int station() const
Definition: GEMDetId.h:173
int region() const
Definition: GEMDetId.h:165
static uint32_t kMuonIdMask
Definition: GEMDetId.h:64
uint32_t id_
Definition: DetId.h:69
static void unpackId(const uint32_t &rawid, int &region, int &ring, int &station, int &layer, int &chamber, int &roll)
Definition: GEMDetId.h:232
int GEMDetId::region ( ) const
inline
int GEMDetId::ring ( ) const
inline
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 12

Definition at line 188 of file GEMDetId.h.

References DetId::id_.

Referenced by GEMDQMSourceDigi::analyze(), GEMDQMSource::analyze(), GEMDQMStatusDigi::analyze(), GEMGeometryBuilderFromCondDB::build(), GEMDetId(), CSCGEMMotherboard::getRoll(), GEMSimHitMatcher::hitPartitions(), SimHitMatcher::hitPartitions(), GEMSimHitMatcher::matchSimHitsToSimTrack(), SimHitMatcher::matchSimHitsToSimTrack(), operator!=(), operator==(), GEMRecHitMatcher::partitionNumbers(), GEMDigiMatcher::partitionNumbers(), GEMDigiMatcher::partitionNumbersWithCoPads(), EMTFGEMDetId::roll(), and v12Form().

188  {
189  return (static_cast<int>((id_ >> RollStartBit) & RollMask)); // value 0 is used as wild card
190  }
static uint32_t RollStartBit
Definition: GEMDetId.h:56
std::bitset< maskSIZE > RollMask
Definition: RPCRollMask.h:7
uint32_t id_
Definition: DetId.h:69
int GEMDetId::station ( ) const
inline

Station id : the station is the set of chambers at same disk

Definition at line 173 of file GEMDetId.h.

References DetId::id_.

Referenced by GEMDQMSource::analyze(), GEMDQMStatusDigi::analyze(), CSCGEMMotherboard::bestMatchingPad(), GEMDQMSourceDigi::bookHistograms(), GEMDQMSource::bookHistograms(), GEMDQMStatusDigi::bookHistogramsChamberPart(), GEMDQMStatusDigi::bookHistogramsStationPart(), GEMSimHitMatcher::chamberIds(), GEMSimHitMatcher::detIds(), reco::HitPattern::encode(), GlobalMuonRefitter::getFirstHits(), GlobalMuonRefitter::getRidOfSelectStationHits(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), DetIdInfo::info(), fireworks::info(), GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex(), GEMDigiMatcher::matchCoPadsToSimTrack(), GEMDigiMatcher::matchDigisToSimTrack(), CSCGEMMotherboard::matchingPads(), GEMDigiMatcher::matchPadsToSimTrack(), GEMRecHitMatcher::matchRecHitsToSimTrack(), GEMSimHitMatcher::matchSimHitsToSimTrack(), SimHitMatcher::matchSimHitsToSimTrack(), nlayers(), operator!=(), operator<(), operator==(), GEMDQMStatusDigi::seekIdxSummary(), GEMDQMStatusDigi::SetInfoChambers(), TAMuonChamberMatch::station(), EMTFGEMDetId::station(), reco::MuonChamberMatch::station(), and v12Form().

173 { return (static_cast<int>((id_ >> StationStartBit) & StationMask) + minStationId0); }
static uint32_t StationStartBit
Definition: GEMDetId.h:43
static uint32_t StationMask
Definition: GEMDetId.h:44
static int32_t minStationId0
Definition: GEMDetId.h:23
uint32_t id_
Definition: DetId.h:69
GEMDetId GEMDetId::superChamberId ( ) const
inline

Return the corresponding superChamberId

Definition at line 196 of file GEMDetId.h.

References GEMDetId(), and DetId::id_.

Referenced by GEMGeometryBuilderFromCondDB::build(), GEMGeometryParsFromDD::buildSuperChamber(), GEMGeometryBuilderFromDDD::buildSuperChamber(), and GEMSimHitMatcher::superChamberIdsCoincidences().

196 { return GEMDetId(id_ & superChamberIdMask); }
GEMDetId()
Definition: GEMDetId.h:70
uint32_t id_
Definition: DetId.h:69
static uint32_t superChamberIdMask
Definition: GEMDetId.h:66
static void GEMDetId::unpackId ( const uint32_t &  rawid,
int &  region,
int &  ring,
int &  station,
int &  layer,
int &  chamber,
int &  roll 
)
inlinestaticprivate

Definition at line 232 of file GEMDetId.h.

References ChamberStartBit, ChamberStartBitM, MuonSubdetId::GEM, DetId::kDetMask, DetId::kDetOffset, DetId::kSubdetMask, DetId::kSubdetOffset, LayerStartBit, LayerStartBitM, MuonSubdetId::ME0, minChamberId, minLayerId, minRegionId, minRingId, minStationId, minStationId0, DetId::Muon, operator<<(), RegionStartBit, RingStartBit, RollStartBit, RollStartBitM, RollStartBitP, and StationStartBit.

Referenced by operator!=(), operator==(), and v12Form().

233  {
234  if (((rawid >> DetId::kDetOffset) & DetId::kDetMask) == DetId::Muon) {
235  int subdet = ((rawid >> DetId::kSubdetOffset) & DetId::kSubdetMask);
236  if (subdet == MuonSubdetId::GEM) {
237  region = static_cast<int>(((rawid >> RegionStartBit) & RegionMask) + minRegionId);
238  ring = (static_cast<int>((rawid >> RingStartBit) & RingMask) + minRingId);
239  chamber = (static_cast<int>((rawid >> ChamberStartBit) & ChamberMask) + (minChamberId + 1));
240  if ((rawid & kGEMIdFormat) == 0) {
241  station = (static_cast<int>((rawid >> StationStartBit) & StationMask) + minStationId);
242  layer = (static_cast<int>((rawid >> LayerStartBit) & LayerMaskP) + minLayerId);
243  roll = (static_cast<int>((rawid >> RollStartBitP) & RollMask));
244  } else {
245  station = (static_cast<int>((rawid >> StationStartBit) & StationMask) + minStationId0);
246  layer = (static_cast<int>((rawid >> LayerStartBit) & LayerMask) + minLayerId);
247  roll = (static_cast<int>((rawid >> RollStartBit) & RollMask));
248  }
249  } else if (subdet == MuonSubdetId::ME0) {
250  region = static_cast<int>(((rawid >> RegionStartBit) & RegionMask) + minRegionId);
251  ring = 1;
252  station = 0;
253  chamber = (static_cast<int>((rawid >> ChamberStartBitM) & ChamberMask) + (minChamberId));
254  layer = (static_cast<int>((rawid >> LayerStartBitM) & LayerMask) + minLayerId);
255  roll = (static_cast<int>((rawid >> RollStartBitM) & RollMask));
256  }
257  }
258  }
static uint32_t RollStartBitM
Definition: GEMDetId.h:58
static constexpr int GEM
Definition: MuonSubdetId.h:14
static uint32_t LayerStartBitM
Definition: GEMDetId.h:52
static uint32_t RollStartBit
Definition: GEMDetId.h:56
static uint32_t ChamberStartBitM
Definition: GEMDetId.h:47
static uint32_t LayerStartBit
Definition: GEMDetId.h:51
int roll() const
Definition: GEMDetId.h:188
int ring() const
Definition: GEMDetId.h:170
static int32_t minRegionId
Definition: GEMDetId.h:19
static uint32_t StationStartBit
Definition: GEMDetId.h:43
static const int kSubdetOffset
Definition: DetId.h:22
int chamber() const
Definition: GEMDetId.h:177
static uint32_t StationMask
Definition: GEMDetId.h:44
static int32_t minStationId0
Definition: GEMDetId.h:23
static const int kSubdetMask
Definition: DetId.h:20
static uint32_t RingStartBit
Definition: GEMDetId.h:40
static uint32_t RegionStartBit
Definition: GEMDetId.h:37
static uint32_t RegionMask
Definition: GEMDetId.h:38
static uint32_t kGEMIdFormat
Definition: GEMDetId.h:63
int layer() const
Definition: GEMDetId.h:184
int station() const
Definition: GEMDetId.h:173
static uint32_t RingMask
Definition: GEMDetId.h:41
static constexpr int ME0
Definition: MuonSubdetId.h:15
std::bitset< maskSIZE > RollMask
Definition: RPCRollMask.h:7
int region() const
Definition: GEMDetId.h:165
static int32_t minRingId
Definition: GEMDetId.h:21
static uint32_t LayerMaskP
Definition: GEMDetId.h:54
static const int kDetMask
Definition: DetId.h:19
static uint32_t LayerMask
Definition: GEMDetId.h:53
static const int kDetOffset
Definition: DetId.h:21
static int32_t minStationId
Definition: GEMDetId.h:24
static uint32_t ChamberStartBit
Definition: GEMDetId.h:46
static int32_t minLayerId
Definition: GEMDetId.h:29
static uint32_t ChamberMask
Definition: GEMDetId.h:48
static uint32_t RollStartBitP
Definition: GEMDetId.h:57
static int32_t minChamberId
Definition: GEMDetId.h:27
bool GEMDetId::v11Format ( ) const
inline

Check the format

Definition at line 162 of file GEMDetId.h.

References DetId::id_.

Referenced by GEMDetId(), and operator=().

162 { return ((id_ & kGEMIdFormat) == 0); }
static uint32_t kGEMIdFormat
Definition: GEMDetId.h:63
uint32_t id_
Definition: DetId.h:69
uint32_t GEMDetId::v12Form ( ) const
inline

Definition at line 206 of file GEMDetId.h.

References DetId::id_, and v12Form().

Referenced by GEMDetId(), operator=(), v12Form(), and v12FromV11().

206 { return v12Form(id_); }
uint32_t v12Form() const
Definition: GEMDetId.h:206
uint32_t id_
Definition: DetId.h:69
static uint32_t GEMDetId::v12Form ( const uint32_t &  inpid)
inlinestatic

Definition at line 208 of file GEMDetId.h.

References chamber(), ChamberMask, MuonSubdetId::GEM, DetId::kDetMask, DetId::kDetOffset, kGEMIdFormat, DetId::kSubdetMask, DetId::kSubdetOffset, layer(), LayerMask, minLayerId, minRegionId, minRingId, minStationId0, DetId::Muon, region(), RegionMask, ring(), RingMask, roll(), RollMask, station(), StationMask, and unpackId().

208  {
209  uint32_t rawid(inpid);
210  if ((rawid & kGEMIdFormat) == 0) {
211  int region(0), ring(0), station(-1), layer(0), chamber(0), roll(0);
213  int regionInBits = region - minRegionId;
214  int ringInBits = ring - minRingId;
215  int stationInBits = station - minStationId0;
216  int layerInBits = layer - minLayerId;
217  int chamberInBits = chamber - (minChamberId + 1);
218  int rollInBits = roll;
219  rawid = (((DetId::Muon & DetId::kDetMask) << DetId::kDetOffset) |
221  ((regionInBits & RegionMask) << RegionStartBit) | ((ringInBits & RingMask) << RingStartBit) |
222  ((stationInBits & StationMask) << StationStartBit) | ((layerInBits & LayerMask) << LayerStartBit) |
223  ((chamberInBits & ChamberMask) << ChamberStartBit) | ((rollInBits & RollMask) << RollStartBit) |
224  kGEMIdFormat);
225  }
226  return rawid;
227  }
static constexpr int GEM
Definition: MuonSubdetId.h:14
static uint32_t RollMask
Definition: GEMDetId.h:59
static uint32_t RollStartBit
Definition: GEMDetId.h:56
static uint32_t LayerStartBit
Definition: GEMDetId.h:51
int roll() const
Definition: GEMDetId.h:188
int ring() const
Definition: GEMDetId.h:170
static int32_t minRegionId
Definition: GEMDetId.h:19
static uint32_t StationStartBit
Definition: GEMDetId.h:43
static const int kSubdetOffset
Definition: DetId.h:22
int chamber() const
Definition: GEMDetId.h:177
static uint32_t StationMask
Definition: GEMDetId.h:44
static int32_t minStationId0
Definition: GEMDetId.h:23
static const int kSubdetMask
Definition: DetId.h:20
static uint32_t RingStartBit
Definition: GEMDetId.h:40
static uint32_t RegionStartBit
Definition: GEMDetId.h:37
static uint32_t RegionMask
Definition: GEMDetId.h:38
static uint32_t kGEMIdFormat
Definition: GEMDetId.h:63
int layer() const
Definition: GEMDetId.h:184
int station() const
Definition: GEMDetId.h:173
static uint32_t RingMask
Definition: GEMDetId.h:41
int region() const
Definition: GEMDetId.h:165
static int32_t minRingId
Definition: GEMDetId.h:21
static const int kDetMask
Definition: DetId.h:19
static uint32_t LayerMask
Definition: GEMDetId.h:53
static const int kDetOffset
Definition: DetId.h:21
static uint32_t ChamberStartBit
Definition: GEMDetId.h:46
static void unpackId(const uint32_t &rawid, int &region, int &ring, int &station, int &layer, int &chamber, int &roll)
Definition: GEMDetId.h:232
static int32_t minLayerId
Definition: GEMDetId.h:29
static uint32_t ChamberMask
Definition: GEMDetId.h:48
static int32_t minChamberId
Definition: GEMDetId.h:27
void GEMDetId::v12FromV11 ( const uint32_t &  rawid)
inlineprivate

Definition at line 230 of file GEMDetId.h.

References DetId::id_, and v12Form().

230 { id_ = v12Form(rawid); }
uint32_t v12Form() const
Definition: GEMDetId.h:206
uint32_t id_
Definition: DetId.h:69

Member Data Documentation

uint32_t GEMDetId::chamberIdMask = ~(RollMask << RollStartBit)
staticprivate

Definition at line 65 of file GEMDetId.h.

uint32_t GEMDetId::ChamberMask = 0x3F
staticprivate

Definition at line 48 of file GEMDetId.h.

Referenced by GEMDetId(), and v12Form().

uint32_t GEMDetId::ChamberNumBits = 6
staticprivate

Definition at line 45 of file GEMDetId.h.

uint32_t GEMDetId::ChamberStartBit = StationStartBit + StationNumBits
staticprivate

Definition at line 46 of file GEMDetId.h.

Referenced by unpackId().

uint32_t GEMDetId::ChamberStartBitM = RegionStartBit + RegionNumBits
staticprivate

Definition at line 47 of file GEMDetId.h.

Referenced by unpackId().

uint32_t GEMDetId::FormatMask = 0x1
staticprivate

Definition at line 62 of file GEMDetId.h.

uint32_t GEMDetId::FormatNumBits = 1
staticprivate

Definition at line 60 of file GEMDetId.h.

uint32_t GEMDetId::FormatStartBit = RollStartBit + RollNumBits
staticprivate

Definition at line 61 of file GEMDetId.h.

uint32_t GEMDetId::kGEMIdFormat = 0x1000000
staticprivate

Definition at line 63 of file GEMDetId.h.

Referenced by GEMDetId(), and v12Form().

uint32_t GEMDetId::kMuonIdMask = 0xF0000000
staticprivate

Definition at line 64 of file GEMDetId.h.

uint32_t GEMDetId::LayerMask = 0x1F
staticprivate

Definition at line 53 of file GEMDetId.h.

Referenced by v12Form().

uint32_t GEMDetId::LayerMaskP = 0x3
staticprivate

Definition at line 54 of file GEMDetId.h.

uint32_t GEMDetId::LayerNumBits = 5
staticprivate

Definition at line 49 of file GEMDetId.h.

uint32_t GEMDetId::LayerNumBitsP = 2
staticprivate

Definition at line 50 of file GEMDetId.h.

uint32_t GEMDetId::LayerStartBit = ChamberStartBit + ChamberNumBits
staticprivate

Definition at line 51 of file GEMDetId.h.

Referenced by unpackId().

uint32_t GEMDetId::LayerStartBitM = ChamberStartBitM + ChamberNumBits
staticprivate

Definition at line 52 of file GEMDetId.h.

Referenced by unpackId().

int32_t GEMDetId::maxChamberId = 36
static
int32_t GEMDetId::maxLayerId = 2
static
int32_t GEMDetId::maxLayerId0 = 6
static

Definition at line 30 of file GEMDetId.h.

int32_t GEMDetId::maxRegionId = 1
static

Definition at line 20 of file GEMDetId.h.

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

int32_t GEMDetId::maxRingId = 3
static

Definition at line 22 of file GEMDetId.h.

Referenced by MuonGEMDetLayerGeometryBuilder::buildEndcapLayers().

int32_t GEMDetId::maxRollId = 15
static
int32_t GEMDetId::maxStationId = 2
static
int32_t GEMDetId::minChamberId = 0
static

Definition at line 27 of file GEMDetId.h.

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

int32_t GEMDetId::minLayerId = 0
static
int32_t GEMDetId::minRegionId = -1
static
int32_t GEMDetId::minRingId = 1
static
int32_t GEMDetId::minRollId = 0
static
int32_t GEMDetId::minStationId = 1
static
int32_t GEMDetId::minStationId0 = 0
static

Definition at line 23 of file GEMDetId.h.

Referenced by GEMDetId(), unpackId(), and v12Form().

uint32_t GEMDetId::RegionMask = 0x3
staticprivate

Definition at line 38 of file GEMDetId.h.

Referenced by GEMDetId(), and v12Form().

uint32_t GEMDetId::RegionNumBits = 2
staticprivate

Definition at line 36 of file GEMDetId.h.

uint32_t GEMDetId::RegionStartBit = 0
staticprivate

Definition at line 37 of file GEMDetId.h.

Referenced by unpackId().

uint32_t GEMDetId::RingMask = 0x7
staticprivate

Definition at line 41 of file GEMDetId.h.

Referenced by v12Form().

uint32_t GEMDetId::RingNumBits = 3
staticprivate

Definition at line 39 of file GEMDetId.h.

uint32_t GEMDetId::RingStartBit = RegionStartBit + RegionNumBits
staticprivate

Definition at line 40 of file GEMDetId.h.

Referenced by unpackId().

uint32_t GEMDetId::RollMask = 0x1F
staticprivate

Definition at line 59 of file GEMDetId.h.

Referenced by v12Form().

uint32_t GEMDetId::RollNumBits = 5
staticprivate

Definition at line 55 of file GEMDetId.h.

uint32_t GEMDetId::RollStartBit = LayerStartBit + LayerNumBits
staticprivate

Definition at line 56 of file GEMDetId.h.

Referenced by unpackId().

uint32_t GEMDetId::RollStartBitM = LayerStartBitM + LayerNumBits
staticprivate

Definition at line 58 of file GEMDetId.h.

Referenced by unpackId().

uint32_t GEMDetId::RollStartBitP = LayerStartBit + LayerNumBitsP
staticprivate

Definition at line 57 of file GEMDetId.h.

Referenced by unpackId().

uint32_t GEMDetId::StationMask = 0x7
staticprivate

Definition at line 44 of file GEMDetId.h.

Referenced by GEMDetId(), and v12Form().

uint32_t GEMDetId::StationNumBits = 3
staticprivate

Definition at line 42 of file GEMDetId.h.

uint32_t GEMDetId::StationStartBit = RingStartBit + RingNumBits
staticprivate

Definition at line 43 of file GEMDetId.h.

Referenced by unpackId().

uint32_t GEMDetId::superChamberIdMask = chamberIdMask + ~(LayerMask << LayerStartBit)
staticprivate

Definition at line 66 of file GEMDetId.h.