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

Class capable spliting word into parts, used to fill raw containers. More...

#include <AFP_WordReadOut.h>

Inheritance diagram for AFP_WordReadOut:
Collaboration diagram for AFP_WordReadOut:

Public Member Functions

 AFP_WordReadOut (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~AFP_WordReadOut () override
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
bool isHeader (uint32_t the_word) const override
 Returns true if the word is marked as header word. More...
 
bool isData (uint32_t the_word) const override
 Returns true if the word is marked as data word. More...
 
bool isService (uint32_t the_word) const override
 Returns true if the word is marked as service word. More...
 
uint32_t link (uint32_t the_word) const override
 Value of 5-8 most significant bits. More...
 
uint32_t getBits (uint32_t the_word, const uint16_t start, const uint16_t stop) const override
 Returns integer value of the selcted bits. More...
 

Static Public Attributes

static constexpr uint16_t s_wordHeader = 3
 Header word is marked with four most significant bits set to 0011. More...
 
static constexpr uint16_t s_wordData = 3
 Data word is marked with two most significant bits set to 11. More...
 
static constexpr uint16_t s_wordService = 0
 Service word is marked with four most significant bits set to 0000. More...
 

Private Attributes

ToolHandle< AFP_LinkNumTranslatorm_linkNumTrans {this, "AFP_LinkNumTranslator", "AFP_LinkNumTranslator", "Tool that translates link numbers"}
 

Detailed Description

Class capable spliting word into parts, used to fill raw containers.

Definition at line 16 of file AFP_WordReadOut.h.

Constructor & Destructor Documentation

◆ AFP_WordReadOut()

AFP_WordReadOut::AFP_WordReadOut ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 7 of file AFP_WordReadOut.cxx.

7  :
8  base_class(type, name, parent)
9 {
10 }

◆ ~AFP_WordReadOut()

AFP_WordReadOut::~AFP_WordReadOut ( )
overridevirtual

Definition at line 12 of file AFP_WordReadOut.cxx.

13 {
14 }

Member Function Documentation

◆ finalize()

StatusCode AFP_WordReadOut::finalize ( )
overridevirtual

Definition at line 27 of file AFP_WordReadOut.cxx.

28 {
29  return StatusCode::SUCCESS;
30 }

◆ getBits()

uint32_t AFP_WordReadOut::getBits ( uint32_t  the_word,
const uint16_t  start,
const uint16_t  stop 
) const
override

Returns integer value of the selcted bits.

Bits are numbered starting from 0 for the least significant bit and raising as bits significance rises.

Parameters
startthe most significant bit from which decoding should begin (the start bit will be included)
stopthe least significant bit where decoding should end (the stop bit will be included)

For example for word 0011 1010 the function will give following results:

  • getBits (7, 4) = 3
  • getBits (3, 0) = 10
  • getBits (4, 4) = 1
  • getBits (2, 2) = 0
  • getBits (5, 3) = 7

Definition at line 32 of file AFP_WordReadOut.cxx.

33 {
34  uint32_t word = 0;
35  for (uint16_t i = stop; i < start; i++) {
36  word = ((word | 1) << 1);
37  }
38  uint32_t result = (the_word >> stop) & (word | 1);
39  return result;
40 }

◆ initialize()

StatusCode AFP_WordReadOut::initialize ( )
overridevirtual

Definition at line 16 of file AFP_WordReadOut.cxx.

17 {
18  if (m_linkNumTrans.retrieve().isFailure()) {
19  ATH_MSG_WARNING("Failed to retrieve service " << m_linkNumTrans );
20  return StatusCode::SUCCESS;
21  } else {
22  ATH_MSG_DEBUG("Retrieved service " << m_linkNumTrans );
23  }
24  return StatusCode::SUCCESS;
25 }

◆ isData()

bool AFP_WordReadOut::isData ( uint32_t  the_word) const
inlineoverride

Returns true if the word is marked as data word.

The word is marked as data word if two most significant bits are equal s_wordData.

Definition at line 34 of file AFP_WordReadOut.h.

34 {return s_wordData == getBits(the_word, 31, 30);}

◆ isHeader()

bool AFP_WordReadOut::isHeader ( uint32_t  the_word) const
inlineoverride

Returns true if the word is marked as header word.

The word is marked as header if four most significant bits are equal s_wordHeader.

Definition at line 28 of file AFP_WordReadOut.h.

28 {return s_wordHeader == getBits(the_word, 31, 28);}

◆ isService()

bool AFP_WordReadOut::isService ( uint32_t  the_word) const
inlineoverride

Returns true if the word is marked as service word.

The word is marked as service word if four most significant bits are equal s_wordService.

Definition at line 40 of file AFP_WordReadOut.h.

40 {return s_wordService == getBits(the_word, 31, 28);}

◆ link()

uint32_t AFP_WordReadOut::link ( uint32_t  the_word) const
inlineoverride

Value of 5-8 most significant bits.

In the following word: xxxx LLLL xxxx xxxx xxxx xxxx xxxx xxxx it means bits marked with L.

Definition at line 46 of file AFP_WordReadOut.h.

46 {return m_linkNumTrans->translate(getBits (the_word, 27, 24));}

Member Data Documentation

◆ m_linkNumTrans

ToolHandle<AFP_LinkNumTranslator> AFP_WordReadOut::m_linkNumTrans {this, "AFP_LinkNumTranslator", "AFP_LinkNumTranslator", "Tool that translates link numbers"}
private

Definition at line 77 of file AFP_WordReadOut.h.

◆ s_wordData

constexpr uint16_t AFP_WordReadOut::s_wordData = 3
staticconstexpr

Data word is marked with two most significant bits set to 11.

Definition at line 71 of file AFP_WordReadOut.h.

◆ s_wordHeader

constexpr uint16_t AFP_WordReadOut::s_wordHeader = 3
staticconstexpr

Header word is marked with four most significant bits set to 0011.

Definition at line 68 of file AFP_WordReadOut.h.

◆ s_wordService

constexpr uint16_t AFP_WordReadOut::s_wordService = 0
staticconstexpr

Service word is marked with four most significant bits set to 0000.

Definition at line 74 of file AFP_WordReadOut.h.


The documentation for this class was generated from the following files:
get_generator_info.result
result
Definition: get_generator_info.py:21
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
AFP_WordReadOut::m_linkNumTrans
ToolHandle< AFP_LinkNumTranslator > m_linkNumTrans
Definition: AFP_WordReadOut.h:77
AFP_WordReadOut::s_wordData
static constexpr uint16_t s_wordData
Data word is marked with two most significant bits set to 11.
Definition: AFP_WordReadOut.h:71
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AFP_WordReadOut::getBits
uint32_t getBits(uint32_t the_word, const uint16_t start, const uint16_t stop) const override
Returns integer value of the selcted bits.
Definition: AFP_WordReadOut.cxx:32
AFP_WordReadOut::s_wordHeader
static constexpr uint16_t s_wordHeader
Header word is marked with four most significant bits set to 0011.
Definition: AFP_WordReadOut.h:68
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AFP_WordReadOut::s_wordService
static constexpr uint16_t s_wordService
Service word is marked with four most significant bits set to 0000.
Definition: AFP_WordReadOut.h:74
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78