Skip to content

Commit 7ea089a

Browse files
author
cramonal
committed
git checks
1 parent efbb0f7 commit 7ea089a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

EventFilter/HGCalRawToDigi/interface/UnpackerTools.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace hgcal {
1010
@short this function re-computes the CRC of the ECON-D packet and compares it with the trailer of the packet
1111
false is returned if there is a mismatch
1212
*/
13-
bool econdCRCAnalysis(const uint64_t *header, const uint32_t pos, const uint32_t payloadLength) ;
13+
bool econdCRCAnalysis(const uint64_t *header, const uint32_t pos, const uint32_t payloadLength);
1414

1515
} // namespace hgcal
1616

EventFilter/HGCalRawToDigi/src/UnpackerTools.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@ bool hgcal::econdCRCAnalysis(const uint64_t *header, const uint32_t pos, const u
2525
//Compute CRC using all eRx subpackets but not the event paket header (two first words)
2626
std::vector<uint32_t> crcvec(data32b.begin() + 2, data32b.end() - 1);
2727
std::transform(crcvec.begin(), crcvec.end(), crcvec.begin(), [](uint32_t w) {
28-
return ((w << 24) & 0xFF000000) | ((w << 8) & 0x00FF0000) | ((w >> 8) & 0x0000FF00) | ((w >> 24) & 0x000000FF); //swapping endianness
28+
return ((w << 24) & 0xFF000000) | ((w << 8) & 0x00FF0000) | ((w >> 8) & 0x0000FF00) |
29+
((w >> 24) & 0x000000FF); //swapping endianness
2930
});
3031

3132
auto array = &(crcvec[0]);
3233
auto bytes = reinterpret_cast<const unsigned char *>(array);
33-
auto crc32 = boost::crc<32, hgcal::ECOND_FRAME::CRC_POL, hgcal::ECOND_FRAME::CRC_INITREM, hgcal::ECOND_FRAME::CRC_FINALXOR, false, false>(bytes, (payloadLength - 1) * 4); //32-bit words, hence need to parse 4 bytes
34+
auto crc32 = boost::crc<32,
35+
hgcal::ECOND_FRAME::CRC_POL,
36+
hgcal::ECOND_FRAME::CRC_INITREM,
37+
hgcal::ECOND_FRAME::CRC_FINALXOR,
38+
false,
39+
false>(bytes, (payloadLength - 1) * 4); //32-bit words, hence need to parse 4 bytes
3440

3541
return crc32 == target;
3642
}

0 commit comments

Comments
 (0)