CMS 3D CMS Logo

DTChamberId.h
Go to the documentation of this file.
1 #ifndef MuonDetId_DTChamberId_H
2 #define MuonDetId_DTChamberId_H
3 
11 
12 #include <iosfwd>
13 
14 class DTChamberId : public DetId {
15 public:
18  DTChamberId();
19 
25  DTChamberId(uint32_t id);
26  DTChamberId(DetId id);
27 
31  DTChamberId(int wheel, int station, int sector);
32 
36  DTChamberId(const DTChamberId& chId);
37 
39  int wheel() const { return int((id_ >> wheelStartBit_) & wheelMask_) + minWheelId - 1; }
40 
42  int station() const { return ((id_ >> stationStartBit_) & stationMask_); }
43 
49  int sector() const { return ((id_ >> sectorStartBit_) & sectorMask_); }
50 
52  static const int minStationId = 1;
54  static const int maxStationId = 4;
56  static const int minSectorId = 0;
58  static const int maxSectorId = 14;
60  static const int minWheelId = -2;
62  static const int maxWheelId = 2;
64  static const int minSuperLayerId = 0;
66  static const int maxSuperLayerId = 3;
68  static const int minLayerId = 0;
70  static const int maxLayerId = 4;
72  static const int minWireId = 0;
74  static const int maxWireId = 97;
75 
76 protected:
78  static const int wireNumBits_ = 7;
79  static const int wireStartBit_ = 3;
80  static const int layerNumBits_ = 3;
81  static const int layerStartBit_ = wireStartBit_ + wireNumBits_;
82  static const int slayerNumBits_ = 2;
83  static const int slayerStartBit_ = layerStartBit_ + layerNumBits_;
84  static const int wheelNumBits_ = 3;
85  static const int wheelStartBit_ = slayerStartBit_ + slayerNumBits_;
86  static const int sectorNumBits_ = 4;
87  static const int sectorStartBit_ = wheelStartBit_ + wheelNumBits_;
89  static const int stationNumBits_ = 3;
90  static const int stationStartBit_ = sectorStartBit_ + sectorNumBits_;
91 
92  static const uint32_t wheelMask_ = 0x7;
93  static const uint32_t stationMask_ = 0x7;
94  static const uint32_t sectorMask_ = 0xf;
95  static const uint32_t slMask_ = 0x3;
96  static const uint32_t lMask_ = 0x7;
97  static const uint32_t wireMask_ = 0x7f;
98 
99  static const uint32_t layerIdMask_ = ~(wireMask_ << wireStartBit_);
100  static const uint32_t slIdMask_ = ~((wireMask_ << wireStartBit_) | (lMask_ << layerStartBit_));
101  static const uint32_t chamberIdMask_ =
102  ~((wireMask_ << wireStartBit_) | (lMask_ << layerStartBit_) | (slMask_ << slayerStartBit_));
103 
104  // Perform a consistency check of the id with a DT Id
105  // It thorows an exception if this is not the case
106  void checkMuonId();
107 };
108 
109 std::ostream& operator<<(std::ostream& os, const DTChamberId& id);
110 
111 #endif
static const int minSectorId
lowest sector id. 0 indicates all sectors (a station)
Definition: DTChamberId.h:56
static const int slayerNumBits_
Definition: DTChamberId.h:82
static const int wireNumBits_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: DTChamberId.h:78
static const int minStationId
lowest station id
Definition: DTChamberId.h:52
static const int sectorNumBits_
Definition: DTChamberId.h:86
static const uint32_t slIdMask_
Definition: DTChamberId.h:100
static const int sectorStartBit_
Definition: DTChamberId.h:87
static const uint32_t layerIdMask_
Definition: DTChamberId.h:99
static const int wireStartBit_
Definition: DTChamberId.h:79
static const int wheelStartBit_
Definition: DTChamberId.h:85
static const int maxWireId
highest wire id (chambers have 48 to 96 wires)
Definition: DTChamberId.h:74
static const uint32_t stationMask_
Definition: DTChamberId.h:93
static const int maxLayerId
highest layer id
Definition: DTChamberId.h:70
static const int minWireId
lowest wire id (numbering starts from 1 or 2). 0 indicates a full layer
Definition: DTChamberId.h:72
static const int stationNumBits_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: DTChamberId.h:89
static const uint32_t slMask_
Definition: DTChamberId.h:95
static const int minLayerId
lowest layer id. 0 indicates a full SL
Definition: DTChamberId.h:68
static const int wheelNumBits_
Definition: DTChamberId.h:84
void checkMuonId()
Definition: DTChamberId.cc:41
static const int maxSuperLayerId
highest superlayer id
Definition: DTChamberId.h:66
static const uint32_t sectorMask_
Definition: DTChamberId.h:94
static const int maxStationId
highest station id
Definition: DTChamberId.h:54
static const int layerStartBit_
Definition: DTChamberId.h:81
static const int minWheelId
lowest wheel number
Definition: DTChamberId.h:60
static const uint32_t lMask_
Definition: DTChamberId.h:96
Definition: DetId.h:17
static const int maxWheelId
highest wheel number
Definition: DTChamberId.h:62
uint32_t id_
Definition: DetId.h:69
std::ostream & operator<<(std::ostream &os, const DTChamberId &id)
Definition: DTChamberId.cc:48
static const int minSuperLayerId
loweset super layer id. 0 indicates a full chamber
Definition: DTChamberId.h:64
int sector() const
Definition: DTChamberId.h:49
static const uint32_t chamberIdMask_
Definition: DTChamberId.h:101
static const uint32_t wireMask_
Definition: DTChamberId.h:97
static const uint32_t wheelMask_
Definition: DTChamberId.h:92
static const int slayerStartBit_
Definition: DTChamberId.h:83
static const int stationStartBit_
Definition: DTChamberId.h:90
int station() const
Return the station number.
Definition: DTChamberId.h:42
static const int layerNumBits_
Definition: DTChamberId.h:80
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
static const int maxSectorId
highest sector id.
Definition: DTChamberId.h:58