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  DTChamberId& operator=(const DTChamberId& chId) = default;
40 
42  int wheel() const { return int((id_ >> wheelStartBit_) & wheelMask_) + minWheelId - 1; }
43 
45  int station() const { return ((id_ >> stationStartBit_) & stationMask_); }
46 
52  int sector() const { return ((id_ >> sectorStartBit_) & sectorMask_); }
53 
55  static const int minStationId = 1;
57  static const int maxStationId = 4;
59  static const int minSectorId = 0;
61  static const int maxSectorId = 14;
63  static const int minWheelId = -2;
65  static const int maxWheelId = 2;
67  static const int minSuperLayerId = 0;
69  static const int maxSuperLayerId = 3;
71  static const int minLayerId = 0;
73  static const int maxLayerId = 4;
75  static const int minWireId = 0;
77  static const int maxWireId = 97;
78 
79 protected:
81  static const int wireNumBits_ = 7;
82  static const int wireStartBit_ = 3;
83  static const int layerNumBits_ = 3;
85  static const int slayerNumBits_ = 2;
87  static const int wheelNumBits_ = 3;
89  static const int sectorNumBits_ = 4;
92  static const int stationNumBits_ = 3;
94 
95  static const uint32_t wheelMask_ = 0x7;
96  static const uint32_t stationMask_ = 0x7;
97  static const uint32_t sectorMask_ = 0xf;
98  static const uint32_t slMask_ = 0x3;
99  static const uint32_t lMask_ = 0x7;
100  static const uint32_t wireMask_ = 0x7f;
101 
102  static const uint32_t layerIdMask_ = ~(wireMask_ << wireStartBit_);
103  static const uint32_t slIdMask_ = ~((wireMask_ << wireStartBit_) | (lMask_ << layerStartBit_));
104  static const uint32_t chamberIdMask_ =
106 
107  // Perform a consistency check of the id with a DT Id
108  // It thorows an exception if this is not the case
109  void checkMuonId();
110 };
111 
112 std::ostream& operator<<(std::ostream& os, const DTChamberId& id);
113 
114 #endif
int station() const
Return the station number.
Definition: DTChamberId.h:45
static const int minSectorId
lowest sector id. 0 indicates all sectors (a station)
Definition: DTChamberId.h:59
static const int slayerNumBits_
Definition: DTChamberId.h:85
static const int wireNumBits_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: DTChamberId.h:81
static const int minStationId
lowest station id
Definition: DTChamberId.h:55
static const int sectorNumBits_
Definition: DTChamberId.h:89
static const uint32_t slIdMask_
Definition: DTChamberId.h:103
static const int sectorStartBit_
Definition: DTChamberId.h:90
static const uint32_t layerIdMask_
Definition: DTChamberId.h:102
static const int wireStartBit_
Definition: DTChamberId.h:82
static const int wheelStartBit_
Definition: DTChamberId.h:88
static const int maxWireId
highest wire id (chambers have 48 to 96 wires)
Definition: DTChamberId.h:77
DTChamberId & operator=(const DTChamberId &chId)=default
Assignment Operator.
static const uint32_t stationMask_
Definition: DTChamberId.h:96
static const int maxLayerId
highest layer id
Definition: DTChamberId.h:73
static const int minWireId
lowest wire id (numbering starts from 1 or 2). 0 indicates a full layer
Definition: DTChamberId.h:75
static const int stationNumBits_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: DTChamberId.h:92
static const uint32_t slMask_
Definition: DTChamberId.h:98
static const int minLayerId
lowest layer id. 0 indicates a full SL
Definition: DTChamberId.h:71
static const int wheelNumBits_
Definition: DTChamberId.h:87
void checkMuonId()
Definition: DTChamberId.cc:41
static const int maxSuperLayerId
highest superlayer id
Definition: DTChamberId.h:69
static const uint32_t sectorMask_
Definition: DTChamberId.h:97
static const int maxStationId
highest station id
Definition: DTChamberId.h:57
static const int layerStartBit_
Definition: DTChamberId.h:84
static const int minWheelId
lowest wheel number
Definition: DTChamberId.h:63
static const uint32_t lMask_
Definition: DTChamberId.h:99
Definition: DetId.h:17
static const int maxWheelId
highest wheel number
Definition: DTChamberId.h:65
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:67
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
int sector() const
Definition: DTChamberId.h:52
static const uint32_t chamberIdMask_
Definition: DTChamberId.h:104
static const uint32_t wireMask_
Definition: DTChamberId.h:100
static const uint32_t wheelMask_
Definition: DTChamberId.h:95
static const int slayerStartBit_
Definition: DTChamberId.h:86
static const int stationStartBit_
Definition: DTChamberId.h:93
static const int layerNumBits_
Definition: DTChamberId.h:83
static const int maxSectorId
highest sector id.
Definition: DTChamberId.h:61