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 
23  public:
24 
27 
29  enum MTDType { typeUNKNOWN=0, BTL=1, ETL=2 };
30 
31  static const uint32_t kMTDsubdOffset = 23;
32  static const uint32_t kMTDsubdMask = 0x3;
33  static const uint32_t kZsideOffset = 22;
34  static const uint32_t kZsideMask = 0x1;
35  static const uint32_t kRodRingOffset = 16;
36  static const uint32_t kRodRingMask = 0x3F;
37 
38  // ---------- Constructors, enumerated types ----------
39 
41  MTDDetId() : DetId() {;}
42 
44  MTDDetId( const uint32_t& raw_id ) : DetId( raw_id ) {;}
45 
47  MTDDetId( const DetId& det_id ) : DetId( det_id.rawId() ) {;}
48 
50  MTDDetId( Detector det, int subdet ) : DetId( det, subdet ) {;}
51 
52  // ---------- Common methods ----------
53 
55  inline SubDetector subDetector() const { return static_cast<MTDDetId::SubDetector>(subdetId()); }
56 
58  inline int mtdSubDetector() const { return (id_>>kMTDsubdOffset)&kMTDsubdMask; }
59 
61  inline int mtdSide() const { return (id_>>kZsideOffset)&kZsideMask; }
63  inline int zside() const { return (mtdSide()==1 ? (1):(-1)) ; }
64 
66  inline int mtdRR() const { return (id_>>kRodRingOffset)&kRodRingMask; }
67 
68 };
69 
70 std::ostream& operator<< ( std::ostream&, const MTDDetId& );
71 
72 #endif // DataFormats_MTDDetId_MTDDetId_h
73 
MTDDetId(const uint32_t &raw_id)
Definition: MTDDetId.h:44
static const uint32_t kRodRingOffset
Definition: MTDDetId.h:35
MTDDetId()
Definition: MTDDetId.h:41
std::ostream & operator<<(std::ostream &, const MTDDetId &)
Definition: MTDDetId.cc:5
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
static const uint32_t kZsideOffset
Definition: MTDDetId.h:33
static const uint32_t kMTDsubdOffset
Definition: MTDDetId.h:31
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
MTDDetId(const DetId &det_id)
Definition: MTDDetId.h:47
static const uint32_t kRodRingMask
Definition: MTDDetId.h:36
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
static const uint32_t kMTDsubdMask
Definition: MTDDetId.h:32
static const uint32_t kZsideMask
Definition: MTDDetId.h:34
int mtdRR() const
Definition: MTDDetId.h:66
MTDDetId(Detector det, int subdet)
Definition: MTDDetId.h:50
int mtdSide() const
Definition: MTDDetId.h:61
Definition: DetId.h:18
Detector
Definition: DetId.h:26
uint32_t id_
Definition: DetId.h:62
SubDetector
Definition: MTDDetId.h:26
SubDetector subDetector() const
Definition: MTDDetId.h:55
int zside() const
Definition: MTDDetId.h:63
int mtdSubDetector() const
Definition: MTDDetId.h:58
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39