CMS 3D CMS Logo

DTWireId.cc
Go to the documentation of this file.
1 
8 #include <iostream>
11 
13 
14 DTWireId::DTWireId(uint32_t id) {
15  id_ = id;
16  checkMuonId(); // Check this is a valid id for muon DTs.
17 }
18 
19 DTWireId::DTWireId(int wheel, int station, int sector, int superlayer, int layer, int wire)
20  : DTLayerId(wheel, station, sector, superlayer, layer) {
21  if (wire < minWireId || wire > maxWireId) {
22  throw cms::Exception("InvalidDetId") << "DTWireId ctor:"
23  << " Invalid parameters: "
24  << " Wh:" << wheel << " St:" << station << " Se:" << sector
25  << " Sl:" << superlayer << " La:" << layer << " Wi:" << wire << std::endl;
26  }
27 
28  id_ |= (wire & wireMask_) << wireStartBit_;
29 }
30 
31 // Copy Constructor.
32 DTWireId::DTWireId(const DTWireId& wireId) : DTLayerId() { id_ = wireId.rawId(); }
33 
34 // Constructor from a CamberId and SL, layer and wire numbers
35 DTWireId::DTWireId(const DTChamberId& chId, int superlayer, int layer, int wire) : DTLayerId(chId, superlayer, layer) {
36  if (wire < minWireId || wire > maxWireId) {
37  throw cms::Exception("InvalidDetId") << "DTWireId ctor:"
38  << " Invalid parameters: "
39  << " Wi:" << wire << std::endl;
40  }
41 
42  id_ |= (wire & wireMask_) << wireStartBit_;
43 }
44 
45 // Constructor from a SuperLayerId and layer and wire numbers
46 DTWireId::DTWireId(const DTSuperLayerId& slId, int layer, int wire) : DTLayerId(slId, layer) {
47  if (wire < minWireId || wire > maxWireId) {
48  throw cms::Exception("InvalidDetId") << "DTWireId ctor:"
49  << " Invalid parameters: "
50  << " Wi:" << wire << std::endl;
51  }
52 
53  id_ |= (wire & wireMask_) << wireStartBit_;
54 }
55 
56 // Constructor from a layerId and a wire number
57 DTWireId::DTWireId(const DTLayerId& layerId, int wire) : DTLayerId(layerId) {
58  if (wire < minWireId || wire > maxWireId) {
59  throw cms::Exception("InvalidDetId") << "DTWireId ctor:"
60  << " Invalid parameters: "
61  << " Wi:" << wire << std::endl;
62  }
63 
64  id_ |= (wire & wireMask_) << wireStartBit_;
65 }
66 
67 // Ostream operator
68 std::ostream& operator<<(std::ostream& os, const DTWireId& id) {
69  os << " Wh:" << id.wheel() << " St:" << id.station() << " Se:" << id.sector() << " Sl:" << id.superlayer()
70  << " La:" << id.layer() << " Wi:" << id.wire() << " ";
71 
72  return os;
73 }
DTSuperLayerId
Definition: DTSuperLayerId.h:12
DTWireId::wire
int wire() const
Return the wire number.
Definition: DTWireId.h:42
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DTSuperLayerId::superlayer
int superlayer() const
Return the superlayer number (deprecated method name)
Definition: DTSuperLayerId.h:42
DTChamberId::maxWireId
static const int maxWireId
highest wire id (chambers have 48 to 96 wires)
Definition: DTChamberId.h:74
DTChamberId::wireStartBit_
static const int wireStartBit_
Definition: DTChamberId.h:79
DTWireId
Definition: DTWireId.h:12
DTLayerId
Definition: DTLayerId.h:12
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
DTChamberId::checkMuonId
void checkMuonId()
Definition: DTChamberId.cc:41
DetId::id_
uint32_t id_
Definition: DetId.h:69
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTChamberId::wireMask_
static const uint32_t wireMask_
Definition: DTChamberId.h:97
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
operator<<
std::ostream & operator<<(std::ostream &os, const DTWireId &id)
Definition: DTWireId.cc:68
DTWireId.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
Exception
Definition: hltDiff.cc:245
DTWireId::DTWireId
DTWireId()
Definition: DTWireId.cc:12
Exception.h
DTChamberId
Definition: DTChamberId.h:14
DTLayerId::layer
int layer() const
Return the layer number.
Definition: DTLayerId.h:42
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42