Go to the documentation of this file.
32 for (
int i = 0;
i < 8;
i++) {
40 for (mask = 1 << 15,
offset = 15; mask; mask >>= 1,
offset--) {
41 if (
data[1 +
i] & mask)
72 word crc_fin = 0xffff;
74 for (
int i = 11;
i >= 1;
i--)
77 return (crc_fin ==
data[0]);
84 word crc_temp = crc_in;
85 unsigned char datalen = 16;
87 for (
int i = 0;
i < datalen;
i++) {
93 if ((crc_temp & mask) ^
d)
94 crc_temp = crc_temp >> 1 ^ 0x8408;
96 crc_temp = crc_temp >> 1;
106 for (
int i = 0;
i < 12;
i++) {
108 word mask = (1 << 15);
109 for (
int j = 0;
j < 16;
j++) {
115 if ((
j + 1) % 4 == 0)
121 printf(
"ID = %03x, BC = %04u, EC = %03u, flags = %2u, CRC = %04x ",
129 printf(
"( OK), footprint ");
131 printf(
"(FAIL), footprint ");
138 printf(
", frame = %04x|%04x|%04x|",
data[11],
data[10],
data[9]);
139 for (
int i = 8;
i > 0;
i--)
140 printf(
"%04x",
data[
i]);
141 printf(
"|%04x",
data[0]);
VFATFrame(const word *_data=nullptr)
virtual bool checkCRC() const
bool checkFootprint() const
void Print(bool binary=false) const
bool isCRCPresent() const
Returns true if the CRC word is present in the frame.
virtual std::vector< unsigned char > getActiveChannels() const
VFATFrame::word getFlags() const
Returns flags.
VFATFrame::word getBC() const
Returns Bunch Crossing number (BC<11:0>).
bool isBCPresent() const
Returns true if the BC word is present in the frame.
VFATFrame::word getChipID() const
Returns ChipID (ChipID<11:0>).
VFATFrame::word getCRC() const
Returns the CRC.
bool isECPresent() const
Returns true if the EC word is present in the frame.
VFATFrame::word getEC() const
Returns Event Counter (EV<7:0>).
bool isIDPresent() const
Returns true if the ID word is present in the frame.
static word calculateCRC(word crc_in, word dato)
internaly used to check CRC
uint8_t daqErrorFlags
Error flag as given by certain versions of DAQ.
void setData(const word *_data)
Copies a memory block to data buffer.