Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
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 "
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
const
auto
key =
genHitSetKey
(lyr, sector, side);
77
return
TrkrDefs::genClusKey
( key, clusid );
78
}
coresoftware
blob
master
offline
packages
trackbase
TpcDefs.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:09
using
1.8.2 with
sPHENIX GitHub integration