CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTChamberId.h
Go to the documentation of this file.
1 #ifndef MuonDetId_DTChamberId_H
2 #define MuonDetId_DTChamberId_H
3 
13 
14 #include <iosfwd>
15 
16 class DTChamberId : public DetId {
17 public:
20  DTChamberId();
21 
22 
28  DTChamberId(uint32_t id);
29  DTChamberId(DetId id);
30 
31 
35  DTChamberId(int wheel,
36  int station,
37  int sector);
38 
39 
43  DTChamberId(const DTChamberId& chId);
44 
45 
47  int wheel() const {
48  return int((id_>>wheelStartBit_) & wheelMask_)+ minWheelId -1;
49  }
50 
51 
53  int station() const {
54  return ((id_>>stationStartBit_) & stationMask_);
55  }
56 
57 
63  int sector() const {
64  return ((id_>>sectorStartBit_)& sectorMask_);
65  }
66 
67 
69  static const int minStationId= 1;
71  static const int maxStationId= 4;
73  static const int minSectorId= 0;
75  static const int maxSectorId= 14;
77  static const int minWheelId= -2;
79  static const int maxWheelId= 2;
81  static const int minSuperLayerId= 0;
83  static const int maxSuperLayerId= 3;
85  static const int minLayerId= 0;
87  static const int maxLayerId= 4;
89  static const int minWireId= 0;
91  static const int maxWireId= 97;
92 
93 
94  protected:
96  static const int wireNumBits_= 7;
97  static const int wireStartBit_= 3;
98  static const int layerNumBits_= 3;
100  static const int slayerNumBits_= 2;
102  static const int wheelNumBits_ = 3;
104  static const int sectorNumBits_= 4;
107  static const int stationNumBits_= 3;
109 
110 
111  static const uint32_t wheelMask_= 0x7;
112  static const uint32_t stationMask_= 0x7;
113  static const uint32_t sectorMask_= 0xf;
114  static const uint32_t slMask_= 0x3;
115  static const uint32_t lMask_= 0x7;
116  static const uint32_t wireMask_= 0x7f;
117 
118  static const uint32_t layerIdMask_= ~(wireMask_<<wireStartBit_);
119  static const uint32_t slIdMask_ = ~((wireMask_<<wireStartBit_) |
121  static const uint32_t chamberIdMask_ = ~((wireMask_<<wireStartBit_) |
124 
125  // Perform a consistency check of the id with a DT Id
126  // It thorows an exception if this is not the case
127  void checkMuonId();
128 
129 };
130 
131 
132 std::ostream& operator<<( std::ostream& os, const DTChamberId& id );
133 
134 #endif
135 
static const int minSectorId
lowest sector id. 0 indicates all sectors (a station)
Definition: DTChamberId.h:73
static const int slayerNumBits_
Definition: DTChamberId.h:100
static const int wireNumBits_
two bits would be enough, but we could use the number &quot;0&quot; as a wildcard
Definition: DTChamberId.h:96
static const int minStationId
lowest station id
Definition: DTChamberId.h:69
static const int sectorNumBits_
Definition: DTChamberId.h:104
static const uint32_t slIdMask_
Definition: DTChamberId.h:119
static const int sectorStartBit_
Definition: DTChamberId.h:105
static const uint32_t layerIdMask_
Definition: DTChamberId.h:118
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static const int wireStartBit_
Definition: DTChamberId.h:97
static const int wheelStartBit_
Definition: DTChamberId.h:103
static const int maxWireId
highest wire id (chambers have 48 to 96 wires)
Definition: DTChamberId.h:91
static const uint32_t stationMask_
Definition: DTChamberId.h:112
static const int maxLayerId
highest layer id
Definition: DTChamberId.h:87
static const int minWireId
lowest wire id (numbering starts from 1 or 2). 0 indicates a full layer
Definition: DTChamberId.h:89
static const int stationNumBits_
two bits would be enough, but we could use the number &quot;0&quot; as a wildcard
Definition: DTChamberId.h:107
static const uint32_t slMask_
Definition: DTChamberId.h:114
static const int minLayerId
lowest layer id. 0 indicates a full SL
Definition: DTChamberId.h:85
static const int wheelNumBits_
Definition: DTChamberId.h:102
void checkMuonId()
Definition: DTChamberId.cc:59
static const int maxSuperLayerId
highest superlayer id
Definition: DTChamberId.h:83
static const uint32_t sectorMask_
Definition: DTChamberId.h:113
static const int maxStationId
highest station id
Definition: DTChamberId.h:71
static const int layerStartBit_
Definition: DTChamberId.h:99
static const int minWheelId
lowest wheel number
Definition: DTChamberId.h:77
static const uint32_t lMask_
Definition: DTChamberId.h:115
Definition: DetId.h:20
static const int maxWheelId
highest wheel number
Definition: DTChamberId.h:79
uint32_t id_
Definition: DetId.h:57
static const int minSuperLayerId
loweset super layer id. 0 indicates a full chamber
Definition: DTChamberId.h:81
int sector() const
Definition: DTChamberId.h:63
static const uint32_t chamberIdMask_
Definition: DTChamberId.h:121
static const uint32_t wireMask_
Definition: DTChamberId.h:116
static const uint32_t wheelMask_
Definition: DTChamberId.h:111
static const int slayerStartBit_
Definition: DTChamberId.h:101
static const int stationStartBit_
Definition: DTChamberId.h:108
int station() const
Return the station number.
Definition: DTChamberId.h:53
static const int layerNumBits_
Definition: DTChamberId.h:98
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
static const int maxSectorId
highest sector id.
Definition: DTChamberId.h:75