ATLAS Offline Software
Loading...
Searching...
No Matches
ROIB::Trailer Class Reference

ROIB::Trailer models the LVL1 ROD Trailer. More...

#include <Trailer.h>

Collaboration diagram for ROIB::Trailer:

Public Member Functions

 Trailer ()
 default constructor: empty object
 Trailer (Trailer &&) noexcept=default
 Trailer (const Trailer &)=default
Traileroperator= (Trailer &&) noexcept=default
Traileroperator= (const Trailer &)=default
 Trailer (std::vector< uint32_t > &&v)
 constructor which fully specifies the initialiser values
 Trailer (const uint32_t, const uint32_t)
 constructor specifying the number of data words and the error status
 Trailer (const uint32_t)
 constructor specifying the number of data words
 ~Trailer ()=default
 empty default destructor
const std::vector< uint32_t > & trailer () const
 get full trailer
int size () const
 get trailer/data size (should always return 5)
uint32_t errorStatus () const
 get error status word (LVL1 trailer assumes only on word)
uint32_t statusInfo () const
 get info status word (LVL1 trailer assumes only on word)
uint32_t numStatusWords () const
 get number of status words in trailer
uint32_t numDataWords () const
 get number of data words
uint32_t statusPosition () const
 get position of status information in ROD (LVL1 assumes 1)
void setSimulationError ()
 set error status to 0xffff0000 for ROD was not found in SG
void setNumDataWords (const unsigned int)
 set number of data words
const std::string dump () const
 dump raw object content to string
const std::string print (const bool longFormat=false) const
 print object content in a human readable format to string
void dumpData () const
 print object content to default message stream
void dumpData (MsgStream &) const
 print object content to given message stream

Static Public Attributes

static constexpr unsigned int wordsPerTrailer = 5
 a ROD trailer as used in the LVL1 has 5 words, not counting the one hardware word in the end

Private Attributes

std::vector< uint32_t > m_trailer
 vector of unsigned ints - the only data member - hopefully 5

Detailed Description

ROIB::Trailer models the LVL1 ROD Trailer.

   Trailer is a class equivalent to the ROD trailer 
   from the eformat lib, just much simpler and adapted 
   to the LVL1 needs.
See also
ROIB::Header
Author
Thomas Schoerner-Sadenius thoma.nosp@m.s.sc.nosp@m.hoern.nosp@m.er@c.nosp@m.ern.c.nosp@m.h
Version
$Id: Trailer.h,v 1.10 2008-12-18 13:35:05 dquarrie Exp $

Definition at line 37 of file Trailer.h.

Constructor & Destructor Documentation

◆ Trailer() [1/6]

ROIB::Trailer::Trailer ( )
inline

default constructor: empty object

Definition at line 46 of file Trailer.h.

47 : m_trailer() {}
std::vector< uint32_t > m_trailer
vector of unsigned ints - the only data member - hopefully 5
Definition Trailer.h:105

◆ Trailer() [2/6]

ROIB::Trailer::Trailer ( Trailer && )
defaultnoexcept

◆ Trailer() [3/6]

ROIB::Trailer::Trailer ( const Trailer & )
default

◆ Trailer() [4/6]

ROIB::Trailer::Trailer ( std::vector< uint32_t > && v)
inline

constructor which fully specifies the initialiser values

Definition at line 55 of file Trailer.h.

56 : m_trailer( std::move(v) ) {}

◆ Trailer() [5/6]

ROIB::Trailer::Trailer ( const uint32_t i1,
const uint32_t i2 )

constructor specifying the number of data words and the error status

Definition at line 24 of file Trailer.cxx.

24 {
25
26 m_trailer.push_back( i2 ); // status element: error
27 m_trailer.push_back( 0 ); // status element: info
28 m_trailer.push_back( 2 ); // number of status words
29 m_trailer.push_back( i1 ); // number of data words
30 m_trailer.push_back( 1 ); // status block position
31
32 }

◆ Trailer() [6/6]

ROIB::Trailer::Trailer ( const uint32_t i)

constructor specifying the number of data words

Definition at line 34 of file Trailer.cxx.

34 {
35
36 m_trailer.push_back( 0 ); // status element: error
37 m_trailer.push_back( 0 ); // status element: info
38 m_trailer.push_back( 2 ); // number of status words
39 m_trailer.push_back( i ); // number of data words
40 m_trailer.push_back( 1 ); // status block position
41
42 }

◆ ~Trailer()

ROIB::Trailer::~Trailer ( )
default

empty default destructor

Member Function Documentation

◆ dump()

const std::string ROIB::Trailer::dump ( ) const

dump raw object content to string

Definition at line 45 of file Trailer.cxx.

