EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
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
12
TpcDefs::getSectorId
(
TrkrDefs::hitsetkey
key)
13
{
14
TrkrDefs::hitsetkey
tmp = (key >> TpcDefs::kBitShiftSectorId);
15
return
tmp;
16
}
17
18
uint8_t
19
TpcDefs::getSectorId
(
TrkrDefs::cluskey
key)
20
{
21
TrkrDefs::hitsetkey
tmp = (key >> TrkrDefs::kBitShiftClusId);
22
return
getSectorId
(tmp);
23
}
24
25
uint8_t
26
TpcDefs::getSide
(
TrkrDefs::hitsetkey
key)
27
{
28
TrkrDefs::hitsetkey
tmp = (key >> TpcDefs::kBitShiftSide);
29
return
tmp;
30
}
31
32
uint8_t
33
TpcDefs::getSide
(
TrkrDefs::cluskey
key)
34
{
35
TrkrDefs::hitsetkey
tmp = (key >> TrkrDefs::kBitShiftClusId);
36
return
getSide
(tmp);
37
}
38
39
uint16_t
40
TpcDefs::getPad
(
TrkrDefs::hitkey
key)
41
{
42
TrkrDefs::hitkey
tmp = (key >> TpcDefs::kBitShiftPad);
43
return
tmp;
44
}
45
46
uint16_t
47
TpcDefs::getTBin
(
TrkrDefs::hitkey
key)
48
{
49
TrkrDefs::hitkey
tmp = (key >> TpcDefs::kBitShiftTBin);
50
return
tmp;
51
}
52
53
TrkrDefs::hitkey
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
62
TrkrDefs::hitsetkey
63
TpcDefs::genHitSetKey
(
const
uint8_t
lyr,
const
uint8_t
sector,
const
uint8_t
side)
64
{
65
TrkrDefs::hitsetkey
key =
TrkrDefs::genHitSetKey
(
TrkrDefs::TrkrId::tpcId
, lyr);
66
TrkrDefs::hitsetkey
tmp = sector;
67
key |= (tmp << TpcDefs::kBitShiftSectorId);
68
tmp = side;
69
key |= (tmp << TpcDefs::kBitShiftSide);
70
return
key;
71
}
72
73
TrkrDefs::cluskey
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
82
TrkrDefs::cluskey
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
}
fun4all_coresoftware
blob
master
offline
packages
tpc
TpcDefs.cc
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:45
using
1.8.2 with
EIC GitHub integration