artdaq_core  v3_02_01
artdaq::RawEvent Class Reference

RawEvent is the artdaq view of a generic event, containing a header and zero or more Fragments. More...

#include <artdaq-core/Data/RawEvent.hh>

Public Types

typedef
detail::RawEventHeader::run_id_t 
run_id_t
 Run numbers are 32 bits.
 
typedef
detail::RawEventHeader::subrun_id_t 
subrun_id_t
 Subrun numbers are 32 bits.
 
typedef
detail::RawEventHeader::sequence_id_t 
sequence_id_t
 Field size should be the same as the Fragment::sequence_id field.
 

Public Member Functions

 RawEvent (run_id_t run, subrun_id_t subrun, sequence_id_t event)
 Constructs a RawEvent with the given parameters. More...
 
 RawEvent (detail::RawEventHeader hdr)
 Constructs a RawEvent using the given RawEventHeader. More...
 
void insertFragment (FragmentPtr &&pfrag)
 Insert the given (pointer to a) Fragment into this RawEvent. More...
 
void markComplete ()
 Mark the event as complete.
 
size_t numFragments () const
 Return the number of fragments this RawEvent contains. More...
 
size_t wordCount () const
 Return the sum of the word counts of all fragments in this RawEvent. More...
 
run_id_t runID () const
 Retrieve the run number from the RawEventHeader. More...
 
subrun_id_t subrunID () const
 Retrieve the subrun number from the RawEventHeader. More...
 
sequence_id_t sequenceID () const
 Retrieve the sequence id from the RawEventHeader. More...
 
bool isComplete () const
 Retrieve the value of the complete flag from the RawEventHeader. More...
 
void print (std::ostream &os) const
 Print summary information about this RawEvent to the given stream. More...
 
std::unique_ptr< FragmentsreleaseProduct ()
 Release all the Fragments from this RawEvent. More...
 
void fragmentTypes (std::vector< Fragment::type_t > &type_list)
 Fills in a list of unique fragment types from this event. More...
 
std::unique_ptr< FragmentsreleaseProduct (Fragment::type_t type)
 Release Fragments from the RawEvent. More...
 

Detailed Description

RawEvent is the artdaq view of a generic event, containing a header and zero or more Fragments.

RawEvent should be a class, not a struct; it should be enforcing invariants (the contained Fragments should all have the correct event id).

Definition at line 64 of file RawEvent.hh.

Constructor & Destructor Documentation

artdaq::RawEvent::RawEvent ( run_id_t  run,
subrun_id_t  subrun,
sequence_id_t  event 
)
inline

Constructs a RawEvent with the given parameters.

Parameters
runThe current Run number
subrunThe current Subrun number
eventThe current sequence_id

Definition at line 184 of file RawEvent.hh.

artdaq::RawEvent::RawEvent ( detail::RawEventHeader  hdr)
inlineexplicit

Constructs a RawEvent using the given RawEventHeader.

Parameters
hdrHeader to use for initializing RawEvent

Definition at line 188 of file RawEvent.hh.

Member Function Documentation

void artdaq::RawEvent::fragmentTypes ( std::vector< Fragment::type_t > &  type_list)
inline

Fills in a list of unique fragment types from this event.

Parameters
type_listAny Fragment types not included in this list will be added

Definition at line 243 of file RawEvent.hh.

void artdaq::RawEvent::insertFragment ( FragmentPtr &&  pfrag)
inline

Insert the given (pointer to a) Fragment into this RawEvent.

Parameters
pfragThe FragmentPtr to insert into the RawEvent
Exceptions
cet::exceptionif pfrag is nullptr

Insert the given (pointer to a) Fragment into this RawEvent. This takes ownership of the Fragment referenced by the FragmentPtr, unless an exception is thrown.

Definition at line 193 of file RawEvent.hh.

bool artdaq::RawEvent::isComplete ( ) const
inline

Retrieve the value of the complete flag from the RawEventHeader.

Returns
The value of RawEventHeader::is_complete

Definition at line 222 of file RawEvent.hh.

size_t artdaq::RawEvent::numFragments ( ) const
inline

Return the number of fragments this RawEvent contains.

Returns
The number of Fragment objects in this RawEvent

Definition at line 206 of file RawEvent.hh.

void artdaq::RawEvent::print ( std::ostream &  os) const

Print summary information about this RawEvent to the given stream.

Parameters
osThe target stream for summary information

Definition at line 6 of file RawEvent.cc.

std::unique_ptr< Fragments > artdaq::RawEvent::releaseProduct ( )
inline

Release all the Fragments from this RawEvent.

Returns
A pointer to a Fragments object (owns the Fragment data contained)

Release all the Fragments from this RawEvent, returning them to the caller through a unique_ptr that manages a vector into which the Fragments have been moved.

Definition at line 225 of file RawEvent.hh.

std::unique_ptr< Fragments > artdaq::RawEvent::releaseProduct ( Fragment::type_t  type)
inline

Release Fragments from the RawEvent.

Parameters
typeThe type of Fragments to release
Returns
A pointer to a Fragments object (owns the Fragment data contained)

Release the Fragments from this RawEvent with the specified fragment type, returning them to the caller through a unique_ptr that manages a vector into which the Fragments have been moved. PLEASE NOTE that releaseProduct and releaseProduct(type_t) can not both be used on the same RawEvent since each one gives up ownership of the fragments within the event.

Definition at line 261 of file RawEvent.hh.

RawEvent::run_id_t artdaq::RawEvent::runID ( ) const
inline

Retrieve the run number from the RawEventHeader.

Returns
The run number stored in the RawEventHeader

Definition at line 219 of file RawEvent.hh.

RawEvent::sequence_id_t artdaq::RawEvent::sequenceID ( ) const
inline

Retrieve the sequence id from the RawEventHeader.

Returns
The sequence id stored in the RawEventHeader

Definition at line 221 of file RawEvent.hh.

RawEvent::subrun_id_t artdaq::RawEvent::subrunID ( ) const
inline

Retrieve the subrun number from the RawEventHeader.

Returns
The subrun number stored in the RawEventHeader

Definition at line 220 of file RawEvent.hh.

size_t artdaq::RawEvent::wordCount ( ) const
inline

Return the sum of the word counts of all fragments in this RawEvent.

Returns
The sum of the word counts of all Fragment objects in this RawEvent

Definition at line 212 of file RawEvent.hh.


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