EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrkrDefs.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrkrDefs.h
1 
7 #ifndef TRACKBASE_TRKRDEFUTIL_H
8 #define TRACKBASE_TRKRDEFUTIL_H
9 
10 #include <cstdint>
11 #include <iostream>
12 
16 namespace TrkrDefs
17 {
18  static double EdepScaleFactor __attribute__((unused)) = 0.25;
19  static double MvtxEnergyScaleup __attribute__((unused)) = 5.0e8;
20  static double InttEnergyScaleup __attribute__((unused)) = 5.0e7;
21 
23  typedef uint32_t hitkey; // 32 bit TrkrHit key type
24  typedef uint32_t hitsetkey; // 32 bit TrkrHitSet key type
25  typedef uint64_t cluskey; // 64 but TrkrCluster id type
26  typedef uint32_t clushitkey; // 32 bit hit id type in TrkrCluster
27  typedef uint16_t subsurfkey; // 16 bit sub surface key type
28 
30  static hitkey HITKEYMAX __attribute__((unused)) = UINT32_MAX;
31  static hitsetkey HITSETKEYMAX __attribute__((unused)) = UINT32_MAX;
32  static cluskey CLUSKEYMAX __attribute__((unused)) = UINT64_MAX;
33  static clushitkey CLUSHITKEYMAX __attribute__((unused)) = UINT32_MAX;
34  static subsurfkey SUBSURFKEYMAX __attribute__((unused)) = UINT16_MAX;
35 
36  // hitsetkey layout:
37  // common upper 16 bits
38  // 24 - 32 tracker id
39  // 16 - 24 layer
40  static const unsigned int kBitShiftTrkrId __attribute__((unused)) = 24; // 32 - 8
41  static const unsigned int kBitShiftLayer __attribute__((unused)) = 16; // bitshift_trackerid - 8
42 
43  // cluskey layour
44  // hitsetkey upper 32 bits
45  // cluster id lower 32 bits
46  static const unsigned int kBitShiftClusId __attribute__((unused)) = 32;
47 
48 
50  enum TrkrId
51  {
52  mvtxId = 0,
53  inttId = 1,
54  tpcId = 2,
56  ttl = 4,
57  };
58 
59 
61  void printBits(const TrkrDefs::hitsetkey key, std::ostream& os = std::cout);
62  void printBits(const TrkrDefs::cluskey key, std::ostream& os = std::cout);
63  // void print_bits(const TrkrDefs::hitkey key, std::ostream& os = std::cout);
64 
68 
72 
75 
78 
81 
87 
91  TrkrDefs::cluskey getClusKeyLo(const TrkrDefs::TrkrId trkrId, const uint8_t lyr);
92  TrkrDefs::cluskey getClusKeyHi(const TrkrDefs::TrkrId trkrId, const uint8_t lyr);
93 
94  static const unsigned int kBitShiftPhiElement __attribute__((unused)) = 8;//sector
95  static const unsigned int kBitShiftZElement __attribute__((unused)) = 0;//side
96 
101 
102 }
103 
104 #endif //TRACKBASE_TRKRDEFUTIL_H