CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTWireId.cc
Go to the documentation of this file.
1 
9 #include <iostream>
12 
13 
14 
16 
17 
18 
19 DTWireId::DTWireId(uint32_t id) {
20  id_= id;
21  checkMuonId(); // Check this is a valid id for muon DTs.
22 }
23 
24 
25 
27  int station,
28  int sector,
29  int superlayer,
30  int layer,
31  int wire) : DTLayerId(wheel, station, sector, superlayer, layer) {
32  if (wire < minWireId || wire > maxWireId) {
33  throw cms::Exception("InvalidDetId") << "DTWireId ctor:"
34  << " Invalid parameters: "
35  << " Wh:"<< wheel
36  << " St:"<< station
37  << " Se:"<< sector
38  << " Sl:"<< superlayer
39  << " La:"<< layer
40  << " Wi:"<< wire
41  << std::endl;
42  }
43 
44  id_ |= (wire & wireMask_) << wireStartBit_;
45  }
46 
47 
48 
49 // Copy Constructor.
50 DTWireId::DTWireId(const DTWireId& wireId) {
51  id_ = wireId.rawId();
52 }
53 
54 
55 
56 // Constructor from a CamberId and SL, layer and wire numbers
57 DTWireId::DTWireId(const DTChamberId& chId, int superlayer, int layer, int wire) :
58  DTLayerId(chId, superlayer, layer) {
59  if (wire < minWireId || wire > maxWireId) {
60  throw cms::Exception("InvalidDetId") << "DTWireId ctor:"
61  << " Invalid parameters: "
62  << " Wi:"<< wire
63  << std::endl;
64  }
65 
66  id_ |= (wire & wireMask_) << wireStartBit_;
67  }
68 
69 
70 
71 // Constructor from a SuperLayerId and layer and wire numbers
72 DTWireId::DTWireId(const DTSuperLayerId& slId, int layer, int wire) :
73  DTLayerId(slId, layer) {
74  if (wire < minWireId || wire > maxWireId) {
75  throw cms::Exception("InvalidDetId") << "DTWireId ctor:"
76  << " Invalid parameters: "
77  << " Wi:"<< wire
78  << std::endl;
79  }
80 
81  id_ |= (wire & wireMask_) << wireStartBit_;
82  }
83 
84 
85 
86 // Constructor from a layerId and a wire number
87 DTWireId::DTWireId(const DTLayerId& layerId, int wire) : DTLayerId(layerId) {
88  if (wire < minWireId || wire > maxWireId) {
89  throw cms::Exception("InvalidDetId") << "DTWireId ctor:"
90  << " Invalid parameters: "
91  << " Wi:"<< wire
92  << std::endl;
93  }
94 
95  id_ |= (wire & wireMask_) << wireStartBit_;
96 }
97 
98 
99 
100 // Ostream operator
101 std::ostream& operator<<( std::ostream& os, const DTWireId& id ){
102 
103  os << " Wh:"<< id.wheel()
104  << " St:"<< id.station()
105  << " Se:"<< id.sector()
106  << " Sl:"<< id.superlayer()
107  << " La:"<< id.layer()
108  << " Wi:"<< id.wire()
109  <<" ";
110 
111  return os;
112 }
113 
114 
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
static const int wireStartBit_
Definition: DTChamberId.h:95
static const int maxWireId
highest wire id (chambers have 48 to 96 wires)
Definition: DTChamberId.h:89
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void checkMuonId()
Definition: DTChamberId.cc:57
uint32_t id_
Definition: DetId.h:55
static const uint32_t wireMask_
Definition: DTChamberId.h:114
DTWireId()
Definition: DTWireId.cc:15