ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MvtxDefs.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MvtxDefs.cc
1 #include "MvtxDefs.h"
2 
3 #include <trackbase/TrkrDefs.h>
4 
5 uint8_t
7 {
8  TrkrDefs::hitsetkey tmp = (key >> MvtxDefs::kBitShiftStaveId);
9  return tmp;
10 }
11 
12 uint8_t
14 {
15  TrkrDefs::hitsetkey tmp = (key >> TrkrDefs::kBitShiftClusId);
16  return getStaveId(tmp);
17 }
18 
19 uint8_t
21 {
22  TrkrDefs::hitsetkey tmp = (key >> MvtxDefs::kBitShiftChipId);
23  return tmp;
24 }
25 
26 uint8_t
28 {
29  TrkrDefs::hitsetkey tmp = (key >> TrkrDefs::kBitShiftClusId);
30  return getChipId(tmp);
31 }
32 
33 uint16_t
35 {
36  TrkrDefs::hitkey tmp = (key >> MvtxDefs::kBitShiftCol);
37  return tmp;
38 }
39 
40 uint16_t
42 {
43  TrkrDefs::hitkey tmp = (key >> MvtxDefs::kBitShiftRow);
44  return tmp;
45 }
46 
48 MvtxDefs::genHitKey(const uint16_t col, const uint16_t row)
49 {
50  TrkrDefs::hitkey key = (col << MvtxDefs::kBitShiftCol);
51  TrkrDefs::hitkey tmp = (row << MvtxDefs::kBitShiftRow);
52  key |= tmp;
53  return key;
54 }
55 
57 MvtxDefs::genHitSetKey(const uint8_t lyr, const uint8_t stave, const uint8_t chip)
58 {
60  TrkrDefs::hitsetkey tmp = stave;
61  key |= (tmp << MvtxDefs::kBitShiftStaveId);
62  tmp = chip;
63  key |= (tmp << MvtxDefs::kBitShiftChipId);
64  return key;
65 }
66 
68 MvtxDefs::genClusKey(const uint8_t lyr, const uint8_t stave, const uint8_t chip, const uint32_t clusid)
69 {
70  TrkrDefs::cluskey tmp = genHitSetKey(lyr, stave, chip);
71  TrkrDefs::cluskey key = (tmp << TrkrDefs::kBitShiftClusId);
72  key |= clusid;
73  return key;
74 }
75 
77 MvtxDefs::genClusKey(const TrkrDefs::hitsetkey hskey, const uint32_t clusid)
78 {
79  TrkrDefs::cluskey tmp = hskey;
80  TrkrDefs::cluskey key = (tmp << TrkrDefs::kBitShiftClusId);
81  key |= clusid;
82  return key;
83 }