CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTSuperLayerId.cc
Go to the documentation of this file.
1 
9 #include <iostream>
12 
13 
14 
16 
17 
18 
20  id_ = id & slIdMask_; // Mask the bits outside DTSuperLayerId fields
21  checkMuonId(); // Check this is a valid id for muon DTs.
22 }
23 
24 
26  int station,
27  int sector,
28  int superlayer) : DTChamberId(wheel, station, sector) {
29  if(superlayer < minSuperLayerId || superlayer > maxSuperLayerId) {
30  throw cms::Exception("InvalidDetId") << "DTSuperLayerId ctor:"
31  << " Invalid parameters: "
32  << " Wh:"<< wheel
33  << " St:"<< station
34  << " Se:"<< sector
35  << " Sl:"<< superlayer
36  << std::endl;
37  }
38  id_ |= (superlayer & slMask_) << slayerStartBit_;
39  }
40 
41 
42 
43 // Copy Constructor.
45  // The mask is required for proper slicing, i.e. if slId is
46  // actually a derived class.
47  id_ = (slId.rawId() & slIdMask_);
48 }
49 
50 
51 
52 // Constructor from a camberId and SL number
53 DTSuperLayerId::DTSuperLayerId(const DTChamberId& chId, int superlayer) : DTChamberId(chId) {
54  if(superlayer < minSuperLayerId || superlayer > maxSuperLayerId) {
55  throw cms::Exception("InvalidDetId") << "DTSuperLayerId ctor:"
56  << " Invalid parameter: "
57  << " Sl:"<< superlayer
58  << std::endl;
59  }
60  id_ |= (superlayer & slMask_) << slayerStartBit_;
61 }
62 
63 
64 
65 
66 
67 
68 std::ostream& operator<<( std::ostream& os, const DTSuperLayerId& id ){
69  os << " Wh:"<< id.wheel()
70  << " St:"<< id.station()
71  << " Se:"<< id.sector()
72  << " Sl:"<< id.superlayer()
73  <<" ";
74 
75  return os;
76 }
77 
static const uint32_t slIdMask_
Definition: DTChamberId.h:119
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
static const uint32_t slMask_
Definition: DTChamberId.h:114
void checkMuonId()
Definition: DTChamberId.cc:59
static const int maxSuperLayerId
highest superlayer id
Definition: DTChamberId.h:83
uint32_t id_
Definition: DetId.h:57
static const int slayerStartBit_
Definition: DTChamberId.h:101