CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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{
47  return int((id_>>RegionStartBit_) & RegionMask_) + minRegionId;
48  }
49 
51  int chamber() const{
52  return int((id_>>ChamberStartBit_) & ChamberMask_) + minChamberId;
53  }
54 
56  int layer() const{
57  return int((id_>>LayerStartBit_) & LayerMask_) + minLayerId;
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= 1; // ME0 layer consits of 1 etapartition for now, change here when changing ME0 Geometry
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;
105  static const unsigned int ChamberMask_ = 0X3F;
106 
107  static const int LayerNumBits_ = 5;
109  static const unsigned int LayerMask_ = 0X1F;
110 
111  static const int RollNumBits_ = 5;
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
ME0DetId()
Definition: ME0DetId.cc:8
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
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:43
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:55
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