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