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
operator<<
std::ostream & operator<<(std::ostream &, const MTDDetId &)
Definition: MTDDetId.cc:5
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
MTDDetId::kZsideMask
static const uint32_t kZsideMask
Definition: MTDDetId.h:32
MTDDetId::kMTDsubdMask
static const uint32_t kMTDsubdMask
Definition: MTDDetId.h:30
MTDDetId::mtdRR
int mtdRR() const
Definition: MTDDetId.h:64
ForwardSubdetector.h
DetId
Definition: DetId.h:17
MTDDetId::typeUNKNOWN
Definition: MTDDetId.h:27
MTDDetId::zside
int zside() const
Definition: MTDDetId.h:61
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
MTDDetId::mtdSubDetector
int mtdSubDetector() const
Definition: MTDDetId.h:56
MTDDetId::subUNKNOWN
Definition: MTDDetId.h:24
MTDDetId::SubDetector
SubDetector
Definition: MTDDetId.h:24
DetId::id_
uint32_t id_
Definition: DetId.h:69
MTDDetId::kRodRingMask
static const uint32_t kRodRingMask
Definition: MTDDetId.h:34
MTDDetId::MTDDetId
MTDDetId(Detector det, int subdet)
Definition: MTDDetId.h:48
MTDDetId::MTDDetId
MTDDetId()
Definition: MTDDetId.h:39
MTDDetId::FastTime
Definition: MTDDetId.h:24
DetId::Detector
Detector
Definition: DetId.h:24
MTDDetId::kZsideOffset
static const uint32_t kZsideOffset
Definition: MTDDetId.h:31
MTDDetId::MTDDetId
MTDDetId(const uint32_t &raw_id)
Definition: MTDDetId.h:42
MTDDetId::kMTDsubdOffset
static const uint32_t kMTDsubdOffset
Definition: MTDDetId.h:29
MTDDetId::MTDType
MTDType
Definition: MTDDetId.h:27
MTDDetId::BTL
Definition: MTDDetId.h:27
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DetId.h
MTDDetId::kRodRingOffset
static const uint32_t kRodRingOffset
Definition: MTDDetId.h:33
MTDDetId::ETL
Definition: MTDDetId.h:27
MTDDetId::mtdSide
int mtdSide() const
Definition: MTDDetId.h:59
MTDDetId
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
MTDDetId::MTDDetId
MTDDetId(const DetId &det_id)
Definition: MTDDetId.h:45
MTDDetId::subDetector
SubDetector subDetector() const
Definition: MTDDetId.h:53