33 memcpy(
data, _data, 24);
40 std::vector<unsigned char> channels;
42 for (
int i = 0;
i < 8;
i++)
51 for (mask = 1 << 15, offset = 15;
mask; mask >>= 1, offset--)
53 if (
data[1 +
i] & mask)
54 channels.push_back(
i * 16 + offset );
90 word crc_fin = 0xffff;
92 for (
int i = 11;
i >= 1;
i--)
95 return (crc_fin ==
data[0]);
105 word crc_temp = crc_in;
106 unsigned char datalen = 16;
108 for (
int i = 0;
i < datalen;
i++)
115 if ((crc_temp & mask)^d)
116 crc_temp = crc_temp>>1 ^ 0x8408;
118 crc_temp = crc_temp>>1;
132 for (
int i = 0;
i < 12;
i++)
136 for (
int j = 0; j < 16; j++)
143 if ((j + 1) % 4 == 0)
152 printf(
"( OK), footprint ");
154 printf(
"(FAIL), footprint ");
161 printf(
", frame = %04x|%04x|%04x|",
data[11],
data[10],
data[9]);
162 for (
int i = 8;
i > 0;
i--)
163 printf(
"%04x",
data[
i]);
164 printf(
"|%04x",
data[0]);
VFATFrame::word getFlags() const
Returns flags.
VFATFrame::word getBC() const
Returns Bunch Crossing number (BC<11:0>).
bool checkFootprint() const
virtual bool checkCRC() const
bool isECPresent() const
Returns true if the EC word is present in the frame.
uint8_t daqErrorFlags
Error flag as given by certain versions of DAQ.
void Print(bool binary=false) const
VFATFrame::word getCRC() const
Returns the CRC.
VFATFrame::word getEC() const
Returns Event Counter (EV<7:0>).
bool isBCPresent() const
Returns true if the BC word is present in the frame.
static word calculateCRC(word crc_in, word dato)
internaly used to check CRC
bool isIDPresent() const
Returns true if the ID word is present in the frame.
VFATFrame::word getChipID() const
Returns ChipID (ChipID<11:0>).
virtual std::vector< unsigned char > getActiveChannels() const
void setData(const word *_data)
Copies a memory block to data buffer.
VFATFrame(const word *_data=nullptr)
bool isCRCPresent() const
Returns true if the CRC word is present in the frame.