30 auto mf =
reinterpret_cast<DataFrame *
>(data);
32 data =
reinterpret_cast<Int_t *
>(&(mf->hits));
33 auto frameTime = mf->header.frameTime;
34 while (total_size > 0) {
35 auto df =
reinterpret_cast<DataFrame *
>(data);
36 Int_t size = df->header.size;
37 uint16_t partitionId = df->header.partitionId;
38 LOG(DEBUG) <<
"ShipTdcSource: PartitionId " << std::hex << partitionId << std::dec;
39 if (!
Unpack(data, size, partitionId)) {
40 LOG(WARNING) <<
"ShipTdcSource: Failed to Unpack.";
41 LOG(WARNING) <<
"ShipTdcSource: Maybe missing unpacker for PartitionId " << std::hex << partitionId << std::dec;
44 data += size /
sizeof(Int_t);
47 assert(total_size == 0);
48 return (frameTime ==
EoS) ? 1 : 0;
54 if (!
fIn->ReadBuffer(
reinterpret_cast<char *
>(df),
sizeof(
DataFrame))) {
55 size_t size = df->header.size;
56 auto frameTime = df->header.frameTime;
57 uint16_t partitionId = df->header.partitionId;
58 if (!
fIn->ReadBuffer(
reinterpret_cast<char *
>(df->hits), size -
sizeof(
DataFrame))) {
60 case SoS: LOG(INFO) <<
"ShipTdcSource: SoS frame.";
return 2;
61 case EoS: LOG(INFO) <<
"ShipTdcSource: EoS frame.";
break;
65 if (partitionId == 0x8000) {
66 LOG(DEBUG) <<
"ShipTdcSource: Event builder meta frame.";
68 LOG(WARNING) <<
"Late event:";
69 for (
int i = 0; i < size; i++) {
72 }
else if (i % 16 == 0) {
75 std::cout << std::hex << +
buffer[i] << std::dec;
77 std::cout << std::endl;
81 LOG(DEBUG) <<
"ShipTdcSource: PartitionId " << std::hex << partitionId << std::dec;
83 if (
Unpack(
reinterpret_cast<Int_t *
>(&
buffer), size, partitionId)) {
84 return (frameTime ==
EoS) ? 1 : 0;
86 LOG(WARNING) <<
"ShipTdcSource: Failed to Unpack.";
87 LOG(WARNING) <<
"ShipTdcSource: Maybe missing unpacker for PartitionId " << std::hex << partitionId << std::dec;
90 LOG(WARNING) <<
"ShipTdcSource: Failed to read hits.";