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>

List of all members.

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

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:
run The current Run number
subrun The current Subrun number
event The current sequence_id

Definition at line 178 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_list Any Fragment types not included in this list will be added

Definition at line 234 of file RawEvent.hh.

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

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

Parameters:
pfrag The FragmentPtr to insert into the RawEvent
Exceptions:
cet::exception if 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 184 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 213 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 197 of file RawEvent.hh.

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

Print summary information about this RawEvent to the given stream.

Parameters:
os The target stream for summary information

Definition at line 6 of file RawEvent.cc.

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

Release Fragments from the RawEvent.

Parameters:
type The 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 252 of file RawEvent.hh.

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 216 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 210 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 212 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 211 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 203 of file RawEvent.hh.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on 7 Aug 2017 for artdaq_core by  doxygen 1.6.1