CMS 3D CMS Logo

ETLDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_ETLDetId_ETLDetId_h
2 #define DataFormats_ETLDetId_ETLDetId_h
3 
5 #include <ostream>
6 
15 class ETLDetId : public MTDDetId {
16 
17  public:
18 
19  static const uint32_t kETLmoduleOffset = 7;
20  static const uint32_t kETLmoduleMask = 0xFF;
21  static const uint32_t kETLmodTypeOffset = 5;
22  static const uint32_t kETLmodTypeMask = 0x3;
23 
24  // ---------- Constructors, enumerated types ----------
25 
28 
30  ETLDetId( const uint32_t& raw_id ) : MTDDetId( raw_id ) {;}
31 
33  ETLDetId( const DetId& det_id ) : MTDDetId( det_id.rawId() ) {;}
34 
36  ETLDetId( uint32_t zside,
37  uint32_t ring,
38  uint32_t module,
39  uint32_t modtyp ) : MTDDetId( DetId::Forward, ForwardSubdetector::FastTime ) {
40  id_ |= ( MTDType::ETL& kMTDsubdMask ) << kMTDsubdOffset |
41  ( zside& kZsideMask ) << kZsideOffset |
42  ( ring& kRodRingMask ) << kRodRingOffset |
43  ( module& kETLmoduleMask ) << kETLmoduleOffset |
44  ( modtyp& kETLmodTypeMask ) << kETLmodTypeOffset ;
45 }
46 
47 // ---------- Common methods ----------
48 
50 inline int module() const { return (id_>>kETLmoduleOffset)&kETLmoduleMask; }
51 
53 inline int modType() const { return (id_>>kETLmodTypeOffset)&kETLmodTypeMask; }
54 
55 };
56 
57 std::ostream& operator<< ( std::ostream&, const ETLDetId& );
58 
59 #endif // DataFormats_ETLDetId_ETLDetId_h
60 
static const uint32_t kRodRingOffset
Definition: MTDDetId.h:35
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
int modType() const
Definition: ETLDetId.h:53
ETLDetId(const uint32_t &raw_id)
Definition: ETLDetId.h:30
ForwardSubdetector
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
static const uint32_t kETLmodTypeMask
Definition: ETLDetId.h:22
static const uint32_t kRodRingMask
Definition: MTDDetId.h:36
ETLDetId(uint32_t zside, uint32_t ring, uint32_t module, uint32_t modtyp)
Definition: ETLDetId.h:36
static const uint32_t kMTDsubdMask
Definition: MTDDetId.h:32
static const uint32_t kZsideMask
Definition: MTDDetId.h:34
Definition: DetId.h:18
std::ostream & operator<<(std::ostream &, const ETLDetId &)
Definition: ETLDetId.cc:4
uint32_t id_
Definition: DetId.h:62
static const uint32_t kETLmodTypeOffset
Definition: ETLDetId.h:21
static const uint32_t kETLmoduleMask
Definition: ETLDetId.h:20
ETLDetId(const DetId &det_id)
Definition: ETLDetId.h:33
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:15
int module() const
Definition: ETLDetId.h:50
int zside() const
Definition: MTDDetId.h:63
ETLDetId()
Definition: ETLDetId.h:27
static const uint32_t kETLmoduleOffset
Definition: ETLDetId.h:19
Definition: vlib.h:208