ATLAS Offline Software
Loading...
Searching...
No Matches
QuadLinear.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4/***************************************************************************
5 QuadLinear.cxx - description
6 -------------------
7 begin : 31-05-2006
8 email : Alan.Watson@cern.ch
9 ***************************************************************************/
10
12
13namespace LVL1 {
14
15
16unsigned int LVL1::QuadLinear::Compress(int Et) {
17
18 // Compressed codes are unsigned. Calling function should keep track of sign
19 unsigned int code = abs(Et);
20 unsigned int quadEt = m_mask + ((m_nRanges-1)<<m_Offset);
21
22 for (int i = 0; i < m_nRanges; i++) {
23 if ( code <= m_mask ) {
24 quadEt = code + (i<<m_Offset);
25 break;
26 }
27 code >>= m_nShift;
28 }
29 return quadEt;
30}
31
32unsigned int LVL1::QuadLinear::Expand(int Code) {
33
34 // Compressed codes are unsigned. Calling function should keep track of sign
35 int range = Code >> m_Offset;
36 int Et = Code&m_mask;
37
38 return (Et<<= (range*m_nShift));
39}
40
41} // end of namespace bracket
static unsigned int Expand(int Code)
Uncompress data.
static const int m_nShift
Number of bits to shift by in each step.
Definition QuadLinear.h:38
static const unsigned int m_mask
Mask to select 6-bit field.
Definition QuadLinear.h:34
static unsigned int Compress(int Et)
Compress data.
static const int m_Offset
Offset for compression code.
Definition QuadLinear.h:40
static const int m_nRanges
Number of ET ranges to encode in.
Definition QuadLinear.h:36
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...