CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTChamberId.cc
Go to the documentation of this file.
1 
12 #include <ostream>
13 
14 using namespace std;
15 
17 
18 
20  DetId(id & chamberIdMask_) { // Mask the bits outside DTChamberId fields
21  checkMuonId(); // Check this is a valid id for muon DTs.
22 }
24  DetId(id.rawId() & chamberIdMask_) { // Mask the bits outside DTChamberId fields
25  checkMuonId(); // Check this is a valid id for muon DTs.
26 }
27 
28 
29 
30 DTChamberId::DTChamberId(int wheel, int station, int sector):
31  DetId(DetId::Muon, MuonSubdetId::DT) {
32  // Check that arguments are within the range
33  if (wheel < minWheelId || wheel > maxWheelId ||
34  station < minStationId || station > maxStationId ||
35  sector < minSectorId || sector > maxSectorId) {
36  throw cms::Exception("InvalidDetId") << "DTChamberId ctor:"
37  << " Invalid parameters: "
38  << " Wh:"<< wheel
39  << " St:"<< station
40  << " Se:"<< sector
41  << std::endl;
42  }
43 
44  int tmpwheelid = wheel- minWheelId +1;
45  id_ |= (tmpwheelid& wheelMask_) << wheelStartBit_ |
46  (station & stationMask_) << stationStartBit_ |
47  (sector &sectorMask_ ) << sectorStartBit_;
48 
49 }
50 
51 
52 
54  DetId(chId.rawId() & chamberIdMask_) { // The mask is required for proper slicing, i.e. if chId is actually a derived class.
55 }
56 
57 
58 
61  throw cms::Exception("InvalidDetId") << "DTChamberId ctor:"
62  << " det: " << det()
63  << " subdet: " << subdetId()
64  << " is not a valid DT id";
65  }
66 }
67 
68 
69 
70 std::ostream& operator<<( std::ostream& os, const DTChamberId& id ){
71  os << " Wh:"<< id.wheel()
72  << " St:"<< id.station()
73  << " Se:"<< id.sector()
74  <<" ";
75 
76  return os;
77 }
78 
79 
80 
static const int sectorStartBit_
Definition: DTChamberId.h:105
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static const int wheelStartBit_
Definition: DTChamberId.h:103
static const uint32_t stationMask_
Definition: DTChamberId.h:112
void checkMuonId()
Definition: DTChamberId.cc:59
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
static const uint32_t sectorMask_
Definition: DTChamberId.h:113
static const int maxStationId
highest station id
Definition: DTChamberId.h:71
static const int minWheelId
lowest wheel number
Definition: DTChamberId.h:77
Definition: DetId.h:20
static const int maxWheelId
highest wheel number
Definition: DTChamberId.h:79
uint32_t id_
Definition: DetId.h:57
static const uint32_t wheelMask_
Definition: DTChamberId.h:111
static const int DT
Definition: MuonSubdetId.h:14
static const int stationStartBit_
Definition: DTChamberId.h:108
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
static const int maxSectorId
highest sector id.
Definition: DTChamberId.h:75