CMS 3D CMS Logo

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 
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 
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
static const int sectorStartBit_
Definition: DTChamberId.h:103
static const int wheelStartBit_
Definition: DTChamberId.h:101
static const uint32_t stationMask_
Definition: DTChamberId.h:110
Definition: Muon.py:1
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
void checkMuonId()
Definition: DTChamberId.cc:57
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:62
int sector() const
Definition: DTChamberId.h:61
static const uint32_t chamberIdMask_
Definition: DTChamberId.h:119
static const uint32_t wheelMask_
Definition: DTChamberId.h:109
std::ostream & operator<<(std::ostream &os, const DTChamberId &id)
Definition: DTChamberId.cc:68
static constexpr int DT
Definition: MuonSubdetId.h:12
static const int stationStartBit_
Definition: DTChamberId.h:106
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
static const int maxSectorId
highest sector id.
Definition: DTChamberId.h:73
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39