CMS 3D CMS Logo

DTSuperLayerId.cc
Go to the documentation of this file.
1 
7 #include <iostream>
10 
11 
12 
14 
15 
16 
18  id_ = id & slIdMask_; // Mask the bits outside DTSuperLayerId fields
19  checkMuonId(); // Check this is a valid id for muon DTs.
20 }
21 
22 
24  int station,
25  int sector,
26  int superlayer) : DTChamberId(wheel, station, sector) {
27  if(superlayer < minSuperLayerId || superlayer > maxSuperLayerId) {
28  throw cms::Exception("InvalidDetId") << "DTSuperLayerId ctor:"
29  << " Invalid parameters: "
30  << " Wh:"<< wheel
31  << " St:"<< station
32  << " Se:"<< sector
33  << " Sl:"<< superlayer
34  << std::endl;
35  }
36  id_ |= (superlayer & slMask_) << slayerStartBit_;
37  }
38 
39 
40 
41 // Copy Constructor.
43  // The mask is required for proper slicing, i.e. if slId is
44  // actually a derived class.
45  id_ = (slId.rawId() & slIdMask_);
46 }
47 
48 
49 
50 // Constructor from a camberId and SL number
52  if(superlayer < minSuperLayerId || superlayer > maxSuperLayerId) {
53  throw cms::Exception("InvalidDetId") << "DTSuperLayerId ctor:"
54  << " Invalid parameter: "
55  << " Sl:"<< superlayer
56  << std::endl;
57  }
58  id_ |= (superlayer & slMask_) << slayerStartBit_;
59 }
60 
61 
62 
63 
64 
65 
66 std::ostream& operator<<( std::ostream& os, const DTSuperLayerId& id ){
67  os << " Wh:"<< id.wheel()
68  << " St:"<< id.station()
69  << " Se:"<< id.sector()
70  << " Sl:"<< id.superlayer()
71  <<" ";
72 
73  return os;
74 }
75 
static const uint32_t slIdMask_
Definition: DTChamberId.h:117
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
static const uint32_t slMask_
Definition: DTChamberId.h:112
void checkMuonId()
Definition: DTChamberId.cc:57
static const int maxSuperLayerId
highest superlayer id
Definition: DTChamberId.h:81
std::ostream & operator<<(std::ostream &os, const DTSuperLayerId &id)
int superlayer() const
Return the superlayer number (deprecated method name)
uint32_t id_
Definition: DetId.h:55
int sector() const
Definition: DTChamberId.h:61
static const int slayerStartBit_
Definition: DTChamberId.h:99
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45