ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
L1Topo::Fibre Class Reference

Represents the L1Topo fibre word of the L1Topo DAQ header, with decoder and encoder. More...

#include <Fibre.h>

Collaboration diagram for L1Topo::Fibre:

Public Member Functions

 Fibre (std::vector< uint32_t > &&status, std::vector< uint32_t > &&count)
 Construct from contents and encode word: vectors of up to 5 status flags and sizes. They will be inserted left to right in the order the are given. The correct ordering is left to the user. Note that status is encoded as a single bit as specified in the data format, copied from the least significant bit of the given integer. Similarly, the size is truncated to the least significant 4 bits of the given integer.
More...
 
 Fibre (const uint32_t word)
 Construct from word and encode contents. More...
 
const std::vector< uint32_t > & status () const
 access method More...
 
const std::vector< uint32_t > & count () const
 access method More...
 
uint32_t word () const
 access method More...
 

Protected Member Functions

void decode ()
 method used by constructor to decode word More...
 
void encode ()
 method used by constructor to encode word More...
 

Private Attributes

std::vector< uint32_t > m_status
 fibre status More...
 
std::vector< uint32_t > m_count
 fibre counts More...
 
uint32_t m_word
 The raw data representation. More...
 

Detailed Description

Represents the L1Topo fibre word of the L1Topo DAQ header, with decoder and encoder.

Used to decode/encode the 32-bit word whch contains up to 5 x 5-bit fibres, each comprising a 1-bit status flag and 4-bit size/count This word is repeated until the number of fibres in the L1Topo::Header block have been given. If any fibres asserted their status flag, then a separate fibre status word will follow.

Definition at line 22 of file Fibre.h.

Constructor & Destructor Documentation

◆ Fibre() [1/2]

L1Topo::Fibre::Fibre ( std::vector< uint32_t > &&  status,
std::vector< uint32_t > &&  count 
)

Construct from contents and encode word: vectors of up to 5 status flags and sizes. They will be inserted left to right in the order the are given. The correct ordering is left to the user. Note that status is encoded as a single bit as specified in the data format, copied from the least significant bit of the given integer. Similarly, the size is truncated to the least significant 4 bits of the given integer.

Definition at line 13 of file Fibre.cxx.

14  :m_status(std::move(status)), m_count(std::move(count)), m_word(0) {
15  this->encode();
16  }

◆ Fibre() [2/2]

L1Topo::Fibre::Fibre ( const uint32_t  word)

Construct from word and encode contents.

Definition at line 18 of file Fibre.cxx.

19  :m_status(5,0), m_count(5,0), m_word(word) {
20  this->decode();
21  }

Member Function Documentation

◆ count()

const std::vector< uint32_t > & L1Topo::Fibre::count ( ) const

access method

Definition at line 52 of file Fibre.cxx.

52  {
53  return m_count;
54  }

◆ decode()

void L1Topo::Fibre::decode ( )
protected

method used by constructor to decode word

Definition at line 36 of file Fibre.cxx.

36  {
37  for (unsigned int i=0; i<5; ++i){
38  uint32_t fibre = m_word >> (((4-i)*5)+3) & 0x1f;
39  m_status.at(i) = (fibre >> 4) & 0x1;
40  m_count.at(i) = fibre & 0xf;
41  }
42  }

◆ encode()

void L1Topo::Fibre::encode ( )
protected

method used by constructor to encode word

Definition at line 25 of file Fibre.cxx.

25  {
26  m_word = static_cast<uint32_t>(L1Topo::BlockTypes::FIBRE) << 28;
27  // assert(status.size()<=5);
28  // assert(status.size()==count.size());
29  for (unsigned int i=0; i<5 && i<m_status.size() && i<m_count.size(); ++i){
30  // assert(m_count.at(i)<0x10); // should not exceed 4 bits
31  uint32_t fibre = (m_status.at(i) & 0x1) << 4 | (m_count.at(i) & 0xf) ;
32  m_word |= (fibre << (((4-i)*5)+3) );
33  }
34  }

◆ status()

const std::vector< uint32_t > & L1Topo::Fibre::status ( ) const

access method

Definition at line 48 of file Fibre.cxx.

48  {
49  return m_status;
50  }

◆ word()

uint32_t L1Topo::Fibre::word ( ) const

access method

Definition at line 44 of file Fibre.cxx.

44  {
45  return m_word;
46  }

Member Data Documentation

◆ m_count

std::vector<uint32_t> L1Topo::Fibre::m_count
private

fibre counts

Definition at line 43 of file Fibre.h.

◆ m_status

std::vector<uint32_t> L1Topo::Fibre::m_status
private

fibre status

Definition at line 41 of file Fibre.h.

◆ m_word

uint32_t L1Topo::Fibre::m_word
private

The raw data representation.

Definition at line 45 of file Fibre.h.


The documentation for this class was generated from the following files:
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
L1Topo::Fibre::status
const std::vector< uint32_t > & status() const
access method
Definition: Fibre.cxx:48
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
L1Topo::BlockTypes::FIBRE
@ FIBRE
L1Topo::Fibre::m_count
std::vector< uint32_t > m_count
fibre counts
Definition: Fibre.h:43
L1Topo::Fibre::decode
void decode()
method used by constructor to decode word
Definition: Fibre.cxx:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
L1Topo::Fibre::m_word
uint32_t m_word
The raw data representation.
Definition: Fibre.h:45
L1Topo::Fibre::word
uint32_t word() const
access method
Definition: Fibre.cxx:44
L1Topo::Fibre::encode
void encode()
method used by constructor to encode word
Definition: Fibre.cxx:25
L1Topo::Fibre::count
const std::vector< uint32_t > & count() const
access method
Definition: Fibre.cxx:52
L1Topo::Fibre::m_status
std::vector< uint32_t > m_status
fibre status
Definition: Fibre.h:41