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 {
69  }
71  ME0DetId layerId() const {
72  return ME0DetId(id_ & layerIdMask_);
73  }
74 
76  int nlayers() const{
77  return int(maxLayerId);
78  }
79 
80  static const int minRegionId= -1;
81  static const int maxRegionId= 1;
82 
83  static const int minChamberId= 0;
84  static const int maxChamberId= 36; // ME0 ring consists of 36 chambers spanning 10 degrees
85 
86  static const int minLayerId= 0;
87  static const int maxLayerId= 6; // ME0 chamber consists of 6 layers for now, change here when changing ME0 Geometry
88 
89  static const int minRollId= 0;
90  static const int maxRollId= 1; // ME0 layer consits of 1 etapartition for now, change here when changing ME0 Geometry
91 
92  private:
93  static const int RegionNumBits_ = 2;
94  static const int RegionStartBit_ = 0;
95  static const int RegionMask_ = 0X3;
96 
97  static const int ChamberNumBits_ = 6;
99  static const unsigned int ChamberMask_ = 0X3F;
100 
101  static const int LayerNumBits_ = 5;
103  static const unsigned int LayerMask_ = 0X1F;
104 
105  static const int RollNumBits_ = 5;
107  static const unsigned int RollMask_ = 0X1F;
108 
109  static const uint32_t chamberIdMask_ = ~( (LayerMask_<<LayerStartBit_) | (RollMask_<<RollStartBit_));
110  static const uint32_t layerIdMask_ = ~(RollMask_<<RollStartBit_);
111 
112  private:
113  void init(int region,
114  int layer,
115  int chamber,
116  int roll);
117 
118  int trind;
119 }; // ME0DetId
120 
121 std::ostream& operator<<( std::ostream& os, const ME0DetId& id );
122 
123 #endif
static const int minChamberId
Definition: ME0DetId.h:83
int trind
Definition: ME0DetId.h:118
ME0DetId layerId() const
Return the corresponding LayerId (mask eta partition)
Definition: ME0DetId.h:71
static const int maxChamberId
Definition: ME0DetId.h:84
static const int maxRollId
Definition: ME0DetId.h:90
static const int minLayerId
Definition: ME0DetId.h:86
static const uint32_t layerIdMask_
Definition: ME0DetId.h:110
ME0DetId chamberId() const
Return the corresponding ChamberId (mask layers)
Definition: ME0DetId.h:67
static const int LayerNumBits_
Definition: ME0DetId.h:101
static const unsigned int LayerMask_
Definition: ME0DetId.h:103
ME0DetId()
Definition: ME0DetId.cc:8
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static const int ChamberNumBits_
Definition: ME0DetId.h:97
static const int maxRegionId
Definition: ME0DetId.h:81
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
static const int minRegionId
Definition: ME0DetId.h:80
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:109
static const int RollNumBits_
Definition: ME0DetId.h:105
static const int LayerStartBit_
Definition: ME0DetId.h:102
Definition: DetId.h:18
static const int ChamberStartBit_
Definition: ME0DetId.h:98
static const unsigned int ChamberMask_
Definition: ME0DetId.h:99
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:95
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:93
static const int RegionStartBit_
Definition: ME0DetId.h:94
int nlayers() const
For future modifications (implement more layers)
Definition: ME0DetId.h:76
static const int maxLayerId
Definition: ME0DetId.h:87
static const unsigned int RollMask_
Definition: ME0DetId.h:107
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:89
static const int RollStartBit_
Definition: ME0DetId.h:106