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  private:
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  public:
25 
26  // ---------- Constructors, enumerated types ----------
27 
30 
32  ETLDetId( const uint32_t& raw_id ) : MTDDetId( raw_id ) {;}
33 
35  ETLDetId( const DetId& det_id ) : MTDDetId( det_id.rawId() ) {;}
36 
38  ETLDetId( uint32_t zside,
39  uint32_t ring,
40  uint32_t module,
41  uint32_t modtyp ) : MTDDetId( DetId::Forward, ForwardSubdetector::FastTime ) {
42  id_ |= ( MTDType::ETL& kMTDsubdMask ) << kMTDsubdOffset |
43  ( zside& kZsideMask ) << kZsideOffset |
44  ( ring& kRodRingMask ) << kRodRingOffset |
45  ( module& kETLmoduleMask ) << kETLmoduleOffset |
46  ( modtyp& kETLmodTypeMask ) << kETLmodTypeOffset ;
47 }
48 
49 // ---------- Common methods ----------
50 
52 inline int module() const { return (id_>>kETLmoduleOffset)&kETLmoduleMask; }
53 
55 inline int modType() const { return (id_>>kETLmodTypeOffset)&kETLmodTypeMask; }
56 
57 };
58 
59 std::ostream& operator<< ( std::ostream&, const ETLDetId& );
60 
61 #endif // DataFormats_ETLDetId_ETLDetId_h
62 
static const uint32_t kRodRingOffset
Definition: MTDDetId.h:35
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
int modType() const
Definition: ETLDetId.h:55
int zside(DetId const &)
ETLDetId(const uint32_t &raw_id)
Definition: ETLDetId.h:32
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:38
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:59
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:35
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:15
int module() const
Definition: ETLDetId.h:52
ETLDetId()
Definition: ETLDetId.h:29
static const uint32_t kETLmoduleOffset
Definition: ETLDetId.h:19
Definition: vlib.h:208