File indexing completed on 2023-03-17 10:50:42
0001 #ifndef MuonDetId_DTChamberId_H
0002 #define MuonDetId_DTChamberId_H
0003
0004
0005
0006
0007
0008
0009
0010 #include <DataFormats/DetId/interface/DetId.h>
0011
0012 #include <iosfwd>
0013
0014 class DTChamberId : public DetId {
0015 public:
0016
0017
0018 DTChamberId();
0019
0020
0021
0022
0023
0024
0025 DTChamberId(uint32_t id);
0026 DTChamberId(DetId id);
0027
0028
0029
0030
0031 DTChamberId(int wheel, int station, int sector);
0032
0033
0034
0035
0036 DTChamberId(const DTChamberId& chId);
0037
0038
0039 int wheel() const { return int((id_ >> wheelStartBit_) & wheelMask_) + minWheelId - 1; }
0040
0041
0042 int station() const { return ((id_ >> stationStartBit_) & stationMask_); }
0043
0044
0045
0046
0047
0048
0049 int sector() const { return ((id_ >> sectorStartBit_) & sectorMask_); }
0050
0051
0052 static const int minStationId = 1;
0053
0054 static const int maxStationId = 4;
0055
0056 static const int minSectorId = 0;
0057
0058 static const int maxSectorId = 14;
0059
0060 static const int minWheelId = -2;
0061
0062 static const int maxWheelId = 2;
0063
0064 static const int minSuperLayerId = 0;
0065
0066 static const int maxSuperLayerId = 3;
0067
0068 static const int minLayerId = 0;
0069
0070 static const int maxLayerId = 4;
0071
0072 static const int minWireId = 0;
0073
0074 static const int maxWireId = 97;
0075
0076 protected:
0077
0078 static const int wireNumBits_ = 7;
0079 static const int wireStartBit_ = 3;
0080 static const int layerNumBits_ = 3;
0081 static const int layerStartBit_ = wireStartBit_ + wireNumBits_;
0082 static const int slayerNumBits_ = 2;
0083 static const int slayerStartBit_ = layerStartBit_ + layerNumBits_;
0084 static const int wheelNumBits_ = 3;
0085 static const int wheelStartBit_ = slayerStartBit_ + slayerNumBits_;
0086 static const int sectorNumBits_ = 4;
0087 static const int sectorStartBit_ = wheelStartBit_ + wheelNumBits_;
0088
0089 static const int stationNumBits_ = 3;
0090 static const int stationStartBit_ = sectorStartBit_ + sectorNumBits_;
0091
0092 static const uint32_t wheelMask_ = 0x7;
0093 static const uint32_t stationMask_ = 0x7;
0094 static const uint32_t sectorMask_ = 0xf;
0095 static const uint32_t slMask_ = 0x3;
0096 static const uint32_t lMask_ = 0x7;
0097 static const uint32_t wireMask_ = 0x7f;
0098
0099 static const uint32_t layerIdMask_ = ~(wireMask_ << wireStartBit_);
0100 static const uint32_t slIdMask_ = ~((wireMask_ << wireStartBit_) | (lMask_ << layerStartBit_));
0101 static const uint32_t chamberIdMask_ =
0102 ~((wireMask_ << wireStartBit_) | (lMask_ << layerStartBit_) | (slMask_ << slayerStartBit_));
0103
0104
0105
0106 void checkMuonId();
0107 };
0108
0109 std::ostream& operator<<(std::ostream& os, const DTChamberId& id);
0110
0111 #endif