CMS 3D CMS Logo

ME0DetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_MuonDetId_ME0DetId_h
2 #define DataFormats_MuonDetId_ME0DetId_h
3 
12 
13 #include <iosfwd>
14 #include <iostream>
15 
16 class ME0DetId :public DetId {
17 
18  public:
19 
20  ME0DetId();
21 
24  ME0DetId(uint32_t id);
25  ME0DetId(DetId id);
26 
27 
29  ME0DetId(int region,
30  int layer,
31  int chamber,
32  int roll);
33 
34 
36  bool operator < (const ME0DetId& r) const{
37  if (this->layer() == r.layer() ){
38  return this->rawId()<r.rawId();
39  }
40  else{
41  return (this->layer() > r.layer());
42  }
43  }
44 
46  int region() const{
48  }
49 
51  int chamber() const{
53  }
54 
56  int layer() const{
58  }
59 
62  int roll() const{
63  return int((id_>>RollStartBit_) & RollMask_) + minRollId; // value 0 is used as wild card
64  }
65 
67  ME0DetId chamberId() const {
68  return ME0DetId(id_ & chamberIdMask_);
69  }
71  ME0DetId layerId() const {
72  return ME0DetId(id_ & layerIdMask_);
73  }
74 
75  //Return the stationId, always 1 for now
76  int station() const{
77  return 1;
78  }
79 
80 
82  int nlayers() const{
83  return int(maxLayerId);
84  }
85 
86  static const int minRegionId= -1;
87  static const int maxRegionId= 1;
88 
89  static const int minChamberId= 0;
90  static const int maxChamberId= 18; // ME0 ring consists of 18 chambers spanning 20 degrees
91 
92  static const int minLayerId= 0;
93  static const int maxLayerId= 6;
94 
95  static const int minRollId= 0;
96  static const int maxRollId= 10; // ME0 layer consists of 10 etapartitions
97 
98  private:
99  static const int RegionNumBits_ = 2;
100  static const int RegionStartBit_ = 0;
101  static const int RegionMask_ = 0X3;
102 
103  static const int ChamberNumBits_ = 6;
104  static const int ChamberStartBit_ = RegionStartBit_+RegionNumBits_;
105  static const unsigned int ChamberMask_ = 0X3F;
106 
107  static const int LayerNumBits_ = 5;
108  static const int LayerStartBit_ = ChamberStartBit_+ChamberNumBits_;
109  static const unsigned int LayerMask_ = 0X1F;
110 
111  static const int RollNumBits_ = 5;
112  static const int RollStartBit_ = LayerStartBit_+LayerNumBits_;
113  static const unsigned int RollMask_ = 0X1F;
114 
115  static const uint32_t chamberIdMask_ = ~( (LayerMask_<<LayerStartBit_) | (RollMask_<<RollStartBit_));
116  static const uint32_t layerIdMask_ = ~(RollMask_<<RollStartBit_);
117 
118  private:
119  void init(int region,
120  int layer,
121  int chamber,
122  int roll);
123 
124  int trind;
125 }; // ME0DetId
126 
127 std::ostream& operator<<( std::ostream& os, const ME0DetId& id );
128 
129 #endif
static const int minChamberId
Definition: ME0DetId.h:89
int trind
Definition: ME0DetId.h:124
ME0DetId layerId() const
Return the corresponding LayerId (mask eta partition)
Definition: ME0DetId.h:71
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 uint32_t layerIdMask_
Definition: ME0DetId.h:116
ME0DetId chamberId() const
Return the corresponding ChamberId (mask layers)
Definition: ME0DetId.h:67
static const int LayerNumBits_
Definition: ME0DetId.h:107
static const unsigned int LayerMask_
Definition: ME0DetId.h:109
std::ostream & operator<<(std::ostream &os, const ME0DetId &id)
Definition: ME0DetId.cc:64
ME0DetId()
Definition: ME0DetId.cc:8
int station() const
Definition: ME0DetId.h:76
static const int ChamberNumBits_
Definition: ME0DetId.h:103
static const int maxRegionId
Definition: ME0DetId.h:87
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
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
bool operator<(const ME0DetId &r) const
Sort Operator based on the raw detector id.
Definition: ME0DetId.h:36
static const uint32_t chamberIdMask_
Definition: ME0DetId.h:115
static const int RollNumBits_
Definition: ME0DetId.h:111
static const int LayerStartBit_
Definition: ME0DetId.h:108
Definition: DetId.h:18
static const int ChamberStartBit_
Definition: ME0DetId.h:104
static const unsigned int ChamberMask_
Definition: ME0DetId.h:105
uint32_t id_
Definition: DetId.h:56
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 RegionNumBits_
Definition: ME0DetId.h:99
static const int RegionStartBit_
Definition: ME0DetId.h:100
int nlayers() const
For future modifications (implement more layers)
Definition: ME0DetId.h:82
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