ATLAS Offline Software
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 
13 namespace LVL1 {
14 
15 
16 unsigned 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 
32 unsigned 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
LVL1::QuadLinear::Expand
static unsigned int Expand(int Code)
Uncompress data.
Definition: QuadLinear.cxx:37
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
histSizes.code
code
Definition: histSizes.py:129
lumiFormat.i
int i
Definition: lumiFormat.py:85
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
LVL1::QuadLinear::Compress
static unsigned int Compress(int Et)
Compress data.
Definition: QuadLinear.cxx:21
QuadLinear.h