CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  }
26  id_ |= (superlayer & slMask_) << slayerStartBit_;
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  }
43  id_ |= (superlayer & slMask_) << slayerStartBit_;
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 }
static const uint32_t slIdMask_
Definition: DTChamberId.h:100
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
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
uint32_t id_
Definition: DetId.h:69
static const int slayerStartBit_
Definition: DTChamberId.h:83