CMS 3D CMS Logo

MTDDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_MTDDetId_MTDDetId_h
2 #define DataFormats_MTDDetId_MTDDetId_h
3 
6 #include <ostream>
7 
21 class MTDDetId : public DetId {
22 public:
24  enum SubDetector { subUNKNOWN = 0, FastTime = 1 };
25 
27  enum MTDType { typeUNKNOWN = 0, BTL = 1, ETL = 2 };
28 
29  static const uint32_t kMTDsubdOffset = 23;
30  static const uint32_t kMTDsubdMask = 0x3;
31  static const uint32_t kZsideOffset = 22;
32  static const uint32_t kZsideMask = 0x1;
33  static const uint32_t kRodRingOffset = 16;
34  static const uint32_t kRodRingMask = 0x3F;
35 
36  // ---------- Constructors, enumerated types ----------
37 
39  MTDDetId() : DetId() { ; }
40 
42  MTDDetId(const uint32_t& raw_id) : DetId(raw_id) { ; }
43 
45  MTDDetId(const DetId& det_id) : DetId(det_id.rawId()) { ; }
46 
48  MTDDetId(Detector det, int subdet) : DetId(det, subdet) { ; }
49 
50  // ---------- Common methods ----------
51 
53  inline SubDetector subDetector() const { return static_cast<MTDDetId::SubDetector>(subdetId()); }
54 
56  inline int mtdSubDetector() const { return (id_ >> kMTDsubdOffset) & kMTDsubdMask; }
57 
59  inline int mtdSide() const { return (id_ >> kZsideOffset) & kZsideMask; }
61  inline int zside() const { return (mtdSide() == 1 ? (1) : (-1)); }
62 
64  inline int mtdRR() const { return (id_ >> kRodRingOffset) & kRodRingMask; }
65 };
66 
67 std::ostream& operator<<(std::ostream&, const MTDDetId&);
68 
69 #endif // DataFormats_MTDDetId_MTDDetId_h
MTDDetId(const uint32_t &raw_id)
Definition: MTDDetId.h:42
static const uint32_t kRodRingOffset
Definition: MTDDetId.h:33
MTDDetId()
Definition: MTDDetId.h:39
std::ostream & operator<<(std::ostream &, const MTDDetId &)
Definition: MTDDetId.cc:5
int mtdSide() const
Definition: MTDDetId.h:59
int mtdSubDetector() const
Definition: MTDDetId.h:56
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
static const uint32_t kZsideOffset
Definition: MTDDetId.h:31
static const uint32_t kMTDsubdOffset
Definition: MTDDetId.h:29
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
MTDDetId(const DetId &det_id)
Definition: MTDDetId.h:45
static const uint32_t kRodRingMask
Definition: MTDDetId.h:34
static const uint32_t kMTDsubdMask
Definition: MTDDetId.h:30
int mtdRR() const
Definition: MTDDetId.h:64
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static const uint32_t kZsideMask
Definition: MTDDetId.h:32
MTDDetId(Detector det, int subdet)
Definition: MTDDetId.h:48
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Detector
Definition: DetId.h:24
uint32_t id_
Definition: DetId.h:69
SubDetector
Definition: MTDDetId.h:24
int zside() const
Definition: MTDDetId.h:61
SubDetector subDetector() const
Definition: MTDDetId.h:53