CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
eformat::old::RODFragment Class Reference

#include <RODFragment.h>

Public Member Functions

 RODFragment (const uint32_t *it, size_t size_word)
 
virtual ~RODFragment ()
 
virtual bool check () const
 
uint32_t marker () const
 
uint32_t fragment_size_word () const
 
uint32_t header_size_word () const
 
uint32_t trailer_size_word () const
 
uint32_t version () const
 
uint32_t source_id () const
 
uint32_t run_no () const
 
uint32_t lvl1_id () const
 
uint32_t bc_id () const
 
uint32_t lvl1_trigger_type () const
 
uint32_t detev_type () const
 
uint32_t nstatus () const
 
const uint32_t * status (void) const
 
uint32_t ndata () const
 
const uint32_t * data (void) const
 
uint32_t status_position () const
 

Detailed Description

Implements the access methods and checking for the ROD header object, present in the event format stream. Manipulating ROD's is a bit different than the other fragments, as one can't know its ending position. There are two ways to solve that: the first being to give a pointer and a size, but the second, a bit more elegant, to indicate the end of the ROD instead of its begin.

Definition at line 32 of file RODFragment.h.

Constructor & Destructor Documentation

◆ RODFragment()

eformat::old::RODFragment::RODFragment ( const uint32_t * it,
size_t size_word )

To build a header given the containing buffer. I need to know where the header starts in order to do that.

Parameters
itThe position pointing the first word of this fragment
size_wordThe size of this fragment, in words

Definition at line 22 of file RODFragment24.cxx.

23 : m_start(it),
24 m_size(size_word)
25{
26 uint32_t m = marker();
28}
#define EFORMAT_WRONG_MARKER(current, expected)
uint32_t marker() const
Definition RODFragment.h:58
@ ROD
The ROD marker.

◆ ~RODFragment()

virtual eformat::old::RODFragment::~RODFragment ( )
inlinevirtual

Destructor virtualisation

Definition at line 48 of file RODFragment.h.

48{}

Member Function Documentation

◆ bc_id()

uint32_t eformat::old::RODFragment::bc_id ( ) const
inline

Returns the bunch crossing identifier

Definition at line 99 of file RODFragment.h.

99{ return m_start[6]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ check()

bool eformat::old::RODFragment::check ( ) const
virtual

Says if the the header is valid. This may throw exceptions.

Definition at line 47 of file RODFragment24.cxx.

48{
49 if ( version() >> 16 != eformat::MAJOR_OLD_VERSION )
51 if ( header_size_word() != 9 )
53 if ( m_size != 12 + nstatus() + ndata() )
54 throw EFORMAT_SIZE_CHECK(m_size, (12 + nstatus() + ndata()));
55 return true;
56}
#define EFORMAT_BAD_VERSION(current, supported)
#define EFORMAT_SIZE_CHECK(actual, informed)
uint32_t nstatus() const
uint32_t version() const
Definition RODFragment.h:79
uint32_t ndata() const
uint32_t header_size_word() const
Definition RODFragment.h:69
const uint16_t MAJOR_OLD_VERSION
Definition Version.h:34

Referenced by eformat::old::ROBFragment::check_tree(), and eformat::old::ROBFragment::rod().

◆ data()

const uint32_t * eformat::old::RODFragment::data ( void ) const

Returns a pointer to the first data word

Definition at line 41 of file RODFragment24.cxx.

42{
43 if (status_position() == eformat::STATUS_BACK) return &m_start[9];
44 return &m_start[9 + nstatus()];
45}
uint32_t status_position() const
const uint32_t STATUS_BACK
status goes after data block
Definition Status.h:39

Referenced by eformat::old::convert(), and convert_ros().

◆ detev_type()

uint32_t eformat::old::RODFragment::detev_type ( ) const
inline

Returns the detector event type

Definition at line 109 of file RODFragment.h.

109{ return m_start[8]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ fragment_size_word()

uint32_t eformat::old::RODFragment::fragment_size_word ( ) const

Returns the total fragment size

Definition at line 30 of file RODFragment24.cxx.

31{
33}
uint32_t trailer_size_word() const
Definition RODFragment.h:74

◆ header_size_word()

uint32_t eformat::old::RODFragment::header_size_word ( ) const
inline

Returns the size, in words, of the current header. That does not include the trailer.

Definition at line 69 of file RODFragment.h.

69{ return m_start[1]; }

◆ lvl1_id()

uint32_t eformat::old::RODFragment::lvl1_id ( ) const
inline

Returns the lvl1 identifier

Definition at line 94 of file RODFragment.h.

94{ return m_start[5]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ lvl1_trigger_type()

uint32_t eformat::old::RODFragment::lvl1_trigger_type ( ) const
inline

Returns the lvl1 trigger type

Definition at line 104 of file RODFragment.h.

104{ return m_start[7]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ marker()

uint32_t eformat::old::RODFragment::marker ( ) const
inline

Returns the fragment type.

Definition at line 58 of file RODFragment.h.

58{ return m_start[0]; }

Referenced by RODFragment().

◆ ndata()

uint32_t eformat::old::RODFragment::ndata ( ) const
inline

Returns the number of data words available

Definition at line 125 of file RODFragment.h.

125{ return m_start[m_size-2]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ nstatus()

uint32_t eformat::old::RODFragment::nstatus ( ) const
inline

Returns the number of status words available

Definition at line 114 of file RODFragment.h.

114{ return m_start[m_size-3]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ run_no()

uint32_t eformat::old::RODFragment::run_no ( ) const
inline

Returns the current run number.

Definition at line 89 of file RODFragment.h.

89{ return m_start[4]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ source_id()

uint32_t eformat::old::RODFragment::source_id ( ) const
inline

Returns the full source identifier.

Definition at line 84 of file RODFragment.h.

84{ return m_start[3]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ status()

const uint32_t * eformat::old::RODFragment::status ( void ) const

Returns the status words, as an iterator to the status words available.

Definition at line 35 of file RODFragment24.cxx.

36{
37 if (status_position() == eformat::STATUS_FRONT) return &m_start[9];
38 return &m_start[9 + ndata()];
39}
const uint32_t STATUS_FRONT
status goes in front of data block
Definition Status.h:38

Referenced by eformat::old::convert(), and convert_ros().

◆ status_position()

uint32_t eformat::old::RODFragment::status_position ( ) const
inline

Returns the status block position. A value of zero indicates that the status block preceeds the data block. A value of one means the contrary.

Definition at line 137 of file RODFragment.h.

137{ return m_start[m_size-1]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ trailer_size_word()

uint32_t eformat::old::RODFragment::trailer_size_word ( ) const
inline

Returns the size, in words, of the trailer

Definition at line 74 of file RODFragment.h.

74{ return 3; }

◆ version()

uint32_t eformat::old::RODFragment::version ( ) const
inline

Returns the formatting version.

Definition at line 79 of file RODFragment.h.

79{ return m_start[2]; }

Referenced by eformat::old::convert(), and convert_ros().


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