File indexing completed on 2024-04-06 12:04:46
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 DTChamberId& operator=(const DTChamberId& chId) = default;
0040
0041
0042 int wheel() const { return int((id_ >> wheelStartBit_) & wheelMask_) + minWheelId - 1; }
0043
0044
0045 int station() const { return ((id_ >> stationStartBit_) & stationMask_); }
0046
0047
0048
0049
0050
0051
0052 int sector() const { return ((id_ >> sectorStartBit_) & sectorMask_); }
0053
0054
0055 static const int minStationId = 1;
0056
0057 static const int maxStationId = 4;
0058
0059 static const int minSectorId = 0;
0060
0061 static const int maxSectorId = 14;
0062
0063 static const int minWheelId = -2;
0064
0065 static const int maxWheelId = 2;
0066
0067 static const int minSuperLayerId = 0;
0068
0069 static const int maxSuperLayerId = 3;
0070
0071 static const int minLayerId = 0;
0072
0073 static const int maxLayerId = 4;
0074
0075 static const int minWireId = 0;
0076
0077 static const int maxWireId = 97;
0078
0079 protected:
0080
0081 static const int wireNumBits_ = 7;
0082 static const int wireStartBit_ = 3;
0083 static const int layerNumBits_ = 3;
0084 static const int layerStartBit_ = wireStartBit_ + wireNumBits_;
0085 static const int slayerNumBits_ = 2;
0086 static const int slayerStartBit_ = layerStartBit_ + layerNumBits_;
0087 static const int wheelNumBits_ = 3;
0088 static const int wheelStartBit_ = slayerStartBit_ + slayerNumBits_;
0089 static const int sectorNumBits_ = 4;
0090 static const int sectorStartBit_ = wheelStartBit_ + wheelNumBits_;
0091
0092 static const int stationNumBits_ = 3;
0093 static const int stationStartBit_ = sectorStartBit_ + sectorNumBits_;
0094
0095 static const uint32_t wheelMask_ = 0x7;
0096 static const uint32_t stationMask_ = 0x7;
0097 static const uint32_t sectorMask_ = 0xf;
0098 static const uint32_t slMask_ = 0x3;
0099 static const uint32_t lMask_ = 0x7;
0100 static const uint32_t wireMask_ = 0x7f;
0101
0102 static const uint32_t layerIdMask_ = ~(wireMask_ << wireStartBit_);
0103 static const uint32_t slIdMask_ = ~((wireMask_ << wireStartBit_) | (lMask_ << layerStartBit_));
0104 static const uint32_t chamberIdMask_ =
0105 ~((wireMask_ << wireStartBit_) | (lMask_ << layerStartBit_) | (slMask_ << slayerStartBit_));
0106
0107
0108
0109 void checkMuonId();
0110 };
0111
0112 std::ostream& operator<<(std::ostream& os, const DTChamberId& id);
0113
0114 #endif