pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
LinkPacket.h
1#ifndef pflib_decoding_LinkPacket_h
2#define pflib_decoding_LinkPacket_h 1
3
4#include <stdint.h>
5
6namespace pflib {
7namespace decoding {
8
20 public:
24 LinkPacket(const uint32_t* header_ptr, int len);
25
31 int linkid() const;
32
38 int crc() const;
39
45 int bxid() const;
46
52 int wadd() const;
53
58 int length() const;
59
67 bool good_bxheader() const;
68
76 bool good_idle() const;
77
86 bool has_chan(int ichan) const;
87
93 int get_tot(int ichan) const;
94
100 int get_toa(int ichan) const;
101
107 int get_adc(int ichan) const;
108
112 void dump() const;
113
114 private:
122 int offset_to_chan(int ichan) const;
124 const uint32_t* data_;
127}; // LinkPacket
128
129} // namespace decoding
130} // namespace pflib
131
132#endif// pflib_decoding_LinkPacket_h
133
smallest formatted packet being readout by the HGCROC-Polarfire pipeline
Definition: LinkPacket.h:19
bool has_chan(int ichan) const
Check if a channel exists by attempting to comput its offset.
Definition: LinkPacket.cxx:44
int get_adc(int ichan) const
Get the decoded ADC value for the input channel.
Definition: LinkPacket.cxx:60
int get_toa(int ichan) const
Get the decoded TOA value for the input channel.
Definition: LinkPacket.cxx:54
int offset_to_chan(int ichan) const
Calculate the offset to a specific channel index by referencing the readout map for this link packet.
Definition: LinkPacket.cxx:74
LinkPacket(const uint32_t *header_ptr, int len)
Wrap the input C-style array as a LinkPacket.
Definition: LinkPacket.cxx:7
const uint32_t * data_
handle to zero'th entry in data array we are wrapping
Definition: LinkPacket.h:124
int get_tot(int ichan) const
Get the decoded TOT value for the input channel.
Definition: LinkPacket.cxx:48
int wadd() const
Get the WADD as reported by the HGC ROC reading out this link.
Definition: LinkPacket.cxx:25
int bxid() const
Get the BX ID as reported by the HGC ROC reading out this link.
Definition: LinkPacket.cxx:20
bool good_idle() const
Check if this link has a good trailing idle.
Definition: LinkPacket.cxx:39
int crc() const
Get the CRC checksum for this link.
Definition: LinkPacket.cxx:15
int linkid() const
Get the link ID for this link.
Definition: LinkPacket.cxx:10
bool good_bxheader() const
Check if this link has a good BX header.
Definition: LinkPacket.cxx:34
void dump() const
Print human-readable/decoded link packet to terminal.
Definition: LinkPacket.cxx:66
int length() const
Get the length of this link packet.
Definition: LinkPacket.cxx:30
int length_
length of data array we have wrapped
Definition: LinkPacket.h:126
Polarfire Interaction Library.
Definition: Backend.h:8