CMS 3D CMS Logo

ME0DetId.cc
Go to the documentation of this file.
1 
7 
9 
10 
11 ME0DetId::ME0DetId(uint32_t id):DetId(id){
13  throw cms::Exception("InvalidDetId") << "ME0DetId ctor:"
14  << " det: " << det()
15  << " subdet: " << subdetId()
16  << " is not a valid ME0 id";
17  }
18 }
19 
22  throw cms::Exception("InvalidDetId") << "ME0DetId ctor:"
23  << " det: " << det()
24  << " subdet: " << subdetId()
25  << " is not a valid ME0 id";
26  }
27 }
28 
31 {
32  this->init(region,layer,chamber,roll);
33 }
34 
35 void
37 {
38  if ( region < minRegionId || region > maxRegionId ||
39  layer < minLayerId || layer > maxLayerId ||
40  chamber < minChamberId || chamber > maxChamberId ||
41  roll < minRollId || roll > maxRollId) {
42  throw cms::Exception("InvalidDetId") << "ME0DetId ctor:"
43  << " Invalid parameters: "
44  << " region "<<region
45  << " layer "<<layer
46  << " chamber "<<chamber
47  << " etaPartition "<<roll
48  << std::endl;
49  }
50  int regionInBits=region-minRegionId;
51  int layerInBits=layer-minLayerId;
52  int chamberInBits=chamber-minChamberId;
53  int rollInBits=roll-minRollId;
54 
55  id_ |= ( regionInBits & RegionMask_) << RegionStartBit_ |
56  ( layerInBits & LayerMask_) << LayerStartBit_ |
57  ( chamberInBits & ChamberMask_) << ChamberStartBit_ |
58  ( rollInBits & RollMask_) << RollStartBit_ ;
59 
60 }
61 
62 
63 
64 std::ostream& operator<<( std::ostream& os, const ME0DetId& id ){
65 
66 
67  os << " Region "<<id.region()
68  << " Layer "<<id.layer()
69  << " Chamber "<<id.chamber()
70  << " EtaPartition "<<id.roll()
71  <<" ";
72 
73  return os;
74 }
75 
76 
static const int minChamberId
Definition: ME0DetId.h:89
static const int maxChamberId
Definition: ME0DetId.h:90
static const int maxRollId
Definition: ME0DetId.h:96
static const int minLayerId
Definition: ME0DetId.h:92
static const unsigned int LayerMask_
Definition: ME0DetId.h:109
ME0DetId()
Definition: ME0DetId.cc:8
static const int maxRegionId
Definition: ME0DetId.h:87
static const int minRegionId
Definition: ME0DetId.h:86
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: ME0DetId.h:51
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:41
static constexpr int ME0
Definition: MuonSubdetId.h:16
static const int LayerStartBit_
Definition: ME0DetId.h:108
Definition: DetId.h:18
static const int ChamberStartBit_
Definition: ME0DetId.h:104
std::ostream & operator<<(std::ostream &os, const ME0DetId &id)
Definition: ME0DetId.cc:64
static const unsigned int ChamberMask_
Definition: ME0DetId.h:105
uint32_t id_
Definition: DetId.h:62
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
Definition: ME0DetId.h:46
static const int RegionMask_
Definition: ME0DetId.h:101
void init(int region, int layer, int chamber, int roll)
Definition: ME0DetId.cc:36
int roll() const
Definition: ME0DetId.h:62
static const int RegionStartBit_
Definition: ME0DetId.h:100
static const int maxLayerId
Definition: ME0DetId.h:93
static const unsigned int RollMask_
Definition: ME0DetId.h:113
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:56
static const int minRollId
Definition: ME0DetId.h:95
static const int RollStartBit_
Definition: ME0DetId.h:112
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39