|
LDMX Software
|
the header that the LDMX DAQ Firmware block includes in the output data stream at the beginning of each data frame More...
#include <LDMXRoRHeader.h>
Public Member Functions | |
| utility::Reader & | read (utility::Reader &r) |
| read the next LDMX RoR header into memory | |
| bool | valid () const |
| true if the header was parsed successfully (sentinel matched and the unused flag bits are zero) | |
| uint32_t | flags () const |
| flags set by the DAQ event formatter | |
| bool | dataDropped () const |
| true if the formatter dropped this fragment's data (header only) | |
| uint8_t | lostBefore () const |
| number of readout requests lost before this one, saturates at 255 | |
| uint8_t | version () const |
| version of LDMX data (should be zero) | |
| uint8_t | subsystem () const |
| ID number for subsystem originating data (compiled into firmware) | |
| uint8_t | contributor () const |
| ID number for contributor within subsystem (configured into firmware) | |
| uint64_t | timestamp () const |
| get timestamp of this RoR | |
Static Public Member Functions | |
| static std::tuple< int, int > | subsystem (const std::string &name) |
| Get the (subsystem, contributor) pair for the input subsystem name. | |
| static std::string | getSubsystemName (uint8_t subsystem_id, uint8_t contributor_id) |
| Get the subsystem name from subsystem and contributor IDs. | |
Static Public Attributes | |
| static const unsigned int | SIZE = 16 |
| size of this header in bytes | |
| static const std::unordered_map< std::string, int > | SUBSYSTEM_ID |
| The subsystem ID numbers organized by subsystem name. | |
| static const std::unordered_map< std::string, int > | CONTRIBUTOR_ID |
| The contributor ID is a configurable parameter of the DAQ firmware. | |
| static constexpr uint32_t | FLAG_DATA_DROPPED {0x1} |
| header-only fragment, see flags() | |
Private Attributes | |
| bool | valid_ {false} |
| set to true only when all validity checks pass during read() | |
| uint8_t | version_ |
| version of LDMX data (should be zero) | |
| uint8_t | subsystem_ |
| ID number for subsystem originating data (compiled into firmware) | |
| uint8_t | contributor_ |
| ID number for contributor within subsystem (configured into firmware) | |
| uint32_t | flags_ {0} |
| formatter flags, see flags() | |
| uint64_t | timestamp_ |
| timestamp of this Readout-Request (RoR) | |
Static Private Attributes | |
| static constexpr uint32_t | FLAG_MASK {0xff07} |
| flag bits in use, the others must be zero | |
the header that the LDMX DAQ Firmware block includes in the output data stream at the beginning of each data frame
This header is immediately preceeded by a RogueFrameHeader for data frames. It is separate only becuase some frames written to the file (mainly, the configuration stream) do not include this header as well as the RogueFrameHeader.
Definition at line 21 of file LDMXRoRHeader.h.
|
inline |
ID number for contributor within subsystem (configured into firmware)
Definition at line 108 of file LDMXRoRHeader.h.
References contributor_.
Referenced by eventbuilder::EventBuilder::produce().
|
inline |
true if the formatter dropped this fragment's data (header only)
Definition at line 100 of file LDMXRoRHeader.h.
References FLAG_DATA_DROPPED, and flags_.
|
inline |
flags set by the DAQ event formatter
bit 0: data dropped (busy), header-only fragment bit 1: raw data buffer overflow bit 2: bookkeeping error bits 8-15: readout requests lost before this one (no fragment at all), saturates at 255
Definition at line 96 of file LDMXRoRHeader.h.
References flags_.
Referenced by eventbuilder::EventBuilder::produce().
|
static |
Get the subsystem name from subsystem and contributor IDs.
Uses both the subsystem ID (compiled into firmware) and contributor ID (configured into firmware) to uniquely identify the subsystem. This is necessary because some subsystems share the same subsystem ID but have different contributor IDs (e.g., ecal and hcal both use subsystem ID 5 but have different contributor IDs at ESA25). The ESA26 HCal (subsystem 7, contributor 20) is named hcal as well.
| [in] | subsystem_id | the subsystem ID from the RoR header |
| [in] | contributor_id | the contributor ID from the RoR header |
Definition at line 29 of file LDMXRoRHeader.cxx.
References CONTRIBUTOR_ID, and SUBSYSTEM_ID.
Referenced by eventbuilder::EventBuilder::produce().
|
inline |
number of readout requests lost before this one, saturates at 255
Definition at line 102 of file LDMXRoRHeader.h.
References flags_.
| utility::Reader & packing::LDMXRoRHeader::read | ( | utility::Reader & | r | ) |
read the next LDMX RoR header into memory
Definition at line 64 of file LDMXRoRHeader.cxx.
References contributor_, FLAG_MASK, flags_, subsystem_, timestamp_, valid_, and version_.
Referenced by eventbuilder::EventBuilder::produce().
|
inline |
ID number for subsystem originating data (compiled into firmware)
Definition at line 106 of file LDMXRoRHeader.h.
References subsystem_.
Referenced by packing::SingleSubsystemUnpacker::configure().
|
static |
Get the (subsystem, contributor) pair for the input subsystem name.
| [in] | name | subsystem name ('tdaq','ts','tracker','hcal','ecal') |
Definition at line 15 of file LDMXRoRHeader.cxx.
References CONTRIBUTOR_ID, and SUBSYSTEM_ID.
Referenced by eventbuilder::EventBuilder::produce().
|
inline |
get timestamp of this RoR
Definition at line 110 of file LDMXRoRHeader.h.
References timestamp_.
Referenced by eventbuilder::EventBuilder::produce(), and packing::SingleSubsystemUnpacker::produce().
|
inline |
true if the header was parsed successfully (sentinel matched and the unused flag bits are zero)
Definition at line 86 of file LDMXRoRHeader.h.
References valid_.
Referenced by eventbuilder::EventBuilder::produce().
|
inline |
version of LDMX data (should be zero)
Definition at line 104 of file LDMXRoRHeader.h.
References version_.
|
private |
ID number for contributor within subsystem (configured into firmware)
Definition at line 120 of file LDMXRoRHeader.h.
Referenced by contributor(), and read().
|
static |
The contributor ID is a configurable parameter of the DAQ firmware.
For the 2025 slice test at SLAC, there was only ever one contributor per subsystem and so there is just one integer per subsystem here. (-1 means that it was not set and can be ignored).
In the future, there will be more than one contributor for some subsystems.
The subsystem names are all lower case.
Definition at line 48 of file LDMXRoRHeader.h.
Referenced by getSubsystemName(), and subsystem().
|
staticconstexpr |
header-only fragment, see flags()
Definition at line 98 of file LDMXRoRHeader.h.
Referenced by dataDropped(), and eventbuilder::EventBuilder::produce().
|
staticconstexprprivate |
flag bits in use, the others must be zero
Definition at line 124 of file LDMXRoRHeader.h.
Referenced by read().
|
private |
formatter flags, see flags()
Definition at line 122 of file LDMXRoRHeader.h.
Referenced by dataDropped(), flags(), lostBefore(), and read().
|
static |
size of this header in bytes
Definition at line 24 of file LDMXRoRHeader.h.
Referenced by packing::SingleSubsystemUnpacker::produce().
|
private |
ID number for subsystem originating data (compiled into firmware)
Definition at line 118 of file LDMXRoRHeader.h.
Referenced by read(), and subsystem().
|
static |
The subsystem ID numbers organized by subsystem name.
These ID numbers are compiled into the DAQ firmware. Since the same firmware was used for both the ECal and HCal, they both ended up having the same subsystem ID (5).
The subsystem names are all lower case.
Definition at line 34 of file LDMXRoRHeader.h.
Referenced by getSubsystemName(), and subsystem().
|
private |
timestamp of this Readout-Request (RoR)
It is some combination of pulseID and bunchCount, but I'm unsure on how to decompose those at this time.
Definition at line 132 of file LDMXRoRHeader.h.
Referenced by read(), and timestamp().
|
private |
set to true only when all validity checks pass during read()
Definition at line 114 of file LDMXRoRHeader.h.
|
private |
version of LDMX data (should be zero)
Definition at line 116 of file LDMXRoRHeader.h.