BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
eformat::ROBFragment< TPointer > Class Template Reference

#include <ROBFragment.h>

+ Inheritance diagram for eformat::ROBFragment< TPointer >:

Public Member Functions

 ROBFragment (const TPointer &it)
 
 ROBFragment (const ROBFragment &other)
 
 ROBFragment ()
 
virtual ~ROBFragment ()
 
ROBFragmentoperator= (const ROBFragment &other)
 
ROBFragmentassign (const TPointer &it)
 
virtual bool check () const
 
bool check_tree () const
 
uint32_t rod_marker () const
 
uint32_t rod_fragment_size_word () const
 
uint32_t rod_header_size_word () const
 
uint32_t rod_trailer_size_word () const
 
uint32_t rod_version () const
 
uint32_t rod_source_id () const
 
uint32_t rod_run_no () const
 
uint32_t rod_lvl1_id () const
 
uint32_t rod_bc_id () const
 
uint32_t rod_lvl1_trigger_type () const
 
uint32_t rod_detev_type () const
 
uint32_t rod_nstatus () const
 
void rod_status (TPointer &it) const
 
uint32_t rod_ndata () const
 
void rod_data (TPointer &it) const
 
uint32_t rod_status_position () const
 
- Public Member Functions inherited from eformat::Header< TPointer >
 Header (const TPointer &it, uint32_t match)
 
 Header ()
 
 Header (const Header &other)
 
virtual ~Header ()
 
Headeroperator= (const Header &other)
 
Headerassign (const TPointer &it, uint32_t match)
 
virtual bool check () const
 
uint32_t marker () const
 
uint32_t fragment_size_word () const
 
uint32_t header_size_word () const
 
uint32_t version () const
 
uint32_t source_id () const
 
uint32_t nstatus () const
 
void start (TPointer &it) const
 
void payload (TPointer &it) const
 
void end (TPointer &it) const
 
uint32_t payload_size_word (void) const
 
void status (TPointer &it) const
 
uint32_t nspecific () const
 
void specific_header (TPointer &it) const
 
virtual uint32_t nchildren () const
 
virtual void child (TPointer &p, size_t n) const
 
virtual void child_check (TPointer &p, size_t n) const
 
virtual uint32_t children (TPointer *p, size_t max) const
 

Detailed Description

template<class TPointer>
class eformat::ROBFragment< TPointer >

Describes how to access the contents of a subdetector fragment, as prescribed by the event format note.

Definition at line 30 of file ROBFragment.h.

Constructor & Destructor Documentation

◆ ROBFragment() [1/3]

template<class TPointer >
eformat::ROBFragment< TPointer >::ROBFragment ( const TPointer &  it)

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

Parameters
itThe exact position where this fragment should start.

Definition at line 193 of file ROBFragment.h.

