00001 #ifndef MuonDetId_DTChamberId_H 00002 #define MuonDetId_DTChamberId_H 00003 00012 #include <DataFormats/DetId/interface/DetId.h> 00013 00014 #include <iosfwd> 00015 #include <iostream> // FIXME 00016 00017 class DTChamberId : public DetId { 00018 public: 00021 DTChamberId(); 00022 00023 00029 DTChamberId(uint32_t id); 00030 DTChamberId(DetId id); 00031 00032 00036 DTChamberId(int wheel, 00037 int station, 00038 int sector); 00039 00040 00044 DTChamberId(const DTChamberId& chId); 00045 00046 00048 int wheel() const { 00049 return int((id_>>wheelStartBit_) & wheelMask_)+ minWheelId -1; 00050 } 00051 00052 00054 int station() const { 00055 return ((id_>>stationStartBit_) & stationMask_); 00056 } 00057 00058 00064 int sector() const { 00065 return ((id_>>sectorStartBit_)& sectorMask_); 00066 } 00067 00068 00070 static const int minStationId= 1; 00072 static const int maxStationId= 4; 00074 static const int minSectorId= 0; 00076 static const int maxSectorId= 14; 00078 static const int minWheelId= -2; 00080 static const int maxWheelId= 2; 00082 static const int minSuperLayerId= 0; 00084 static const int maxSuperLayerId= 3; 00086 static const int minLayerId= 0; 00088 static const int maxLayerId= 4; 00090 static const int minWireId= 0; 00092 static const int maxWireId= 97; 00093 00094 00095 protected: 00097 static const int wireNumBits_= 7; 00098 static const int wireStartBit_= 3; 00099 static const int layerNumBits_= 3; 00100 static const int layerStartBit_= wireStartBit_ + wireNumBits_; 00101 static const int slayerNumBits_= 2; 00102 static const int slayerStartBit_= layerStartBit_+ layerNumBits_; 00103 static const int wheelNumBits_ = 3; 00104 static const int wheelStartBit_= slayerStartBit_ + slayerNumBits_; 00105 static const int sectorNumBits_= 4; 00106 static const int sectorStartBit_= wheelStartBit_ + wheelNumBits_; 00108 static const int stationNumBits_= 3; 00109 static const int stationStartBit_ = sectorStartBit_ + sectorNumBits_; 00110 00111 00112 static const uint32_t wheelMask_= 0x7; 00113 static const uint32_t stationMask_= 0x7; 00114 static const uint32_t sectorMask_= 0xf; 00115 static const uint32_t slMask_= 0x3; 00116 static const uint32_t lMask_= 0x7; 00117 static const uint32_t wireMask_= 0x7f; 00118 00119 static const uint32_t layerIdMask_= ~(wireMask_<<wireStartBit_); 00120 static const uint32_t slIdMask_ = ~((wireMask_<<wireStartBit_) | 00121 (lMask_<<layerStartBit_)); 00122 static const uint32_t chamberIdMask_ = ~((wireMask_<<wireStartBit_) | 00123 (lMask_<<layerStartBit_) | 00124 (slMask_<<slayerStartBit_)); 00125 00126 // Perform a consistency check of the id with a DT Id 00127 // It thorows an exception if this is not the case 00128 void checkMuonId(); 00129 00130 }; 00131 00132 00133 std::ostream& operator<<( std::ostream& os, const DTChamberId& id ); 00134 00135 #endif 00136