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 
10 #include <ostream>
11 
12 using namespace std;
13 
15 
16 
18  DetId(id & chamberIdMask_) { // Mask the bits outside DTChamberId fields
19  checkMuonId(); // Check this is a valid id for muon DTs.
20 }
22  DetId(id.rawId() & chamberIdMask_) { // Mask the bits outside DTChamberId fields
23  checkMuonId(); // Check this is a valid id for muon DTs.
24 }
25 
26 
27 
28 DTChamberId::DTChamberId(int wheel, int station, int sector):
30  // Check that arguments are within the range
31  if (wheel < minWheelId || wheel > maxWheelId ||
32  station < minStationId || station > maxStationId ||
33  sector < minSectorId || sector > maxSectorId) {
34  throw cms::Exception("InvalidDetId") << "DTChamberId ctor:"
35  << " Invalid parameters: "
36  << " Wh:"<< wheel
37  << " St:"<< station
38  << " Se:"<< sector
39  << std::endl;
40  }
41 
42  int tmpwheelid = wheel- minWheelId +1;
43  id_ |= (tmpwheelid& wheelMask_) << wheelStartBit_ |
44  (station & stationMask_) << stationStartBit_ |
45  (sector &sectorMask_ ) << sectorStartBit_;
46 
47 }
48 
49 
50 
52  DetId(chId.rawId() & chamberIdMask_) { // The mask is required for proper slicing, i.e. if chId is actually a derived class.
53 }
54 
55 
56 
59  throw cms::Exception("InvalidDetId") << "DTChamberId ctor:"
60  << " det: " << det()
61  << " subdet: " << subdetId()
62  << " is not a valid DT id";
63  }
64 }
65 
66 
67 
68 std::ostream& operator<<( std::ostream& os, const DTChamberId& id ){
69  os << " Wh:"<< id.wheel()
70  << " St:"<< id.station()
71  << " Se:"<< id.sector()
72  <<" ";
73 
74  return os;
75 }
76 
77 
78 
static const int sectorStartBit_
Definition: DTChamberId.h:103
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
static const int wheelStartBit_
Definition: DTChamberId.h:101
static const uint32_t stationMask_
Definition: DTChamberId.h:110
void checkMuonId()
Definition: DTChamberId.cc:57
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
static const uint32_t sectorMask_
Definition: DTChamberId.h:111
static const int maxStationId
highest station id
Definition: DTChamberId.h:69
static const int minWheelId
lowest wheel number
Definition: DTChamberId.h:75
Definition: DetId.h:18
static const int maxWheelId
highest wheel number
Definition: DTChamberId.h:77
uint32_t id_
Definition: DetId.h:55
static const uint32_t wheelMask_
Definition: DTChamberId.h:109
static const int DT
Definition: MuonSubdetId.h:12
static const int stationStartBit_
Definition: DTChamberId.h:106
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
static const int maxSectorId
highest sector id.
Definition: DTChamberId.h:73