$treeview $search $mathjax $extrastylesheet
artdaq_core
v3_06_01
$projectbrief
|
$projectbrief
|
$searchbox |
The RawFragmentHeader class contains the basic fields used by _artdaq_ for routing Fragment objects through the system. More...
#include <artdaq-core/Data/detail/RawFragmentHeader.hh>
Public Types | |
typedef unsigned long long | RawDataType |
The RawDataType (currently an unsigned long long) is the basic unit of data representation within _artdaq_. | |
typedef uint16_t | version_t |
version field is 16 bits | |
typedef uint64_t | sequence_id_t |
sequence_id field is 48 bits | |
typedef uint8_t | type_t |
type field is 8 bits | |
typedef uint16_t | fragment_id_t |
fragment_id field is 16 bits | |
typedef uint8_t | metadata_word_count_t |
metadata_word_count field is 8 bits | |
typedef uint64_t | timestamp_t |
timestamp field is 32 bits | |
Public Member Functions | |
void | setUserType (uint8_t utype) |
Sets the type field to the specified user type. | |
void | setSystemType (uint8_t stype) |
Sets the type field to the specified system type. | |
void | touch () |
Update the atime fields of the RawFragmentHeader to current time. | |
struct timespec | atime () const |
Get the last access time of this RawFragmentHeader. | |
struct timespec | getLatency (bool touch) |
Get the elapsed time between now and the last access time of the RawFragmentHeader, optionally resetting it. | |
Static Public Member Functions | |
static std::map< type_t, std::string > | MakeSystemTypeMap () |
Returns a map of the most-commonly used system types. | |
static std::map< type_t, std::string > | MakeVerboseSystemTypeMap () |
Returns a map of all system types. | |
static std::string | SystemTypeToString (type_t type) |
Print a system type's string name. | |
static constexpr std::size_t | num_words () |
Returns the number of RawDataType words present in the header. | |
Public Attributes | |
RawDataType | word_count: 32 |
number of RawDataType words in this Fragment | |
RawDataType | version: 16 |
The version of the fragment. | |
RawDataType | type: 8 |
The type of the fragment, either system or user-defined. | |
RawDataType | metadata_word_count: 8 |
The number of RawDataType words in the user-defined metadata. | |
RawDataType | sequence_id: 48 |
The 48-bit sequence_id uniquely identifies events within the _artdaq_ system. | |
RawDataType | fragment_id: 16 |
The fragment_id uniquely identifies a particular piece of hardware within the _artdaq_ system. | |
RawDataType | timestamp: 64 |
The 64-bit timestamp field is the output of a user-defined clock used for building time-correlated events. | |
RawDataType | valid: 1 |
Flag for whether the Fragment has been transported correctly through the artdaq system. | |
RawDataType | complete: 1 |
Flag for whether the Fragment completely represents an event for its hardware. | |
RawDataType | atime_ns: 30 |
Last access time of the Fragment, nanosecond part. | |
RawDataType | atime_s: 32 |
Last access time of the Fragment, second part (measured from epoch). | |
Static Public Attributes | |
static constexpr type_t | INVALID_TYPE = 0 |
Marks a Fragment as Invalid. | |
static constexpr type_t | FIRST_USER_TYPE = 1 |
The first user-accessible type. | |
static constexpr type_t | LAST_USER_TYPE = 224 |
The last user-accessible type (types above this number are system types. | |
static constexpr type_t | FIRST_SYSTEM_TYPE = 225 |
The first system type. | |
static constexpr type_t | LAST_SYSTEM_TYPE = 255 |
The last system type. | |
static constexpr type_t | InvalidFragmentType = INVALID_TYPE |
Marks a Fragment as Invalid. | |
static constexpr type_t | EndOfDataFragmentType = FIRST_SYSTEM_TYPE |
This Fragment indicates the end of data to _art_. | |
static constexpr type_t | DataFragmentType = FIRST_SYSTEM_TYPE + 1 |
This Fragment holds data. Used for RawEvent Fragments sent from the EventBuilder to the Aggregator. | |
static constexpr type_t | InitFragmentType = FIRST_SYSTEM_TYPE + 2 |
This Fragment holds the necessary data for initializing _art_. | |
static constexpr type_t | EndOfRunFragmentType = FIRST_SYSTEM_TYPE + 3 |
This Fragment indicates the end of a run to _art_. | |
static constexpr type_t | EndOfSubrunFragmentType = FIRST_SYSTEM_TYPE + 4 |
This Fragment indicates the end of a subrun to _art_. | |
static constexpr type_t | ShutdownFragmentType = FIRST_SYSTEM_TYPE + 5 |
This Fragment indicates a system shutdown to _art_. | |
static constexpr type_t | EmptyFragmentType = FIRST_SYSTEM_TYPE + 6 |
This Fragment contains no data and serves as a placeholder for when no data from a FragmentGenerator is expected. | |
static constexpr type_t | ContainerFragmentType = FIRST_SYSTEM_TYPE + 7 |
This Fragment is a ContainerFragment and analysis code should unpack it. | |
static constexpr type_t | ErrorFragmentType = FIRST_SYSTEM_TYPE + 8 |
This Fragment has experienced some error, and no attempt should be made to read it. | |
static const version_t | InvalidVersion = 0xFFFF |
The version field is currently 16-bits. | |
static const version_t | CurrentVersion = 0x2 |
The CurrentVersion field should be incremented whenever the RawFragmentHeader changes. | |
static const sequence_id_t | InvalidSequenceID = 0xFFFFFFFFFFFF |
The sequence_id field is currently 48-bits. | |
static const fragment_id_t | InvalidFragmentID = 0xFFFF |
The fragment_id field is currently 16-bits. | |
static const timestamp_t | InvalidTimestamp = 0xFFFFFFFFFFFFFFFF |
The timestamp field is currently 64-bits. |
The RawFragmentHeader class contains the basic fields used by _artdaq_ for routing Fragment objects through the system.
The RawFragmentHeader class contains the basic fields used by _artdaq_ for routing Fragment objects through the system. It also contains static value definitions of values used in those fields.
Definition at line 31 of file RawFragmentHeader.hh.
typedef unsigned long long artdaq::detail::RawFragmentHeader::RawDataType |
The RawDataType (currently an unsigned long long) is the basic unit of data representation within _artdaq_.
ELF, 7/30/2020: This typedef apparently cannot be changed without breaking compatibility with older data files. I have tried and failed to deal with such a change in classes_def.xml.
Definition at line 39 of file RawFragmentHeader.hh.
struct timespec artdaq::detail::RawFragmentHeader::atime | ( | ) | const [read] |
Get the last access time of this RawFragmentHeader.
Definition at line 244 of file RawFragmentHeader.hh.
struct timespec artdaq::detail::RawFragmentHeader::getLatency | ( | bool | touch | ) | [read] |
Get the elapsed time between now and the last access time of the RawFragmentHeader, optionally resetting it.
touch | Whether to also update the access time to current time |
Definition at line 252 of file RawFragmentHeader.hh.
static std::map<type_t, std::string> artdaq::detail::RawFragmentHeader::MakeSystemTypeMap | ( | ) | [inline, static] |
Returns a map of the most-commonly used system types.
Definition at line 70 of file RawFragmentHeader.hh.
static std::map<type_t, std::string> artdaq::detail::RawFragmentHeader::MakeVerboseSystemTypeMap | ( | ) | [inline, static] |
Returns a map of all system types.
Definition at line 84 of file RawFragmentHeader.hh.
constexpr std::size_t artdaq::detail::RawFragmentHeader::num_words | ( | ) | [inline, static] |
Returns the number of RawDataType words present in the header.
Definition at line 199 of file RawFragmentHeader.hh.
void artdaq::detail::RawFragmentHeader::setSystemType | ( | uint8_t | stype | ) | [inline] |
Sets the type field to the specified system type.
stype | The type code to set |
cet::exception | if stype is not in the allowed range for system types |
Definition at line 226 of file RawFragmentHeader.hh.
void artdaq::detail::RawFragmentHeader::setUserType | ( | uint8_t | utype | ) | [inline] |
Sets the type field to the specified user type.
utype | The type code to set |
cet::exception | if utype is not in the allowed range for user types |
Definition at line 213 of file RawFragmentHeader.hh.
static std::string artdaq::detail::RawFragmentHeader::SystemTypeToString | ( | type_t | type | ) | [inline, static] |
Print a system type's string name.
type | Type to print |
Definition at line 102 of file RawFragmentHeader.hh.