ATLAS Offline Software
Static Public Member Functions | Static Private Attributes | List of all members
LVL1::jFEXCompression Class Reference

LAr supercell data are received by the jFEX in a 10-bit multi-linear encoded form. More...

#include <jFEXCompression.h>

Collaboration diagram for LVL1::jFEXCompression:

Static Public Member Functions

static unsigned int Compress (float floatEt, bool empty=false)
 Compress data. More...
 
static int Expand (unsigned int code)
 Uncompress data. More...
 
static unsigned int Threshold (unsigned int code, int threshold=-800)
 Apply threshold to compressed data. More...
 
static unsigned int Linearize (unsigned int code, int threshold=0)
 Linearize LAr code to jFEX internal format. More...
 

Static Private Attributes

static const int s_maxET = 800000
 Maximum ET value that can be encoded. More...
 
static const unsigned int s_nRanges = 5
 Number of ranges. More...
 
static const int s_steps [s_nRanges] = {25, 50, 100, 200, 400}
 Step sizes in each range, MeV. More...
 
static const int s_minET [s_nRanges] = {-3150, 6400, 25600, 102400, 409600}
 Minimum ET values in each range, MeV. More...
 
static const int s_minCode [s_nRanges] = {2, 384, 768, 1536, 3072}
 Minimum code value in each range. More...
 
static const int s_NoData = 0
 Indicates no data present. More...
 
static const unsigned int s_LArUnderflow = 1
 LAr underflow code. More...
 
static const unsigned int s_LArOverflow = 4048
 LAr overflow code. More...
 
static const unsigned int s_LArMaxCode = 4095
 Maximum code value, values 4049 to 4094 reserved. More...
 
static const unsigned int s_LArInvalid = 4095
 Invalid code value. More...
 
static const unsigned int s_jFEXstep = 25
 L1Calo ET digit step. More...
 
static const unsigned int s_jFEXOverflow = 0xffff
 L1Calo saturated/overflow. More...
 
static const int s_error = -99999
 Error return value. More...
 

Detailed Description

LAr supercell data are received by the jFEX in a 10-bit multi-linear encoded form.

This simple utility class contains 3 functions:

Definition at line 35 of file jFEXCompression.h.

Member Function Documentation

◆ Compress()

unsigned int LVL1::jFEXCompression::Compress ( float  floatEt,
bool  empty = false 
)
static

Compress data.

Definition at line 25 of file jFEXCompression.cxx.

