Project
Loading...
Searching...
No Matches
o2::cpv::RawReaderMemory Class Reference

Reader for raw data produced by the Readout application in in-memory format. More...

#include <RawReaderMemory.h>

Public Member Functions

 RawReaderMemory (const gsl::span< const char > rawmemory)
 Constructor.
 
 ~RawReaderMemory ()=default
 Destructor.
 
void setRawMemory (const gsl::span< const char > rawmemory)
 set new raw memory chunk
 
RawErrorType_t next ()
 Read next payload from the stream.
 
RawErrorType_t nextPage ()
 Read the next page from the stream (single DMA page)
 
const o2::header::RDHAnygetRawHeader () const
 access to the raw header of the current page
 
const std::vector< char > & getPayload () const
 access to the full raw payload (single or multiple DMA pages)
 
int getPayloadSize () const
 Return size of the payload.
 
int getFileSize () const noexcept
 get the size of the file in bytes
 
bool hasNext () const
 check if more pages are available in the raw file
 
uint32_t getCurrentHBFOrbit () const
 
uint8_t getDataFormat () const
 get data format from RDH
 

Protected Member Functions

void init ()
 Initialize the raw stream.
 
o2::header::RDHAny decodeRawHeader (const void *headerwords)
 

Detailed Description

Reader for raw data produced by the Readout application in in-memory format.

Author
Dmitri Peresunko after Markus Fasel
Since
Sept. 25, 2020

It reads one HBF, stores HBF orbit number in getCurrentHBFOrbit() and produces digits in AddressChargeBC format

Definition at line 56 of file RawReaderMemory.h.

Constructor & Destructor Documentation

◆ RawReaderMemory()

RawReaderMemory::RawReaderMemory ( const gsl::span< const char rawmemory)

Constructor.

Definition at line 22 of file RawReaderMemory.cxx.

◆ ~RawReaderMemory()

o2::cpv::RawReaderMemory::~RawReaderMemory ( )
default

Destructor.

Member Function Documentation

◆ decodeRawHeader()

o2::header::RDHAny RawReaderMemory::decodeRawHeader ( const void headerwords)
protected

Definition at line 33 of file RawReaderMemory.cxx.

◆ getCurrentHBFOrbit()

uint32_t o2::cpv::RawReaderMemory::getCurrentHBFOrbit ( ) const
inline
Returns
HeartBeatFrame orbit number

Definition at line 105 of file RawReaderMemory.h.

◆ getDataFormat()

uint8_t o2::cpv::RawReaderMemory::getDataFormat ( ) const
inline

get data format from RDH

Returns
data format read from RDH (0x0 for RDH version < 7)

Definition at line 109 of file RawReaderMemory.h.

◆ getFileSize()

int o2::cpv::RawReaderMemory::getFileSize ( ) const
inlinenoexcept

get the size of the file in bytes

Returns
size of the file in byte

Definition at line 98 of file RawReaderMemory.h.

◆ getPayload()

const std::vector< char > & o2::cpv::RawReaderMemory::getPayload ( ) const
inline

access to the full raw payload (single or multiple DMA pages)

Returns
Raw Payload of the data until the stop bit is received.

Definition at line 90 of file RawReaderMemory.h.

◆ getPayloadSize()

int o2::cpv::RawReaderMemory::getPayloadSize ( ) const
inline

Return size of the payload.

Returns
size of the payload

Definition at line 94 of file RawReaderMemory.h.

◆ getRawHeader()

const o2::header::RDHAny & o2::cpv::RawReaderMemory::getRawHeader ( ) const
inline

access to the raw header of the current page

Returns
Raw header of the current page

Definition at line 86 of file RawReaderMemory.h.

◆ hasNext()

bool o2::cpv::RawReaderMemory::hasNext ( ) const
inline

check if more pages are available in the raw file

Returns
true if there is a next page

Definition at line 102 of file RawReaderMemory.h.

◆ init()

void RawReaderMemory::init ( )
protected

Initialize the raw stream.

Rewind stream to the first entry

Definition at line 43 of file RawReaderMemory.cxx.

◆ next()

RawErrorType_t RawReaderMemory::next ( )

Read next payload from the stream.

Read the next pages until the stop bit is found.

Definition at line 55 of file RawReaderMemory.cxx.

◆ nextPage()

RawErrorType_t RawReaderMemory::nextPage ( )

Read the next page from the stream (single DMA page)

Parameters
resetPayloadIf true the raw payload is reset
Exceptions
Errorif the page cannot be read or header or payload cannot be deocded

Function reading a single DMA page from the stream. It is called inside the next() function for reading payload from multiple DMA pages. As the function cannot handle payload from multiple pages it should not be called directly by the user.

Definition at line 77 of file RawReaderMemory.cxx.

◆ setRawMemory()

void RawReaderMemory::setRawMemory ( const gsl::span< const char rawmemory)

set new raw memory chunk

Parameters
rawmemoryNew raw memory chunk

Definition at line 27 of file RawReaderMemory.cxx.


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