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;
82  static const int slayerNumBits_ = 2;
84  static const int wheelNumBits_ = 3;
86  static const int sectorNumBits_ = 4;
89  static const int stationNumBits_ = 3;
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_ =
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
DTChamberId::stationStartBit_
static const int stationStartBit_
Definition: DTChamberId.h:90
DTChamberId::layerNumBits_
static const int layerNumBits_
Definition: DTChamberId.h:80
DTChamberId::slayerNumBits_
static const int slayerNumBits_
Definition: DTChamberId.h:82
operator<<
std::ostream & operator<<(std::ostream &os, const DTChamberId &id)
Definition: DTChamberId.cc:48
DTChamberId::sectorNumBits_
static const int sectorNumBits_
Definition: DTChamberId.h:86
DTChamberId::minSectorId
static const int minSectorId
lowest sector id. 0 indicates all sectors (a station)
Definition: DTChamberId.h:56
DTChamberId::wireNumBits_
static const int wireNumBits_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: DTChamberId.h:78
DTChamberId::layerIdMask_
static const uint32_t layerIdMask_
Definition: DTChamberId.h:99
DTChamberId::maxWireId
static const int maxWireId
highest wire id (chambers have 48 to 96 wires)
Definition: DTChamberId.h:74
DTChamberId::sectorStartBit_
static const int sectorStartBit_
Definition: DTChamberId.h:87
DTChamberId::minStationId
static const int minStationId
lowest station id
Definition: DTChamberId.h:52
DetId
Definition: DetId.h:17
DTChamberId::slIdMask_
static const uint32_t slIdMask_
Definition: DTChamberId.h:100
DTChamberId::wireStartBit_
static const int wireStartBit_
Definition: DTChamberId.h:79
DTChamberId::wheelStartBit_
static const int wheelStartBit_
Definition: DTChamberId.h:85
DTChamberId::minWireId
static const int minWireId
lowest wire id (numbering starts from 1 or 2). 0 indicates a full layer
Definition: DTChamberId.h:72
DTChamberId::minLayerId
static const int minLayerId
lowest layer id. 0 indicates a full SL
Definition: DTChamberId.h:68
DTChamberId::wheelNumBits_
static const int wheelNumBits_
Definition: DTChamberId.h:84
DTChamberId::checkMuonId
void checkMuonId()
Definition: DTChamberId.cc:41
DTChamberId::maxWheelId
static const int maxWheelId
highest wheel number
Definition: DTChamberId.h:62
DTChamberId::stationNumBits_
static const int stationNumBits_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: DTChamberId.h:89
DTChamberId::slMask_
static const uint32_t slMask_
Definition: DTChamberId.h:95
DetId::id_
uint32_t id_
Definition: DetId.h:69
DTChamberId::stationMask_
static const uint32_t stationMask_
Definition: DTChamberId.h:93
DTChamberId::minWheelId
static const int minWheelId
lowest wheel number
Definition: DTChamberId.h:60
DTChamberId::lMask_
static const uint32_t lMask_
Definition: DTChamberId.h:96
DTChamberId::maxLayerId
static const int maxLayerId
highest layer id
Definition: DTChamberId.h:70
createfilelist.int
int
Definition: createfilelist.py:10
DTChamberId::layerStartBit_
static const int layerStartBit_
Definition: DTChamberId.h:81
DTChamberId::DTChamberId
DTChamberId()
Definition: DTChamberId.cc:14
DTChamberId::wireMask_
static const uint32_t wireMask_
Definition: DTChamberId.h:97
DTChamberId::maxSuperLayerId
static const int maxSuperLayerId
highest superlayer id
Definition: DTChamberId.h:66
DTChamberId::maxStationId
static const int maxStationId
highest station id
Definition: DTChamberId.h:54
DTChamberId::sectorMask_
static const uint32_t sectorMask_
Definition: DTChamberId.h:94
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
DTChamberId::chamberIdMask_
static const uint32_t chamberIdMask_
Definition: DTChamberId.h:101
DTChamberId::slayerStartBit_
static const int slayerStartBit_
Definition: DTChamberId.h:83
DetId.h
DTChamberId::minSuperLayerId
static const int minSuperLayerId
loweset super layer id. 0 indicates a full chamber
Definition: DTChamberId.h:64
DTChamberId::maxSectorId
static const int maxSectorId
highest sector id.
Definition: DTChamberId.h:58
DTChamberId::wheelMask_
static const uint32_t wheelMask_
Definition: DTChamberId.h:92
DTChamberId
Definition: DTChamberId.h:14
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42