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 #include <array>
7 
19 class BTLDetId : public MTDDetId {
20 public:
21  static constexpr uint32_t kBTLmoduleOffset = 10;
22  static constexpr uint32_t kBTLmoduleMask = 0x3F;
23  static constexpr uint32_t kBTLmodTypeOffset = 8;
24  static constexpr uint32_t kBTLmodTypeMask = 0x3;
25  static constexpr uint32_t kBTLRUOffset = 6;
26  static constexpr uint32_t kBTLRUMask = 0x3;
27  static constexpr uint32_t kBTLCrystalOffset = 0;
28  static constexpr uint32_t kBTLCrystalMask = 0x3F;
29 
31  static constexpr uint32_t HALF_ROD = 36;
32  static constexpr uint32_t kModulesPerRODBarPhiFlat = 48;
33  static constexpr uint32_t kModulePerTypeBarPhiFlat = 48 / 3;
34  static constexpr uint32_t kRUPerTypeV2 = 2;
35  static constexpr uint32_t kModulesPerRUV2 = 24;
36  static constexpr uint32_t kCrystalsPerModuleV2 = 16;
37  static constexpr uint32_t kModulesPerTrkV2 = 3;
38  static constexpr uint32_t kCrystalTypes = 3;
39 
40  // Number of crystals in BTL according to TDR design, valid also for barphiflat scenario:
41  // 16 crystals x 24 modules x 2 readout units/type x 3 types x 36 rods/side x 2 sides
42  //
43  static constexpr uint32_t kCrystalsBTL =
45 
46  enum class CrysLayout { tile = 1, bar = 2, barzflat = 3, barphiflat = 4, v2 = 5 };
47 
48  // ---------- Constructors, enumerated types ----------
49 
52  id_ |= (MTDType::BTL & kMTDsubdMask) << kMTDsubdOffset;
53  }
54 
56  BTLDetId(const uint32_t& raw_id) : MTDDetId(raw_id) { ; }
57 
59  BTLDetId(const DetId& det_id) : MTDDetId(det_id.rawId()) { ; }
60 
62  BTLDetId(uint32_t zside, uint32_t rod, uint32_t module, uint32_t modtyp, uint32_t crystal)
64  id_ |= (MTDType::BTL & kMTDsubdMask) << kMTDsubdOffset | (zside & kZsideMask) << kZsideOffset |
67  }
68 
70  BTLDetId(uint32_t zside, uint32_t rod, uint32_t runit, uint32_t module, uint32_t modtyp, uint32_t crystal)
72  id_ |= (MTDType::BTL & kMTDsubdMask) << kMTDsubdOffset | (zside & kZsideMask) << kZsideOffset |
76  }
77 
78  // ---------- Common methods ----------
79 
81  inline int module() const { return (id_ >> kBTLmoduleOffset) & kBTLmoduleMask; }
82 
84  inline int modType() const { return (id_ >> kBTLmodTypeOffset) & kBTLmodTypeMask; }
85 
87  inline int crystal() const { return ((id_ >> kBTLCrystalOffset) & kBTLCrystalMask) + 1; }
88 
90  inline int runit() const { return (id_ >> kBTLRUOffset) & kBTLRUMask; }
91 
93  inline int row(unsigned nrows = kCrystalsPerModuleV2) const {
94  return (crystal() - 1) % nrows; // anything else for now
95  }
96 
98  inline int column(unsigned nrows = kCrystalsPerModuleV2) const { return (crystal() - 1) / nrows; }
99 
102 };
103 
104 std::ostream& operator<<(std::ostream&, const BTLDetId&);
105 
106 #endif // DataFormats_BTLDetId_BTLDetId_h
static constexpr uint32_t kCrystalsBTL
Definition: BTLDetId.h:43
static constexpr uint32_t kModulePerTypeBarPhiFlat
Definition: BTLDetId.h:33
static const uint32_t kRodRingOffset
Definition: MTDDetId.h:33
int row(unsigned nrows=kCrystalsPerModuleV2) const
Definition: BTLDetId.h:93
CrysLayout
Definition: BTLDetId.h:46
static constexpr uint32_t kCrystalTypes
Definition: BTLDetId.h:38
static constexpr uint32_t kBTLmodTypeOffset
Definition: BTLDetId.h:23
static constexpr uint32_t kBTLmodTypeMask
Definition: BTLDetId.h:24
int modType() const
Definition: BTLDetId.h:84
ForwardSubdetector
static const uint32_t kZsideOffset
Definition: MTDDetId.h:31
static const uint32_t kMTDsubdOffset
Definition: MTDDetId.h:29
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
BTLDetId()
Definition: BTLDetId.h:51
static constexpr uint32_t kBTLRUOffset
Definition: BTLDetId.h:25
static const uint32_t kRodRingMask
Definition: MTDDetId.h:34
static constexpr uint32_t HALF_ROD
range constants, need two sets for the time being (one for tiles and one for bars) ...
Definition: BTLDetId.h:31
static constexpr uint32_t kModulesPerRODBarPhiFlat
Definition: BTLDetId.h:32
static constexpr uint32_t kBTLRUMask
Definition: BTLDetId.h:26
static constexpr uint32_t kModulesPerTrkV2
Definition: BTLDetId.h:37
static constexpr uint32_t kBTLmoduleOffset
Definition: BTLDetId.h:21
static const uint32_t kMTDsubdMask
Definition: MTDDetId.h:30
static const uint32_t kZsideMask
Definition: MTDDetId.h:32
int module() const
Definition: BTLDetId.h:81
int column(unsigned nrows=kCrystalsPerModuleV2) const
Definition: BTLDetId.h:98
BTLDetId(const DetId &det_id)
Definition: BTLDetId.h:59
BTLDetId(uint32_t zside, uint32_t rod, uint32_t module, uint32_t modtyp, uint32_t crystal)
Definition: BTLDetId.h:62
static constexpr uint32_t kModulesPerRUV2
Definition: BTLDetId.h:35
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
uint32_t id_
Definition: DetId.h:69
int runit() const
Definition: BTLDetId.h:90
int zside() const
Definition: MTDDetId.h:61
BTLDetId(uint32_t zside, uint32_t rod, uint32_t runit, uint32_t module, uint32_t modtyp, uint32_t crystal)
Definition: BTLDetId.h:70
static constexpr uint32_t kRUPerTypeV2
Definition: BTLDetId.h:34
std::ostream & operator<<(std::ostream &, const BTLDetId &)
Definition: BTLDetId.cc:19
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
Definition: BTLDetId.h:19
BTLDetId(const uint32_t &raw_id)
Definition: BTLDetId.h:56
static constexpr uint32_t kCrystalsPerModuleV2
Definition: BTLDetId.h:36
static constexpr uint32_t kBTLCrystalOffset
Definition: BTLDetId.h:27
BTLDetId geographicalId(CrysLayout lay) const
Definition: BTLDetId.cc:3
static constexpr uint32_t kBTLmoduleMask
Definition: BTLDetId.h:22
int crystal() const
Definition: BTLDetId.h:87
static constexpr uint32_t kBTLCrystalMask
Definition: BTLDetId.h:28