CMS 3D CMS Logo

ME0DetId.cc
Go to the documentation of this file.
1 
7 
9 
10 ME0DetId::ME0DetId(uint32_t id) : 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 }
16 
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 }
23 
25  this->init(region, layer, chamber, roll);
26 }
27 
28 void ME0DetId::init(int region, int layer, int chamber, int roll) {
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 }
44 
45 std::ostream& operator<<(std::ostream& os, const ME0DetId& id) {
46  os << " Region " << id.region() << " Layer " << id.layer() << " Chamber " << id.chamber() << " EtaPartition "
47  << id.roll() << " ";
48 
49  return os;
50 }
l1t::mtf7::ME0
ME0 Data Record : block->header().getID() = 6.
Definition: Block.h:23
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.h
Muon
Definition: Muon.py:1
ME0DetId::maxChamberId
static constexpr int maxChamberId
Definition: ME0DetId.h:67
DetId
Definition: DetId.h:17
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
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
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
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
ME0DetId
Definition: ME0DetId.h:16
MuonSubdetId::ME0
static constexpr int ME0
Definition: MuonSubdetId.h:15
ME0DetId::ChamberStartBit_
static constexpr int ChamberStartBit_
Definition: ME0DetId.h:81
MuonSubdetId.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
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
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
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
MuonSubdetId
Definition: MuonSubdetId.h:9
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
operator<<
std::ostream & operator<<(std::ostream &os, const ME0DetId &id)
Definition: ME0DetId.cc:45
ME0DetId::maxRegionId
static constexpr int maxRegionId
Definition: ME0DetId.h:64
ME0DetId::RegionMask_
static constexpr int RegionMask_
Definition: ME0DetId.h:78