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)
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 }
int station() const
Return the station number.
Definition: DTChamberId.h:42
static const uint32_t slIdMask_
Definition: DTChamberId.h:100
static const uint32_t slMask_
Definition: DTChamberId.h:95
void checkMuonId()
Definition: DTChamberId.cc:41
static const int maxSuperLayerId
highest superlayer id
Definition: DTChamberId.h:66
std::ostream & operator<<(std::ostream &os, const DTSuperLayerId &id)
int superlayer() const
Return the superlayer number (deprecated method name)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
uint32_t id_
Definition: DetId.h:69
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int sector() const
Definition: DTChamberId.h:49
static const int slayerStartBit_
Definition: DTChamberId.h:83