pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
SuperPacket.h
1#ifndef pflib_decoding_SuperPacket_h
2#define pflib_decoding_SuperPacket_h 1
3
4#include "pflib/decoding/PolarfirePacket.h"
5
6namespace pflib {
7namespace decoding {
8
21 public:
33 SuperPacket(const uint32_t* header_ptr, int len);
34
40 int length64() const;
41
46 int length32() const;
47
52 int fpgaid() const;
53
58 int nsamples() const;
59
64 int formatversion() const;
65
71 int event_tag_length() const;
72
78 int spill() const;
79
85 int bxid() const;
86
91 uint32_t time_in_spill() const;
92
97 uint32_t eventid() const;
98
103 int runid() const;
104
112 void run_start(int& month, int& day, int& hour, int& minute);
113
119 int length32_for_sample(int isample) const;
120
126 PolarfirePacket sample(int isample) const;
127
133 int offset_to_header() const { return offset_; }
134 private:
136 const uint32_t* data_;
143};
144
145}
146}
147
148#endif// pflib_decoding_PolarfirePacket_h
149
wrap the encoded binary data readout by a single polarfire
Definition: PolarfirePacket.h:16
Decoding of entire "super packet" which holds multiple polarfire packets - one for each sample in an ...
Definition: SuperPacket.h:20
int length32() const
Length of this packet in 32-bit words.
Definition: SuperPacket.cxx:26
int length_
length of packet
Definition: SuperPacket.h:138
int version_
format version of packet, deduced from header word
Definition: SuperPacket.h:140
int fpgaid() const
Get polarfire fpga id for this super packet.
Definition: SuperPacket.cxx:32
uint32_t time_in_spill() const
Get the time in 5MHz counts since spill begun.
Definition: SuperPacket.cxx:64
int spill() const
Get the spill this packet was for.
Definition: SuperPacket.cxx:56
int nsamples() const
Get the number of samples within this packet.
Definition: SuperPacket.cxx:37
const uint32_t * data_
pointer to beginning of packet
Definition: SuperPacket.h:136
int formatversion() const
Get the format version stored within this packet.
Definition: SuperPacket.cxx:42
int length32_for_sample(int isample) const
Get length of an individual sample in this packet.
Definition: SuperPacket.cxx:47
int bxid() const
Get the BX id this packet was for.
Definition: SuperPacket.cxx:60
void run_start(int &month, int &day, int &hour, int &minute)
Set the run start timestamp for this packet.
Definition: SuperPacket.cxx:76
int offset_
offset between input data array pointer and beginning of packet
Definition: SuperPacket.h:142
SuperPacket(const uint32_t *header_ptr, int len)
Wrap the input data array and search for the header.
Definition: SuperPacket.cxx:7
int length64() const
Length of this packet in 64-bit words.
Definition: SuperPacket.cxx:25
int offset_to_header() const
Get the offset between the input pointer to the constructor and the start of the packet.
Definition: SuperPacket.h:133
int event_tag_length() const
Get the length of the event tag.
Definition: SuperPacket.cxx:52
uint32_t eventid() const
Get local event ID for this packet.
Definition: SuperPacket.cxx:68
PolarfirePacket sample(int isample) const
Get a specific sample from this packet, wrapping with our decoding class.
Definition: SuperPacket.cxx:85
int runid() const
Get run ID for this packet.
Definition: SuperPacket.cxx:72
Polarfire Interaction Library.
Definition: Backend.h:8