CMS 3D CMS Logo

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

#include <ME0DetId.h>

Inheritance diagram for ME0DetId:
DetId

Public Member Functions

int chamber () const
 Chamber id: it identifies a chamber in a ring it goes from 1 to 36. More...
 
ME0DetId chamberId () const
 Return the corresponding ChamberId (mask layers) More...
 
int layer () const
 Layer id: each chamber has six layers of chambers: layer 1 is the inner layer and layer 6 is the outer layer. More...
 
ME0DetId layerId () const
 Return the corresponding LayerId (mask eta partition) More...
 
 ME0DetId ()
 
 ME0DetId (DetId id)
 
 ME0DetId (int region, int layer, int chamber, int roll)
 Construct from fully qualified identifier. More...
 
 ME0DetId (uint32_t id)
 
int nlayers () const
 For future modifications (implement more layers) More...
 
bool operator< (const ME0DetId &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 roll () const
 
int station () 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 (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. 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 Attributes

static constexpr uint32_t chamberIdMask_ = ~((LayerMask_ << LayerStartBit_) | (RollMask_ << RollStartBit_))
 
static constexpr uint32_t layerIdMask_ = ~(RollMask_ << RollStartBit_)
 
static constexpr int maxChamberId = 18
 
static constexpr int maxLayerId = 6
 
static constexpr int maxRegionId = 1
 
static constexpr int maxRollId = 10
 
static constexpr int minChamberId = 0
 
static constexpr int minLayerId = 0
 
static constexpr int minRegionId = -1
 
static constexpr int minRollId = 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 init (int region, int layer, int chamber, int roll)
 

Private Attributes

int trind
 

Static Private Attributes

static constexpr unsigned int ChamberMask_ = 0X3F
 
static constexpr int ChamberNumBits_ = 6
 
static constexpr int ChamberStartBit_ = RegionStartBit_ + RegionNumBits_
 
static constexpr unsigned int LayerMask_ = 0X1F
 
static constexpr int LayerNumBits_ = 5
 
static constexpr int LayerStartBit_ = ChamberStartBit_ + ChamberNumBits_
 
static constexpr int RegionMask_ = 0X3
 
static constexpr int RegionNumBits_ = 2
 
static constexpr int RegionStartBit_ = 0
 
static constexpr unsigned int RollMask_ = 0X1F
 
static constexpr int RollNumBits_ = 5
 
static constexpr int RollStartBit_ = LayerStartBit_ + LayerNumBits_
 

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 ME0s

Definition at line 16 of file ME0DetId.h.

Constructor & Destructor Documentation

◆ ME0DetId() [1/4]

ME0DetId::ME0DetId ( )

Definition at line 8 of file ME0DetId.cc.

Referenced by chamberId(), and layerId().

◆ ME0DetId() [2/4]

ME0DetId::ME0DetId ( uint32_t  id)

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

Definition at line 10 of file ME0DetId.cc.

10  : DetId(id) {
11  if (det() != DetId::Muon || subdetId() != MuonSubdetId::ME0) {
12  throw cms::Exception("InvalidDetId") << "ME0DetId ctor:"
13  << " det: " << det() << " subdet: " << subdetId() << " is not a valid ME0 id";
14  }
15 }

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

◆ ME0DetId() [3/4]

ME0DetId::ME0DetId ( DetId  id)

Definition at line 17 of file ME0DetId.cc.

17  : DetId(id) {
18  if (det() != DetId::Muon || subdetId() != MuonSubdetId::ME0) {
19  throw cms::Exception("InvalidDetId") << "ME0DetId ctor:"
20  << " det: " << det() << " subdet: " << subdetId() << " is not a valid ME0 id";
21  }
22 }

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

◆ ME0DetId() [4/4]

ME0DetId::ME0DetId ( int  region,
int  layer,
int  chamber,
int  roll 
)

Construct from fully qualified identifier.

Definition at line 24 of file ME0DetId.cc.

25  this->init(region, layer, chamber, roll);
26 }

References chamber(), init(), layer(), and roll().

Member Function Documentation

◆ chamber()

int ME0DetId::chamber ( ) const
inline

◆ chamberId()

ME0DetId ME0DetId::chamberId ( ) const
inline

◆ init()

void ME0DetId::init ( int  region,
int  layer,
int  chamber,
int  roll 
)
private

Definition at line 28 of file ME0DetId.cc.

28  {
29  if (region < minRegionId || region > maxRegionId || layer < minLayerId || layer > maxLayerId ||
30  chamber < minChamberId || chamber > maxChamberId || roll < minRollId || roll > maxRollId) {
31  throw cms::Exception("InvalidDetId") << "ME0DetId ctor:"
32  << " Invalid parameters: "
33  << " region " << region << " layer " << layer << " chamber " << chamber
34  << " etaPartition " << roll << std::endl;
35  }
36  int regionInBits = region - minRegionId;
37  int layerInBits = layer - minLayerId;
38  int chamberInBits = chamber - minChamberId;
39  int rollInBits = roll - minRollId;
40 
41  id_ |= (regionInBits & RegionMask_) << RegionStartBit_ | (layerInBits & LayerMask_) << LayerStartBit_ |
42  (chamberInBits & ChamberMask_) << ChamberStartBit_ | (rollInBits & RollMask_) << RollStartBit_;
43 }

References chamber(), ChamberMask_, ChamberStartBit_, Exception, DetId::id_, layer(), LayerMask_, LayerStartBit_, maxChamberId, maxLayerId, maxRegionId, maxRollId, minChamberId, minLayerId, minRegionId, minRollId, region(), RegionMask_, RegionStartBit_, roll(), RollMask_, and RollStartBit_.

Referenced by ME0DetId().

◆ layer()

int ME0DetId::layer ( ) const
inline

◆ layerId()

ME0DetId ME0DetId::layerId ( ) const
inline

Return the corresponding LayerId (mask eta partition)

Definition at line 55 of file ME0DetId.h.

55 { return ME0DetId(id_ & layerIdMask_); }

References DetId::id_, layerIdMask_, and ME0DetId().

Referenced by ME0GeometryBuilder::buildGeometry(), ME0GeometryParsFromDD::buildLayer(), and ME0GeometryBuilder::buildLayer().

◆ nlayers()

int ME0DetId::nlayers ( ) const
inline

For future modifications (implement more layers)

Definition at line 61 of file ME0DetId.h.

61 { return int(maxLayerId); }

References createfilelist::int, and maxLayerId.

◆ operator<()

bool ME0DetId::operator< ( const ME0DetId r) const
inline

Sort Operator based on the raw detector id.

Definition at line 29 of file ME0DetId.h.

29  {
30  if (this->layer() == r.layer()) {
31  return this->rawId() < r.rawId();
32  } else {
33  return (this->layer() > r.layer());
34  }
35  }

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

◆ region()

int ME0DetId::region ( ) const
inline

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

Definition at line 38 of file ME0DetId.h.

38 { return int((id_ >> RegionStartBit_) & RegionMask_) + minRegionId; }

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

Referenced by PrimitiveConversion::convert_me0(), DetIdInfo::info(), fireworks::info(), init(), ME0SegmentsValidation::isMatched(), and PrimitiveSelection::select_me0().

◆ roll()

int ME0DetId::roll ( ) const
inline

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

Definition at line 48 of file ME0DetId.h.

48  {
49  return int((id_ >> RollStartBit_) & RollMask_) + minRollId; // value 0 is used as wild card
50  }

References DetId::id_, createfilelist::int, minRollId, RollMask_, and RollStartBit_.

Referenced by ME0ReDigiProducer::getStripProperties(), ME0SimHitMatcher::hitPartitions(), init(), ME0SegmentsValidation::isMatched(), and ME0DetId().

◆ station()

int ME0DetId::station ( ) const
inline

Member Data Documentation

◆ chamberIdMask_

constexpr uint32_t ME0DetId::chamberIdMask_ = ~((LayerMask_ << LayerStartBit_) | (RollMask_ << RollStartBit_))
staticconstexpr

Definition at line 93 of file ME0DetId.h.

Referenced by ME0GeometryBuilder::buildGeometry(), and chamberId().

◆ ChamberMask_

constexpr unsigned int ME0DetId::ChamberMask_ = 0X3F
staticconstexprprivate

Definition at line 82 of file ME0DetId.h.

Referenced by chamber(), and init().

◆ ChamberNumBits_

constexpr int ME0DetId::ChamberNumBits_ = 6
staticconstexprprivate

Definition at line 80 of file ME0DetId.h.

◆ ChamberStartBit_

constexpr int ME0DetId::ChamberStartBit_ = RegionStartBit_ + RegionNumBits_
staticconstexprprivate

Definition at line 81 of file ME0DetId.h.

Referenced by chamber(), and init().

◆ layerIdMask_

constexpr uint32_t ME0DetId::layerIdMask_ = ~(RollMask_ << RollStartBit_)
staticconstexpr

Definition at line 94 of file ME0DetId.h.

Referenced by ME0GeometryBuilder::buildGeometry(), and layerId().

◆ LayerMask_

constexpr unsigned int ME0DetId::LayerMask_ = 0X1F
staticconstexprprivate

Definition at line 86 of file ME0DetId.h.

Referenced by init(), and layer().

◆ LayerNumBits_

constexpr int ME0DetId::LayerNumBits_ = 5
staticconstexprprivate

Definition at line 84 of file ME0DetId.h.

◆ LayerStartBit_

constexpr int ME0DetId::LayerStartBit_ = ChamberStartBit_ + ChamberNumBits_
staticconstexprprivate

Definition at line 85 of file ME0DetId.h.

Referenced by init(), and layer().

◆ maxChamberId

constexpr int ME0DetId::maxChamberId = 18
staticconstexpr

◆ maxLayerId

constexpr int ME0DetId::maxLayerId = 6
staticconstexpr

Definition at line 70 of file ME0DetId.h.

Referenced by init(), and nlayers().

◆ maxRegionId

constexpr int ME0DetId::maxRegionId = 1
staticconstexpr

Definition at line 64 of file ME0DetId.h.

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

◆ maxRollId

constexpr int ME0DetId::maxRollId = 10
staticconstexpr

Definition at line 73 of file ME0DetId.h.

Referenced by init().

◆ minChamberId

constexpr int ME0DetId::minChamberId = 0
staticconstexpr

◆ minLayerId

constexpr int ME0DetId::minLayerId = 0
staticconstexpr

Definition at line 69 of file ME0DetId.h.

Referenced by ME0NumberingScheme::baseNumberToUnitNumber(), init(), and layer().

◆ minRegionId

constexpr int ME0DetId::minRegionId = -1
staticconstexpr

◆ minRollId

constexpr int ME0DetId::minRollId = 0
staticconstexpr

Definition at line 72 of file ME0DetId.h.

Referenced by ME0NumberingScheme::baseNumberToUnitNumber(), init(), and roll().

◆ RegionMask_

constexpr int ME0DetId::RegionMask_ = 0X3
staticconstexprprivate

Definition at line 78 of file ME0DetId.h.

Referenced by init(), and region().

◆ RegionNumBits_

constexpr int ME0DetId::RegionNumBits_ = 2
staticconstexprprivate

Definition at line 76 of file ME0DetId.h.

◆ RegionStartBit_

constexpr int ME0DetId::RegionStartBit_ = 0
staticconstexprprivate

Definition at line 77 of file ME0DetId.h.

Referenced by init(), and region().

◆ RollMask_

constexpr unsigned int ME0DetId::RollMask_ = 0X1F
staticconstexprprivate

Definition at line 90 of file ME0DetId.h.

Referenced by init(), and roll().

◆ RollNumBits_

constexpr int ME0DetId::RollNumBits_ = 5
staticconstexprprivate

Definition at line 88 of file ME0DetId.h.

◆ RollStartBit_

constexpr int ME0DetId::RollStartBit_ = LayerStartBit_ + LayerNumBits_
staticconstexprprivate

Definition at line 89 of file ME0DetId.h.

Referenced by init(), and roll().

◆ trind

int ME0DetId::trind
private

Definition at line 99 of file ME0DetId.h.

ME0DetId::layerIdMask_
static constexpr uint32_t layerIdMask_
Definition: ME0DetId.h:94
ME0DetId::ME0DetId
ME0DetId()
Definition: ME0DetId.cc:8
ME0DetId::RollStartBit_
static constexpr int RollStartBit_
Definition: ME0DetId.h:89
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
ME0DetId::maxChamberId
static constexpr int maxChamberId
Definition: ME0DetId.h:67
ME0DetId::ChamberMask_
static constexpr unsigned int ChamberMask_
Definition: ME0DetId.h:82
ME0DetId::roll
int roll() const
Definition: ME0DetId.h:48
ME0DetId::maxRollId
static constexpr int maxRollId
Definition: ME0DetId.h:73
ME0DetId::minRollId
static constexpr int minRollId
Definition: ME0DetId.h:72
ME0DetId::minChamberId
static constexpr int minChamberId
Definition: ME0DetId.h:66
ME0DetId::RegionStartBit_
static constexpr int RegionStartBit_
Definition: ME0DetId.h:77
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
ME0DetId::LayerMask_
static constexpr unsigned int LayerMask_
Definition: ME0DetId.h:86
ME0DetId::init
void init(int region, int layer, int chamber, int roll)
Definition: ME0DetId.cc:28
ME0DetId::maxLayerId
static constexpr int maxLayerId
Definition: ME0DetId.h:70
ME0DetId::minLayerId
static constexpr int minLayerId
Definition: ME0DetId.h:69
ME0DetId::LayerStartBit_
static constexpr int LayerStartBit_
Definition: ME0DetId.h:85
DetId::id_
uint32_t id_
Definition: DetId.h:69
ME0DetId::RollMask_
static constexpr unsigned int RollMask_
Definition: ME0DetId.h:90
createfilelist.int
int
Definition: createfilelist.py:10
MuonSubdetId::ME0
static constexpr int ME0
Definition: MuonSubdetId.h:15
ME0DetId::ChamberStartBit_
static constexpr int ChamberStartBit_
Definition: ME0DetId.h:81
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
ME0DetId::minRegionId
static constexpr int minRegionId
Definition: ME0DetId.h:63
Exception
Definition: hltDiff.cc:245
ME0DetId::chamber
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: ME0DetId.h:41
DetId::DetId
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
DetId::Muon
Definition: DetId.h:26
ME0DetId::region
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
Definition: ME0DetId.h:38
ME0DetId::chamberIdMask_
static constexpr uint32_t chamberIdMask_
Definition: ME0DetId.h:93
ME0DetId::layer
int layer() const
Layer id: each chamber has six layers of chambers: layer 1 is the inner layer and layer 6 is the oute...
Definition: ME0DetId.h:44
ME0DetId::maxRegionId
static constexpr int maxRegionId
Definition: ME0DetId.h:64
ME0DetId::RegionMask_
static constexpr int RegionMask_
Definition: ME0DetId.h:78