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 
24 ME0DetId::ME0DetId(int region, int layer, int chamber, int roll) : DetId(DetId::Muon, MuonSubdetId::ME0) {
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 }
ME0DetId::minRegionId
static const int minRegionId
Definition: ME0DetId.h:63
ME0DetId::ME0DetId
ME0DetId()
Definition: ME0DetId.cc:8
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
ME0DetId.h
ME0DetId::ChamberMask_
static const unsigned int ChamberMask_
Definition: ME0DetId.h:82
ME0DetId::RollMask_
static const unsigned int RollMask_
Definition: ME0DetId.h:90
ME0DetId::maxChamberId
static const int maxChamberId
Definition: ME0DetId.h:67
ME0DetId::LayerMask_
static const unsigned int LayerMask_
Definition: ME0DetId.h:86
Muon
Definition: Muon.py:1
ME0DetId::RollStartBit_
static const int RollStartBit_
Definition: ME0DetId.h:89
DetId
Definition: DetId.h:17
ME0DetId::minChamberId
static const int minChamberId
Definition: ME0DetId.h:66
ME0DetId::roll
int roll() const
Definition: ME0DetId.h:48
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::maxLayerId
static const int maxLayerId
Definition: ME0DetId.h:70
ME0DetId::init
void init(int region, int layer, int chamber, int roll)
Definition: ME0DetId.cc:28
DetId::id_
uint32_t id_
Definition: DetId.h:69
ME0DetId
Definition: ME0DetId.h:16
MuonSubdetId::ME0
static constexpr int ME0
Definition: MuonSubdetId.h:15
ME0DetId::maxRegionId
static const int maxRegionId
Definition: ME0DetId.h:64
MuonSubdetId.h
ME0DetId::ChamberStartBit_
static const int ChamberStartBit_
Definition: ME0DetId.h:81
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
ME0DetId::RegionStartBit_
static const int RegionStartBit_
Definition: ME0DetId.h:77
ME0DetId::minLayerId
static const int minLayerId
Definition: ME0DetId.h:69
Exception
Definition: hltDiff.cc:246
ME0DetId::chamber
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: ME0DetId.h:41
ME0DetId::minRollId
static const int minRollId
Definition: ME0DetId.h:72
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
ME0DetId::RegionMask_
static const int RegionMask_
Definition: ME0DetId.h:78
DetId::Muon
Definition: DetId.h:26
GeomDetEnumerators::ME0
Definition: GeomDetEnumerators.h:22
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
ME0DetId::maxRollId
static const int maxRollId
Definition: ME0DetId.h:73
operator<<
std::ostream & operator<<(std::ostream &os, const ME0DetId &id)
Definition: ME0DetId.cc:45
ME0DetId::LayerStartBit_
static const int LayerStartBit_
Definition: ME0DetId.h:85