CMS 3D CMS Logo

DTChamberId.cc
Go to the documentation of this file.
1 
10 #include <ostream>
11 
12 using namespace std;
13 
15 
16 DTChamberId::DTChamberId(uint32_t id) : DetId(id & chamberIdMask_) { // Mask the bits outside DTChamberId fields
17  checkMuonId(); // Check this is a valid id for muon DTs.
18 }
19 DTChamberId::DTChamberId(DetId id) : DetId(id.rawId() & chamberIdMask_) { // Mask the bits outside DTChamberId fields
20  checkMuonId(); // Check this is a valid id for muon DTs.
21 }
22 
24  // Check that arguments are within the range
25  if (wheel < minWheelId || wheel > maxWheelId || station < minStationId || station > maxStationId ||
26  sector < minSectorId || sector > maxSectorId) {
27  throw cms::Exception("InvalidDetId") << "DTChamberId ctor:"
28  << " Invalid parameters: "
29  << " Wh:" << wheel << " St:" << station << " Se:" << sector << std::endl;
30  }
31 
32  int tmpwheelid = wheel - minWheelId + 1;
33  id_ |= (tmpwheelid & wheelMask_) << wheelStartBit_ | (station & stationMask_) << stationStartBit_ |
35 }
36 
38  // The mask is required for proper slicing, i.e. if chId is actually a derived class.
39  : DetId(chId.rawId() & chamberIdMask_) {}
40 
42  if (det() != DetId::Muon || subdetId() != MuonSubdetId::DT) {
43  throw cms::Exception("InvalidDetId") << "DTChamberId ctor:"
44  << " det: " << det() << " subdet: " << subdetId() << " is not a valid DT id";
45  }
46 }
47 
48 std::ostream& operator<<(std::ostream& os, const DTChamberId& id) {
49  os << " Wh:" << id.wheel() << " St:" << id.station() << " Se:" << id.sector() << " ";
50 
51  return os;
52 }
DTChamberId::stationStartBit_
static const int stationStartBit_
Definition: DTChamberId.h:90
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
Muon
Definition: Muon.py:1
DTChamberId::sectorStartBit_
static const int sectorStartBit_
Definition: DTChamberId.h:87
DetId
Definition: DetId.h:17
DTChamberId::wheelStartBit_
static const int wheelStartBit_
Definition: DTChamberId.h:85
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
DTChamberId.h
operator<<
std::ostream & operator<<(std::ostream &os, const DTChamberId &id)
Definition: DTChamberId.cc:48
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
DTChamberId::checkMuonId
void checkMuonId()
Definition: DTChamberId.cc:41
GeomDetEnumerators::DT
Definition: GeomDetEnumerators.h:18
DTChamberId::maxWheelId
static const int maxWheelId
highest wheel number
Definition: DTChamberId.h:62
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
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTChamberId::DTChamberId
DTChamberId()
Definition: DTChamberId.cc:14
MuonSubdetId.h
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
std
Definition: JetResolutionObject.h:76
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Exception
Definition: hltDiff.cc:246
Exception.h
DTChamberId::maxSectorId
static const int maxSectorId
highest sector id.
Definition: DTChamberId.h:58
DTChamberId::wheelMask_
static const uint32_t wheelMask_
Definition: DTChamberId.h:92
DetId::Muon
Definition: DetId.h:26
DTChamberId
Definition: DTChamberId.h:14
MuonSubdetId
Definition: MuonSubdetId.h:9
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