ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloUtils
src
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
11
#include "
TrigT1CaloUtils/QuadLinear.h
"
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
QuadLinear.h
LVL1::QuadLinear::Expand
static unsigned int Expand(int Code)
Uncompress data.
Definition
QuadLinear.cxx:32
LVL1::QuadLinear::m_nShift
static const int m_nShift
Number of bits to shift by in each step.
Definition
QuadLinear.h:38
LVL1::QuadLinear::m_mask
static const unsigned int m_mask
Mask to select 6-bit field.
Definition
QuadLinear.h:34
LVL1::QuadLinear::Compress
static unsigned int Compress(int Et)
Compress data.
Definition
QuadLinear.cxx:16
LVL1::QuadLinear::m_Offset
static const int m_Offset
Offset for compression code.
Definition
QuadLinear.h:40
LVL1::QuadLinear::m_nRanges
static const int m_nRanges
Number of ET ranges to encode in.
Definition
QuadLinear.h:36
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition
IZdcDataAccess.h:13
Generated on
for ATLAS Offline Software by
1.17.0