ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TpcDefs.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TpcDefs.cc
1 
7 #include "TpcDefs.h"
8 
9 #include <trackbase/TrkrDefs.h> // for hitsetkey, cluskey, hitkey, kBitShif...
10 
11 uint8_t
13 {
14  TrkrDefs::hitsetkey tmp = (key >> TpcDefs::kBitShiftSectorId);
15  return tmp;
16 }
17 
18 uint8_t
20 {
21  TrkrDefs::hitsetkey tmp = (key >> TrkrDefs::kBitShiftClusId);
22  return getSectorId(tmp);
23 }
24 
25 uint8_t
27 {
28  TrkrDefs::hitsetkey tmp = (key >> TpcDefs::kBitShiftSide);
29  return tmp;
30 }
31 
32 uint8_t
34 {
35  TrkrDefs::hitsetkey tmp = (key >> TrkrDefs::kBitShiftClusId);
36  return getSide(tmp);
37 }
38 
39 uint16_t
41 {
42  TrkrDefs::hitkey tmp = (key >> TpcDefs::kBitShiftPad);
43  return tmp;
44 }
45 
46 uint16_t
48 {
49  TrkrDefs::hitkey tmp = (key >> TpcDefs::kBitShiftTBin);
50  return tmp;
51 }
52 
54 TpcDefs::genHitKey(const uint16_t pad, const uint16_t tbin)
55 {
56  TrkrDefs::hitkey key = (pad << TpcDefs::kBitShiftPad);
57  TrkrDefs::hitkey tmp = (tbin << TpcDefs::kBitShiftTBin);
58  key |= tmp;
59  return key;
60 }
61 
63 TpcDefs::genHitSetKey(const uint8_t lyr, const uint8_t sector, const uint8_t side)
64 {
66  TrkrDefs::hitsetkey tmp = sector;
67  key |= (tmp << TpcDefs::kBitShiftSectorId);
68  tmp = side;
69  key |= (tmp << TpcDefs::kBitShiftSide);
70  return key;
71 }
72 
74 TpcDefs::genClusKey(const uint8_t lyr, const uint8_t sector, const uint8_t side, const uint32_t clusid)
75 {
76  TrkrDefs::cluskey tmp = genHitSetKey(lyr, sector, side);
77  TrkrDefs::cluskey key = (tmp << TrkrDefs::kBitShiftClusId);
78  key |= clusid;
79  return key;
80 }
81 
83 TpcDefs::genClusKey(const TrkrDefs::hitsetkey hskey, const uint32_t clusid)
84 {
85  TrkrDefs::cluskey tmp = hskey;
86  TrkrDefs::cluskey key = (tmp << TrkrDefs::kBitShiftClusId);
87  key |= clusid;
88  return key;
89 }