File indexing completed on 2024-04-06 12:04:46
0001
0002
0003
0004
0005
0006
0007 #include <iostream>
0008 #include <DataFormats/MuonDetId/interface/DTSuperLayerId.h>
0009 #include <FWCore/Utilities/interface/Exception.h>
0010
0011 DTSuperLayerId::DTSuperLayerId() : DTChamberId() {}
0012
0013 DTSuperLayerId::DTSuperLayerId(uint32_t id) {
0014 id_ = id & slIdMask_;
0015 checkMuonId();
0016 }
0017
0018 DTSuperLayerId::DTSuperLayerId(int wheel, int station, int sector, int superlayer)
0019 : DTChamberId(wheel, station, sector) {
0020 if (superlayer < minSuperLayerId || superlayer > maxSuperLayerId) {
0021 throw cms::Exception("InvalidDetId") << "DTSuperLayerId ctor:"
0022 << " Invalid parameters: "
0023 << " Wh:" << wheel << " St:" << station << " Se:" << sector
0024 << " Sl:" << superlayer << std::endl;
0025 }
0026 id_ |= (superlayer & slMask_) << slayerStartBit_;
0027 }
0028
0029
0030 DTSuperLayerId::DTSuperLayerId(const DTSuperLayerId& slId) : DTChamberId() {
0031
0032
0033 id_ = (slId.rawId() & slIdMask_);
0034 }
0035
0036
0037 DTSuperLayerId::DTSuperLayerId(const DTChamberId& chId, int superlayer) : DTChamberId(chId) {
0038 if (superlayer < minSuperLayerId || superlayer > maxSuperLayerId) {
0039 throw cms::Exception("InvalidDetId") << "DTSuperLayerId ctor:"
0040 << " Invalid parameter: "
0041 << " Sl:" << superlayer << std::endl;
0042 }
0043 id_ |= (superlayer & slMask_) << slayerStartBit_;
0044 }
0045
0046 std::ostream& operator<<(std::ostream& os, const DTSuperLayerId& id) {
0047 os << " Wh:" << id.wheel() << " St:" << id.station() << " Se:" << id.sector() << " Sl:" << id.superlayer() << " ";
0048
0049 return os;
0050 }