46 {
47 std::ostringstream s;
48
49 for (size_t i(0); i < m_trailer.size(); ++i) {
51 }
52
53 return s.str();
54 }
const std::string convertToHex(const uint32_t word)
helper function to dump a number in hex format

◆ dumpData() [1/2]

void ROIB::Trailer::dumpData ( ) const

print object content to default message stream

Definition at line 76 of file Trailer.cxx.

77 {
78 SmartIF<IMessageSvc> msgSvc{Gaudi::svcLocator()->service("MessageSvc")};
79 if ( !msgSvc ) {
80 return;
81 }
82 MsgStream log(msgSvc, "ROIB::Header");
83 dumpData(log);
84 }
void dumpData() const
print object content to default message stream
Definition Trailer.cxx:76
msgSvc
Provide convenience handles for various services.
Definition StdJOSetup.py:36

◆ dumpData() [2/2]

void ROIB::Trailer::dumpData ( MsgStream & log) const

print object content to given message stream

Definition at line 86 of file Trailer.cxx.

87 {
88 log << MSG::DEBUG << "*BEGIN* ROIB::Trailer" << endmsg;
89 log << MSG::DEBUG << "Trailer size : " << size() << endmsg;
90 log << MSG::DEBUG << "Error status : " << errorStatus() << endmsg;
91 log << MSG::DEBUG << "Status info : " << statusInfo() << endmsg;
92 log << MSG::DEBUG << "No data words : " << numDataWords() << endmsg;
93 log << MSG::DEBUG << "*END* ROIB::Trailer" << endmsg;
94 }
#define endmsg
uint32_t numDataWords() const
get number of data words
int size() const
get trailer/data size (should always return 5)
uint32_t errorStatus() const
get error status word (LVL1 trailer assumes only on word)
uint32_t statusInfo() const
get info status word (LVL1 trailer assumes only on word)

◆ errorStatus()

uint32_t ROIB::Trailer::errorStatus ( ) const

get error status word (LVL1 trailer assumes only on word)

◆ numDataWords()

uint32_t ROIB::Trailer::numDataWords ( ) const

get number of data words

◆ numStatusWords()

uint32_t ROIB::Trailer::numStatusWords ( ) const

get number of status words in trailer

◆ operator=() [1/2]

Trailer & ROIB::Trailer::operator= ( const Trailer & )
default

◆ operator=() [2/2]

Trailer & ROIB::Trailer::operator= ( Trailer && )
defaultnoexcept

◆ print()

const std::string ROIB::Trailer::print ( const bool longFormat = false) const

print object content in a human readable format to string

Definition at line 56 of file Trailer.cxx.

57 {
58 std::ostringstream s;
59
60 if (longFormat) {
61 s << "Size: " << size() << std::endl;
62 s << std::setw(2) << 0 << "ErrorStatus:" << errorStatus() << std::endl;
63 s << std::setw(2) << 1 << "SatusInfo:" << statusInfo() << std::endl;
64 s << std::setw(2) << 2 << "nStatusWords:" << numStatusWords() << std::endl;
65 s << std::setw(2) << 3 << "nDataWords:" << numDataWords() << std::endl;
66 s << std::setw(2) << 4 << "StatusPosition:" << statusPosition();
67 } else {
68 for (size_t i(0); i < m_trailer.size(); ++i) {
70 }
71 }
72
73 return s.str();
74 }
uint32_t statusPosition() const
get position of status information in ROD (LVL1 assumes 1)
uint32_t numStatusWords() const
get number of status words in trailer

◆ setNumDataWords()

void ROIB::Trailer::setNumDataWords ( const unsigned int )

set number of data words

◆ setSimulationError()

void ROIB::Trailer::setSimulationError ( )

set error status to 0xffff0000 for ROD was not found in SG

◆ size()

int ROIB::Trailer::size ( ) const

get trailer/data size (should always return 5)

◆ statusInfo()

uint32_t ROIB::Trailer::statusInfo ( ) const

get info status word (LVL1 trailer assumes only on word)

◆ statusPosition()

uint32_t ROIB::Trailer::statusPosition ( ) const

get position of status information in ROD (LVL1 assumes 1)

◆ trailer()

const std::vector< uint32_t > & ROIB::Trailer::trailer ( ) const

get full trailer

Member Data Documentation

◆ m_trailer

std::vector< uint32_t > ROIB::Trailer::m_trailer
private

vector of unsigned ints - the only data member - hopefully 5

Definition at line 105 of file Trailer.h.

◆ wordsPerTrailer

unsigned int ROIB::Trailer::wordsPerTrailer = 5
staticconstexpr

a ROD trailer as used in the LVL1 has 5 words, not counting the one hardware word in the end

number of words in trailer (Ref: ATL-DA-ES-0029.)

Definition at line 43 of file Trailer.h.


The documentation for this class was generated from the following files: