CMS 3D CMS Logo

DTSuperLayerId.cc
Go to the documentation of this file.
1 
7 #include <iostream>
10 
12 
14  id_ = id & slIdMask_; // Mask the bits outside DTSuperLayerId fields
15  checkMuonId(); // Check this is a valid id for muon DTs.
16 }
17 
18 DTSuperLayerId::DTSuperLayerId(int wheel, int station, int sector, int superlayer)
19  : DTChamberId(wheel, station, sector) {
20  if (superlayer < minSuperLayerId || superlayer > maxSuperLayerId) {
21  throw cms::Exception("InvalidDetId") << "DTSuperLayerId ctor:"
22  << " Invalid parameters: "
23  << " Wh:" << wheel << " St:" << station << " Se:" << sector
24  << " Sl:" << superlayer << std::endl;
25  }
27 }
28 
29 // Copy Constructor.
31  // The mask is required for proper slicing, i.e. if slId is
32  // actually a derived class.
33  id_ = (slId.rawId() & slIdMask_);
34 }
35 
36 // Constructor from a camberId and SL number
37 DTSuperLayerId::DTSuperLayerId(const DTChamberId& chId, int superlayer) : DTChamberId(chId) {
38  if (superlayer < minSuperLayerId || superlayer > maxSuperLayerId) {
39  throw cms::Exception("InvalidDetId") << "DTSuperLayerId ctor:"
40  << " Invalid parameter: "
41  << " Sl:" << superlayer << std::endl;
42  }
44 }
45 
46 std::ostream& operator<<(std::ostream& os, const DTSuperLayerId& id) {
47  os << " Wh:" << id.wheel() << " St:" << id.station() << " Se:" << id.sector() << " Sl:" << id.superlayer() << " ";
48 
49  return os;
50 }
DTSuperLayerId
Definition: DTSuperLayerId.h:12
operator<<
std::ostream & operator<<(std::ostream &os, const DTSuperLayerId &id)
Definition: DTSuperLayerId.cc:46
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DTSuperLayerId::superlayer
int superlayer() const
Return the superlayer number (deprecated method name)
Definition: DTSuperLayerId.h:42
DTChamberId::slIdMask_
static const uint32_t slIdMask_
Definition: DTChamberId.h:100
DTSuperLayerId::DTSuperLayerId
DTSuperLayerId()
Definition: DTSuperLayerId.cc:11
DTChamberId::checkMuonId
void checkMuonId()
Definition: DTChamberId.cc:41
DTChamberId::slMask_
static const uint32_t slMask_
Definition: DTChamberId.h:95
DetId::id_
uint32_t id_
Definition: DetId.h:69
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTChamberId::maxSuperLayerId
static const int maxSuperLayerId
highest superlayer id
Definition: DTChamberId.h:66
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DTChamberId::slayerStartBit_
static const int slayerStartBit_
Definition: DTChamberId.h:83
Exception
Definition: hltDiff.cc:246
Exception.h
DTChamberId
Definition: DTChamberId.h:14
DTSuperLayerId.h
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