32  {
33  if (Et < s_minET[i]) break;
34  range = i;
35  }
36 
37  // Calculate code
38  unsigned int code = 0;
39 
40  if (range < 0) {
41  // Below minimum value
43  }
44  else {
45  // Lies inside one of the value ranges
46  int steps = std::round( (Et - s_minET[range])/s_steps[range] );
47  code = static_cast<int>(s_minCode[range] + steps);
48  }
49 
50  return code;
51 }
52 
53 int jFEXCompression::Expand(unsigned int code) {
54 
55  // Deal with special codes first:
56  if (code == s_NoData) return 0;

◆ Expand()

int LVL1::jFEXCompression::Expand ( unsigned int  code)
static

Uncompress data.

Now expand code into an ET value. Start by finding what range the code is in

Now expand the value

Definition at line 58 of file jFEXCompression.cxx.

64  {
65  if (code < (unsigned int)s_minCode[i+1]) break;
66  range++;
67  }
69  int minEt = s_minET[range];
70  int valEt = (code-s_minCode[range])*s_steps[range];
71 
72  int Et = minEt+valEt;
73  return Et;
74 }
75 
76 
77 unsigned int jFEXCompression::Threshold(unsigned int code, int threshold) {
78 

◆ Linearize()

unsigned int LVL1::jFEXCompression::Linearize ( unsigned int  code,
int  threshold = 0 
)
static

Linearize LAr code to jFEX internal format.

Apply the threshold. Since jFEX ET is positive, minimum threshold is 0.

Expand the ET value

Convert to jFEX digit scale

Definition at line 94 of file jFEXCompression.cxx.

◆ Threshold()

unsigned int LVL1::jFEXCompression::Threshold ( unsigned int  code,
int  threshold = -800 
)
static

Apply threshold to compressed data.

Convert threshold into a compressed code

Zero code if < threshold

Definition at line 82 of file jFEXCompression.cxx.

89  {
90 

Member Data Documentation

◆ s_error

const int LVL1::jFEXCompression::s_error = -99999
staticprivate

Error return value.

Definition at line 78 of file jFEXCompression.h.

◆ s_jFEXOverflow

const unsigned int LVL1::jFEXCompression::s_jFEXOverflow = 0xffff
staticprivate

L1Calo saturated/overflow.

Definition at line 76 of file jFEXCompression.h.

◆ s_jFEXstep

const unsigned int LVL1::jFEXCompression::s_jFEXstep = 25
staticprivate

L1Calo ET digit step.

Definition at line 74 of file jFEXCompression.h.

◆ s_LArInvalid

const unsigned int LVL1::jFEXCompression::s_LArInvalid = 4095
staticprivate

Invalid code value.

Definition at line 72 of file jFEXCompression.h.

◆ s_LArMaxCode

const unsigned int LVL1::jFEXCompression::s_LArMaxCode = 4095
staticprivate

Maximum code value, values 4049 to 4094 reserved.

Definition at line 70 of file jFEXCompression.h.

◆ s_LArOverflow

const unsigned int LVL1::jFEXCompression::s_LArOverflow = 4048
staticprivate

LAr overflow code.

Definition at line 68 of file jFEXCompression.h.

◆ s_LArUnderflow

const unsigned int LVL1::jFEXCompression::s_LArUnderflow = 1
staticprivate

LAr underflow code.

Definition at line 66 of file jFEXCompression.h.

◆ s_maxET

const int LVL1::jFEXCompression::s_maxET = 800000
staticprivate

Maximum ET value that can be encoded.

Definition at line 54 of file jFEXCompression.h.

◆ s_minCode

const int LVL1::jFEXCompression::s_minCode = {2, 384, 768, 1536, 3072}
staticprivate

Minimum code value in each range.

Definition at line 62 of file jFEXCompression.h.

◆ s_minET

const int LVL1::jFEXCompression::s_minET = {-3150, 6400, 25600, 102400, 409600}
staticprivate

Minimum ET values in each range, MeV.

Definition at line 60 of file jFEXCompression.h.

◆ s_NoData

const int LVL1::jFEXCompression::s_NoData = 0
staticprivate

Indicates no data present.

Definition at line 64 of file jFEXCompression.h.

◆ s_nRanges

const unsigned int LVL1::jFEXCompression::s_nRanges = 5
staticprivate

Number of ranges.

Definition at line 56 of file jFEXCompression.h.

◆ s_steps

const int LVL1::jFEXCompression::s_steps = {25, 50, 100, 200, 400}
staticprivate

Step sizes in each range, MeV.

Definition at line 58 of file jFEXCompression.h.


The documentation for this class was generated from the following files:
LVL1::jFEXCompression::s_LArUnderflow
static const unsigned int s_LArUnderflow
LAr underflow code.
Definition: jFEXCompression.h:66
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
LVL1::jFEXCompression::s_NoData
static const int s_NoData
Indicates no data present.
Definition: jFEXCompression.h:64
LVL1::jFEXCompression::Expand
static int Expand(unsigned int code)
Uncompress data.
Definition: jFEXCompression.cxx:58
beamspotman.steps
int steps
Definition: beamspotman.py:505
lumiFormat.i
int i
Definition: lumiFormat.py:92
LVL1::jFEXCompression::s_minET
static const int s_minET[s_nRanges]
Minimum ET values in each range, MeV.
Definition: jFEXCompression.h:60
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
LVL1::jFEXCompression::Threshold
static unsigned int Threshold(unsigned int code, int threshold=-800)
Apply threshold to compressed data.
Definition: jFEXCompression.cxx:82
LVL1::jFEXCompression::s_minCode
static const int s_minCode[s_nRanges]
Minimum code value in each range.
Definition: jFEXCompression.h:62
pmontree.code
code
Definition: pmontree.py:443
threshold
Definition: chainparser.cxx:74
LVL1::jFEXCompression::s_steps
static const int s_steps[s_nRanges]
Step sizes in each range, MeV.
Definition: jFEXCompression.h:58