ATLAS Offline Software
Functions | Variables
ITkPixEncoding Namespace Reference

Functions

constexpr std::size_t LookUpTableSize (1<< 16)
 
template<std::size_t Length, typename Generator >
constexpr auto lut (Generator &&f)
 
constexpr uint32_t one_bit (uint32_t v)
 
constexpr void prepByte (uint32_t word, uint32_t b[8])
 
std::array< uint32_t, 8 > prepByte (uint32_t word)
 
constexpr uint32_t encode (uint32_t decoded, uint32_t &encoded)
 
auto create_lut_encode (bool length=false)
 

Variables

template<std::size_t Length>
constexpr auto LutLen
 
template<std::size_t Length>
constexpr auto LutBTree
 
constexpr std::array< uint32_t, LookUpTableSizeITkPixV2QCoreEncodingLUT_Tree = LutBTree<LookUpTableSize>
 
constexpr std::array< uint32_t, LookUpTableSizeITkPixV2QCoreEncodingLUT_Length = LutLen<LookUpTableSize>
 

Function Documentation

◆ create_lut_encode()

auto ITkPixEncoding::create_lut_encode ( bool  length = false)
inline

Definition at line 88 of file ITkPixQCoreEncodingLUT.h.

88  {
89  std::array<uint32_t, LookUpTableSize> lut;
90  lut[0] = 0;
91  for (uint32_t i = 1; i < 1 << 16; i++) {
92  uint32_t encoded;
93  uint64_t len = encode(i, encoded);
94  lut[i] = length ? len : encoded;
95  }
96  return lut;
97  }

◆ encode()

constexpr uint32_t ITkPixEncoding::encode ( uint32_t  decoded,
uint32_t &  encoded 
)
constexpr

Definition at line 54 of file ITkPixQCoreEncodingLUT.h.

54  {
55  uint32_t b[8];
56  prepByte(decoded, b);
57  //
58  uint32_t S1 = (one_bit(b[0] | b[1] | b[2] | b[3]) << 1) | one_bit(b[4] | b[5] | b[6] | b[7]);
59  uint32_t S2t = (one_bit(b[0] | b[1]) << 1) | one_bit(b[2] | b[3]);
60  uint32_t S2b = (one_bit(b[4] | b[5]) << 1) | one_bit(b[6] | b[7]);
61  uint32_t S3tl = (one_bit(b[0]) << 1) | one_bit(b[1]);
62  uint32_t S3tr = (one_bit(b[2]) << 1) | one_bit(b[3]);
63  uint32_t S3bl = (one_bit(b[4]) << 1) | one_bit(b[5]);
64  uint32_t S3br = (one_bit(b[6]) << 1) | one_bit(b[7]);
65 
66  uint32_t pos = 0;
67  encoded = 0;
68 
69  auto writeTwo = [&](uint32_t src) {
70  if (src == 0b01) {
71  encoded |= (0b0) << (28 - pos);
72  pos++;
73  } else {
74  encoded |= (src & 0x3) << (28 - pos);
75  pos += 2;
76  }
77  };
78  for(auto & val:{
79  S1, S2t, S3tl, S3tr, b[0], b[1],b[2], b[3],
80  S2b, S3bl, S3br,b[4], b[5], b[6], b[7]
81  }) if(val) writeTwo(val);
82  return pos;
83  }

◆ LookUpTableSize()

constexpr std::size_t ITkPixEncoding::LookUpTableSize ( 1<<  16)
constexpr

◆ lut()

template<std::size_t Length, typename Generator >
constexpr auto ITkPixEncoding::lut ( Generator &&  f)
constexpr

Definition at line 19 of file ITkPixQCoreEncodingLUT.h.

19  {
20  using content_type = decltype(f(std::size_t{0}));
21  std::array<content_type, Length> arr;
22  using namespace std::ranges;
23  auto rangy = views::iota(std::size_t{0}, Length) // Generate a sequence
24  | views::transform(std::forward<Generator>(f)); // Transform using our generator
25  copy(rangy, arr.begin());
26  return arr;
27  }

◆ one_bit()

constexpr uint32_t ITkPixEncoding::one_bit ( uint32_t  v)
constexpr

Definition at line 30 of file ITkPixQCoreEncodingLUT.h.

30  {
31  return v!=0;
32  }

◆ prepByte() [1/2]

std::array<uint32_t, 8> ITkPixEncoding::prepByte ( uint32_t  word)

Definition at line 44 of file ITkPixQCoreEncodingLUT.h.

45  {
46  std::array<uint32_t, 8> b;
47  prepByte(word, b.data());
48  return b;
49  }

◆ prepByte() [2/2]

constexpr void ITkPixEncoding::prepByte ( uint32_t  word,
uint32_t  b[8] 
)
constexpr

Definition at line 38 of file ITkPixQCoreEncodingLUT.h.

38  {
39  for(int i = 0 ;i<8;i++) {
40  b[i] = ((word >> (2*i)) & 0x1) << 1 | ((word >> (2*i+1)) & 0x1);
41  }
42  }

Variable Documentation

◆ ITkPixV2QCoreEncodingLUT_Length

constexpr std::array<uint32_t, LookUpTableSize > ITkPixEncoding::ITkPixV2QCoreEncodingLUT_Length = LutLen<LookUpTableSize>
constexpr

Definition at line 116 of file ITkPixQCoreEncodingLUT.h.

◆ ITkPixV2QCoreEncodingLUT_Tree

constexpr std::array<uint32_t, LookUpTableSize > ITkPixEncoding::ITkPixV2QCoreEncodingLUT_Tree = LutBTree<LookUpTableSize>
constexpr

Definition at line 115 of file ITkPixQCoreEncodingLUT.h.

◆ LutBTree

template<std::size_t Length>
constexpr auto ITkPixEncoding::LutBTree
constexpr
Initial value:
= lut<Length>([](uint32_t i){
uint32_t encoded;
encode(i, encoded);
return encoded;
})

Definition at line 108 of file ITkPixQCoreEncodingLUT.h.

◆ LutLen

template<std::size_t Length>
constexpr auto ITkPixEncoding::LutLen
constexpr
Initial value:
= lut<Length>([](uint32_t i){
uint32_t encoded;
return encode(i, encoded);
})

Definition at line 102 of file ITkPixQCoreEncodingLUT.h.

plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
trigbs_pickEvents.ranges
ranges
Definition: trigbs_pickEvents.py:60
S1
struct TBPatternUnitContext S1
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
ITkPixEncoding::encode
constexpr uint32_t encode(uint32_t decoded, uint32_t &encoded)
Definition: ITkPixQCoreEncodingLUT.h:54
ITkPixEncoding::lut
constexpr auto lut(Generator &&f)
Definition: ITkPixQCoreEncodingLUT.h:19
lumiFormat.i
int i
Definition: lumiFormat.py:85
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
hist_file_dump.f
f
Definition: hist_file_dump.py:135
ITkPixEncoding::one_bit
constexpr uint32_t one_bit(uint32_t v)
Definition: ITkPixQCoreEncodingLUT.h:30
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.PyAthena.v
v
Definition: PyAthena.py:154
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
ITkPixEncoding::prepByte
std::array< uint32_t, 8 > prepByte(uint32_t word)
Definition: ITkPixQCoreEncodingLUT.h:44
calibdata.copy
bool copy
Definition: calibdata.py:27
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26