195 m_start()
196{
197 ERS_DEBUG_3("Building ROBFragment from pointer");
198 specific_header(m_start);
199 ERS_DEBUG_1("Initialized header with source identifier = %s",
201 ERS_DEBUG_3("Building underlying RODFragment");
202 if (rod_marker() != eformat::ROD)
204 ERS_DEBUG_1("Initialized ROD header with source identifier = %s",
206}
#define ERS_DEBUG_1(...)
#define ERS_DEBUG_3(...)
#define EFORMAT_WRONG_MARKER(current, expected)
uint32_t source_id() const
Definition: Header.h:116
void specific_header(TPointer &it) const
Definition: Header.h:172
uint32_t rod_marker() const
Definition: ROBFragment.h:88
uint32_t rod_source_id() const
Definition: ROBFragment.h:115
char * c_str(Index i)
Definition: EvtCyclic3.cc:252
@ ROB
The ROB marker.
Definition: HeaderMarker.h:27
@ ROD
The ROD marker.
Definition: HeaderMarker.h:26

◆ ROBFragment() [2/3]

template<class TPointer >
eformat::ROBFragment< TPointer >::ROBFragment ( const ROBFragment< TPointer > &  other)
inline

Copy constructor

Parameters
otherThe fragment to be copied

Definition at line 47 of file ROBFragment.h.

48 : Header<TPointer>(other), m_start(other.m_start) {}
Index other(Index i, Index j)
Definition: EvtCyclic3.cc:118

◆ ROBFragment() [3/3]

template<class TPointer >
eformat::ROBFragment< TPointer >::ROBFragment ( )
inline

Builds an empty, otherwise useless ROBFragment

Definition at line 53 of file ROBFragment.h.

53: Header<TPointer>(), m_start() {}

◆ ~ROBFragment()

template<class TPointer >
virtual eformat::ROBFragment< TPointer >::~ROBFragment ( )
inlinevirtual

Destructor virtualisation

Definition at line 58 of file ROBFragment.h.

58{}

Member Function Documentation

◆ assign()

template<class TPointer >
eformat::ROBFragment< TPointer > & eformat::ROBFragment< TPointer >::assign ( const TPointer &  it)

Manual re-assignment

Parameters
itThe position pointing the first word of this fragment

Definition at line 209 of file ROBFragment.h.

210{
211 ERS_DEBUG_3("Re-building ROBFragment from pointer");
213 specific_header(m_start);
214 ERS_DEBUG_1("Initialized header with source identifier = %s",
216 ERS_DEBUG_3("Re-building underlying RODFragment");
217 if (rod_marker() != eformat::ROD)
219 ERS_DEBUG_1("Reinitialized header with source identifier = %s",
221 return *this;
222}
Header & assign(const TPointer &it, uint32_t match)
Definition: Header.h:236

◆ check()

template<class TPointer >
bool eformat::ROBFragment< TPointer >::check
virtual

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

Reimplemented from eformat::Header< TPointer >.

Definition at line 225 of file ROBFragment.h.

226{
227 //ROB checking
228 ERS_DEBUG_2("Checking for consistency of ROBFragment [%s]",
230 eformat::Header<TPointer>::check(); //< first do a generic check
231 if (eformat::Header<TPointer>::nspecific() != NSPECIFIC)
232 throw EFORMAT_SIZE_CHECK(NSPECIFIC, this->nspecific());
233
234 //ROD checking
235 ERS_DEBUG_2("Checking for consistency of RODFragment [%s]",
238 throw EFORMAT_BAD_VERSION(rod_version() >> 16,
240 if ( rod_header_size_word() != 9 )
242 if ( rod_fragment_size_word() != 12 + rod_nstatus() + rod_ndata() )
244 (12 + rod_nstatus() + rod_ndata()));
245 return true;
246}
#define EFORMAT_BAD_VERSION(current, supported)
#define EFORMAT_SIZE_CHECK(actual, informed)
#define ERS_DEBUG_2(...)
uint32_t nspecific() const
Definition: Header.h:164
virtual bool check() const
Definition: Header.h:249
uint32_t rod_nstatus() const
Definition: ROBFragment.h:145
uint32_t rod_version() const
Definition: ROBFragment.h:110
uint32_t rod_fragment_size_word() const
Definition: ROBFragment.h:93
uint32_t rod_header_size_word() const
Definition: ROBFragment.h:100
uint32_t rod_ndata() const
Definition: ROBFragment.h:159
const uint16_t MAJOR_DEFAULT_VERSION
Definition: Version.h:29

Referenced by eformat::ROBFragment< TPointer >::check_tree().

◆ check_tree()

template<class TPointer >
bool eformat::ROBFragment< TPointer >::check_tree ( ) const
inline

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

Definition at line 83 of file ROBFragment.h.

83{ check(); return true; }
virtual bool check() const
Definition: ROBFragment.h:225

◆ operator=()

template<class TPointer >
ROBFragment & eformat::ROBFragment< TPointer >::operator= ( const ROBFragment< TPointer > &  other)
inline

Assignment

Parameters
otherThe fragment to be copied

Definition at line 65 of file ROBFragment.h.

66 { Header<TPointer>::operator=(other); m_start=other.m_start; return *this; }
Header & operator=(const Header &other)
Definition: Header.h:75

◆ rod_bc_id()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_bc_id ( ) const
inline

Returns the bunch crossing identifier

Definition at line 130 of file ROBFragment.h.

130{ return m_start[6]; }

◆ rod_data()

template<class TPointer >
void eformat::ROBFragment< TPointer >::rod_data ( TPointer &  it) const

Returns a pointer to the first data word

Parameters
itAn updateable iterator you should provide.

Definition at line 257 of file ROBFragment.h.

258{
259 it = m_start;
260 it += 9;
261 if (!rod_status_position()) it += rod_nstatus();
262}
uint32_t rod_status_position() const
Definition: ROBFragment.h:174

Referenced by EFEventLoopMgr::executeEvent(), main(), RawDataInputSvc::nextEvent(), MixerAlg::nextEvent(), and RawEventReader::readEvent().

◆ rod_detev_type()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_detev_type ( ) const
inline

Returns the detector event type

Definition at line 140 of file ROBFragment.h.

140{ return m_start[8]; }

Referenced by EFEventLoopMgr::executeEvent(), main(), RawDataInputSvc::nextEvent(), MixerAlg::nextEvent(), and RawEventReader::readEvent().

◆ rod_fragment_size_word()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_fragment_size_word ( ) const
inline

Returns the total fragment size

Definition at line 93 of file ROBFragment.h.

94 { return this->payload_size_word(); }
uint32_t payload_size_word(void) const
Definition: Header.h:149

◆ rod_header_size_word()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_header_size_word ( ) const
inline

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

Definition at line 100 of file ROBFragment.h.

100{ return m_start[1]; }

◆ rod_lvl1_id()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_lvl1_id ( ) const
inline

Returns the lvl1 identifier

Definition at line 125 of file ROBFragment.h.

125{ return m_start[5]; }

Referenced by main().

◆ rod_lvl1_trigger_type()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_lvl1_trigger_type ( ) const
inline

Returns the lvl1 trigger type

Definition at line 135 of file ROBFragment.h.

135{ return m_start[7]; }

◆ rod_marker()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_marker ( ) const
inline

Returns the fragment type.

Definition at line 88 of file ROBFragment.h.

88{ return m_start[0]; }

Referenced by eformat::ROBFragment< TPointer >::ROBFragment().

◆ rod_ndata()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_ndata ( ) const
inline

Returns the number of data words available

Definition at line 159 of file ROBFragment.h.

160 { return m_start[this->payload_size_word()-2]; }

Referenced by EFEventLoopMgr::executeEvent(), main(), RawDataInputSvc::nextEvent(), MixerAlg::nextEvent(), and RawEventReader::readEvent().

◆ rod_nstatus()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_nstatus ( ) const
inline

Returns the number of status words available

Definition at line 145 of file ROBFragment.h.

146 { return m_start[this->payload_size_word()-3]; }

◆ rod_run_no()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_run_no ( ) const
inline

Returns the current run number.

Definition at line 120 of file ROBFragment.h.

120{ return m_start[4]; }

◆ rod_source_id()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_source_id ( ) const
inline

◆ rod_status()

template<class TPointer >
void eformat::ROBFragment< TPointer >::rod_status ( TPointer &  it) const

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

Parameters
itAn updateable iterator you should provide.

Definition at line 249 of file ROBFragment.h.

250{
251 it = m_start;
252 it += 9;
253 if (rod_status_position()) it += rod_ndata();
254}

◆ rod_status_position()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_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 174 of file ROBFragment.h.

175 { return m_start[this->payload_size_word()-1]; }

◆ rod_trailer_size_word()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_trailer_size_word ( ) const
inline

Returns the size, in words, of the trailer

Definition at line 105 of file ROBFragment.h.

105{ return 3; }

◆ rod_version()

template<class TPointer >
uint32_t eformat::ROBFragment< TPointer >::rod_version ( ) const
inline

Returns the formatting version.

Definition at line 110 of file ROBFragment.h.

110{ return m_start[2]; }

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