Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InttDefs.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file InttDefs.h
1 
7 #ifndef INTT_INTTDEFS_H
8 #define INTT_INTTDEFS_H
9 
10 #include "TrkrDefs.h"
11 
12 #include <cstdint> // for uint8_t, uint16_t, uint32_t
13 
20 namespace InttDefs
21 {
22 // hitsetkey layout:
23 // Intt specific lower 16 bits
24 // 24 - 31 tracker id // 8 bits
25 // 16 - 23 layer // 8 bits
26 // 14 - 15 ladder z id // 2 bits
27 // 10 - 13 ladder phi id // 4 bits
28 // 0 - 9 time bucket // 10 bits
29 
30 static const unsigned int kBitShiftTimeBucketIdOffset __attribute__((unused)) = 0;
31 static const unsigned int kBitShiftTimeBucketIdWidth __attribute__((unused)) = 10;
32 static const unsigned int kBitShiftLadderPhiIdOffset __attribute__((unused)) = 10;
33 static const unsigned int kBitShiftLadderPhiIdWidth __attribute__((unused)) = 4;
34 static const unsigned int kBitShiftLadderZIdOffset __attribute__((unused)) = 14;
35 static const unsigned int kBitShiftLadderZIdWidth __attribute__((unused)) = 2;
36  static const int crossingOffset __attribute__((unused)) = 512;
37 
38 // bit shift for hitkey
39 static const unsigned int kBitShiftCol __attribute__((unused)) = 16;
40 static const unsigned int kBitShiftRow __attribute__((unused)) = 0;
41 
48 
54 uint8_t getLadderZId(TrkrDefs::cluskey key);
55 
62 
70 
78 
86 
98 uint16_t getCol(TrkrDefs::hitkey key);
99 
105 uint16_t getRow(TrkrDefs::hitkey key);
106 
107  TrkrDefs::hitkey genHitKey(const uint16_t col, const uint16_t row);
108 
119  TrkrDefs::hitsetkey genHitSetKey(const uint8_t lyr, const uint8_t ladder_z_index, const uint8_t ladder_phi_index, const int time_bucket);
120 
130  TrkrDefs::cluskey genClusKey(const uint8_t lyr, const uint8_t ladder_z_index, const uint8_t ladder_phi_index, const int crossing, const uint32_t clusid);
131 
138 
139 } // namespace InttDefs
140 
141 #endif //INTT_INTTDEFS_H