CMS 3D CMS Logo

BTLDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_BTLDetId_BTLDetId_h
2 #define DataFormats_BTLDetId_BTLDetId_h
3 
5 #include <ostream>
6 
17 class BTLDetId : public MTDDetId {
18 
19  private:
20 
21  static const uint32_t kBTLmoduleOffset = 10;
22  static const uint32_t kBTLmoduleMask = 0x3F;
23  static const uint32_t kBTLmodTypeOffset = 8;
24  static const uint32_t kBTLmodTypeMask = 0x3;
25  static const uint32_t kBTLCrystalOffset = 0;
26  static const uint32_t kBTLCrystalMask = 0x3F;
27 
28  public:
29 
30  // ---------- Constructors, enumerated types ----------
31 
34 
36  BTLDetId( const uint32_t& raw_id ) : MTDDetId( raw_id ) {;}
37 
39  BTLDetId( const DetId& det_id ) : MTDDetId( det_id.rawId() ) {;}
40 
42  BTLDetId( uint32_t zside,
43  uint32_t rod,
44  uint32_t module,
45  uint32_t modtyp,
47  id_ |= ( MTDType::BTL& kMTDsubdMask ) << kMTDsubdOffset |
48  ( zside& kZsideMask ) << kZsideOffset |
49  ( rod& kRodRingMask ) << kRodRingOffset |
50  ( module& kBTLmoduleMask ) << kBTLmoduleOffset |
51  ( modtyp& kBTLmodTypeMask ) << kBTLmodTypeOffset |
52  ( (crystal-1)& kBTLCrystalMask ) << kBTLCrystalOffset ;
53 }
54 
55 // ---------- Common methods ----------
56 
58 inline int module() const { return (id_>>kBTLmoduleOffset)&kBTLmoduleMask; }
59 
61 inline int modType() const { return (id_>>kBTLmodTypeOffset)&kBTLmodTypeMask; }
62 
64  inline int crystal() const { return ((id_>>kBTLCrystalOffset)&kBTLCrystalMask) + 1; }
65 
66 };
67 
68 std::ostream& operator<< ( std::ostream&, const BTLDetId& );
69 
70 #endif // DataFormats_BTLDetId_BTLDetId_h
71 
static const uint32_t kBTLmodTypeMask
Definition: BTLDetId.h:24
static const uint32_t kRodRingOffset
Definition: MTDDetId.h:35
static const uint32_t kBTLCrystalOffset
Definition: BTLDetId.h:25
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
static const uint32_t kBTLmoduleMask
Definition: BTLDetId.h:22
int zside(DetId const &)
ForwardSubdetector
static const uint32_t kZsideOffset
Definition: MTDDetId.h:33
static const uint32_t kMTDsubdOffset
Definition: MTDDetId.h:31
static const uint32_t kBTLCrystalMask
Definition: BTLDetId.h:26
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
BTLDetId()
Definition: BTLDetId.h:33
static const uint32_t kRodRingMask
Definition: MTDDetId.h:36
static const uint32_t kBTLmoduleOffset
Definition: BTLDetId.h:21
static const uint32_t kMTDsubdMask
Definition: MTDDetId.h:32
static const uint32_t kZsideMask
Definition: MTDDetId.h:34
BTLDetId(const DetId &det_id)
Definition: BTLDetId.h:39
BTLDetId(uint32_t zside, uint32_t rod, uint32_t module, uint32_t modtyp, uint32_t crystal)
Definition: BTLDetId.h:42
Definition: DetId.h:18
uint32_t id_
Definition: DetId.h:59
int module() const
Definition: BTLDetId.h:58
static const uint32_t kBTLmodTypeOffset
Definition: BTLDetId.h:23
std::ostream & operator<<(std::ostream &, const BTLDetId &)
Definition: BTLDetId.cc:4
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
Definition: BTLDetId.h:17
BTLDetId(const uint32_t &raw_id)
Definition: BTLDetId.h:36
Definition: vlib.h:208
int modType() const
Definition: BTLDetId.h:61
int crystal() const
Definition: BTLDetId.h:64