pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
|
Decoding of entire "super packet" which holds multiple polarfire packets - one for each sample in an event. More...
#include <SuperPacket.h>
Public Member Functions | |
SuperPacket (const uint32_t *header_ptr, int len) | |
Wrap the input data array and search for the header. More... | |
int | length64 () const |
Length of this packet in 64-bit words. More... | |
int | length32 () const |
Length of this packet in 32-bit words. More... | |
int | fpgaid () const |
Get polarfire fpga id for this super packet. More... | |
int | nsamples () const |
Get the number of samples within this packet. More... | |
int | formatversion () const |
Get the format version stored within this packet. More... | |
int | event_tag_length () const |
Get the length of the event tag. More... | |
int | spill () const |
Get the spill this packet was for. More... | |
int | bxid () const |
Get the BX id this packet was for. More... | |
uint32_t | time_in_spill () const |
Get the time in 5MHz counts since spill begun. More... | |
uint32_t | eventid () const |
Get local event ID for this packet. More... | |
int | runid () const |
Get run ID for this packet. More... | |
void | run_start (int &month, int &day, int &hour, int &minute) |
Set the run start timestamp for this packet. More... | |
int | length32_for_sample (int isample) const |
Get length of an individual sample in this packet. More... | |
PolarfirePacket | sample (int isample) const |
Get a specific sample from this packet, wrapping with our decoding class. More... | |
int | offset_to_header () const |
Get the offset between the input pointer to the constructor and the start of the packet. More... | |
Decoding of entire "super packet" which holds multiple polarfire packets - one for each sample in an event.
This class handles replicating the behavior described in Appendix A and B in the HGCROC Data Formats manual.
pflib::decoding::SuperPacket::SuperPacket | ( | const uint32_t * | header_ptr, |
int | len | ||
) |
Wrap the input data array and search for the header.
The header word allows us to deduce the format version. Decrement the length and increment the header pointer until the header words is found so that it aligns with the index i in the Appendix tables.
[in] | header_ptr | start of data array |
[in] | len | length of data array |
int pflib::decoding::SuperPacket::bxid | ( | ) | const |
Get the BX id this packet was for.
int pflib::decoding::SuperPacket::event_tag_length | ( | ) | const |
Get the length of the event tag.
uint32_t pflib::decoding::SuperPacket::eventid | ( | ) | const |
Get local event ID for this packet.
int pflib::decoding::SuperPacket::formatversion | ( | ) | const |
Get the format version stored within this packet.
int pflib::decoding::SuperPacket::fpgaid | ( | ) | const |
Get polarfire fpga id for this super packet.
int pflib::decoding::SuperPacket::length32 | ( | ) | const |
Length of this packet in 32-bit words.
int pflib::decoding::SuperPacket::length32_for_sample | ( | int | isample | ) | const |
Get length of an individual sample in this packet.
[in] | isample | sample index within this packet |
int pflib::decoding::SuperPacket::length64 | ( | ) | const |
Length of this packet in 64-bit words.
int pflib::decoding::SuperPacket::nsamples | ( | ) | const |
Get the number of samples within this packet.
|
inline |
Get the offset between the input pointer to the constructor and the start of the packet.
void pflib::decoding::SuperPacket::run_start | ( | int & | month, |
int & | day, | ||
int & | hour, | ||
int & | minute | ||
) |
Set the run start timestamp for this packet.
[out] | month | run start month, unmodified if unavailable |
[out] | day | run start day, unmodified if unavailable |
[out] | hour | run start hour, unmodified if unavailable |
[out] | minute | run start minute, unmodified if unavailable |
int pflib::decoding::SuperPacket::runid | ( | ) | const |
Get run ID for this packet.
PolarfirePacket pflib::decoding::SuperPacket::sample | ( | int | isample | ) | const |
Get a specific sample from this packet, wrapping with our decoding class.
[in] | isample | sample index within this packet |
int pflib::decoding::SuperPacket::spill | ( | ) | const |
Get the spill this packet was for.
uint32_t pflib::decoding::SuperPacket::time_in_spill | ( | ) | const |
Get the time in 5MHz counts since spill begun.