ATLAS Offline Software
Public Types | Static Public Member Functions | Static Private Attributes | List of all members
MdtHistCoder Class Reference

#include <MdtHistCoder.h>

Collaboration diagram for MdtHistCoder:

Public Types

enum  {
  region = 0, layer = 1, crate_region = 2, crate = 3,
  phi = 4
}
 

Static Public Member Functions

static uint16_t encode (const uint16_t regionIn, const uint16_t layerIn, const uint16_t phiIn, const uint16_t crate_regionIn, const uint16_t crateIn)
 
static uint16_t decode (const uint16_t value, const uint16_t field)
 

Static Private Attributes

static constexpr std::array< uint16_t, 5 > m_bitshift {{0, 2, 4, 6, 8}}
 
static constexpr std::array< uint16_t, 5 > m_bitmask {{0x3, 0x3, 0x3, 0x3, 0xF}}
 

Detailed Description

Definition at line 5 of file MdtHistCoder.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
region 
layer 
crate_region 
crate 
phi 

Definition at line 7 of file MdtHistCoder.h.

7 { region = 0, layer = 1, crate_region = 2, crate = 3, phi = 4 }; // bitshifts

Member Function Documentation

◆ decode()

static uint16_t MdtHistCoder::decode ( const uint16_t  value,
const uint16_t  field 
)
inlinestatic

Definition at line 29 of file MdtHistCoder.h.

29 { return (value >> m_bitshift[field]) & m_bitmask[field]; }

◆ encode()

static uint16_t MdtHistCoder::encode ( const uint16_t  regionIn,
const uint16_t  layerIn,
const uint16_t  phiIn,
const uint16_t  crate_regionIn,
const uint16_t  crateIn 
)
inlinestatic

Definition at line 19 of file MdtHistCoder.h.

20  {
21  uint16_t result = (regionIn & m_bitmask[region]) << m_bitshift[region] | (layerIn & m_bitmask[layer]) << m_bitshift[layer] |
22  (phiIn & m_bitmask[phi]) << m_bitshift[phi] |
23  (crate_regionIn & m_bitmask[crate_region]) << m_bitshift[crate_region] |
24  (crateIn & m_bitmask[crate]) << m_bitshift[crate];
25 
26  return result;
27  }

Member Data Documentation

◆ m_bitmask

constexpr std::array<uint16_t, 5> MdtHistCoder::m_bitmask {{0x3, 0x3, 0x3, 0x3, 0xF}}
staticconstexprprivate

Definition at line 11 of file MdtHistCoder.h.

◆ m_bitshift

constexpr std::array<uint16_t, 5> MdtHistCoder::m_bitshift {{0, 2, 4, 6, 8}}
staticconstexprprivate

Definition at line 10 of file MdtHistCoder.h.


The documentation for this class was generated from the following file:
get_generator_info.result
result
Definition: get_generator_info.py:21
athena.value
value
Definition: athena.py:124
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
MdtHistCoder::m_bitshift
static constexpr std::array< uint16_t, 5 > m_bitshift
Definition: MdtHistCoder.h:10
MdtHistCoder::region
@ region
Definition: MdtHistCoder.h:7
MdtHistCoder::crate_region
@ crate_region
Definition: MdtHistCoder.h:7
MdtHistCoder::m_bitmask
static constexpr std::array< uint16_t, 5 > m_bitmask
Definition: MdtHistCoder.h:11
MdtHistCoder::layer
@ layer
Definition: MdtHistCoder.h:7
MdtHistCoder::phi
@ phi
Definition: MdtHistCoder.h:7
MdtHistCoder::crate
@ crate
Definition: MdtHistCoder.h:7