Skip to content

Commit

Permalink
ALIROOT-5420 ALIROOT-5683 Fixes in CheckData to take into account the…
Browse files Browse the repository at this point in the history
… possibility for CHD v2 and v3
  • Loading branch information
hristov authored and hristov committed Dec 11, 2014
1 parent 8139400 commit bc16e84
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 15 deletions.
30 changes: 23 additions & 7 deletions RAW/AliRawReaderDate.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -537,16 +537,32 @@ Int_t AliRawReaderDate::CheckData() const
continue;
}

// Here we have to check if we have header v2 or v3
// check consistency of data size in the data header and in the sub event
AliRawDataHeader* header = (AliRawDataHeader*) position;
if ((position + header->fSize) != end) {
if (header->fSize != 0xFFFFFFFF)
Warning("ReadHeader",
"raw data size found in the header is wrong (%d != %ld)! Using the equipment size instead !",
header->fSize, end - position);
header->fSize = end - position;
result |= kErrSize;
UChar_t version = header->GetVersion();
if (version==2) {
if ((position + header->fSize) != end) {
if (header->fSize != 0xFFFFFFFF)
Warning("CheckData",
"raw data size found in the header V2 is wrong (%d != %ld)! Using the equipment size instead !",
header->fSize, end - position);
header->fSize = end - position;
result |= kErrSize;
}
}
else if (version==3) {
AliRawDataHeaderV3 * headerV3 = (AliRawDataHeaderV3*) position;
if ((position + headerV3->fSize) != end) {
if (headerV3->fSize != 0xFFFFFFFF)
Warning("CheckData",
"raw data size found in the header V3 is wrong (%d != %ld)! Using the equipment size instead !",
headerV3->fSize, end - position);
headerV3->fSize = end - position;
result |= kErrSize;
}
}

}
position = end;
};
Expand Down
33 changes: 25 additions & 8 deletions RAW/AliRawReaderRoot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ Int_t AliRawReaderRoot::CheckData() const
subEvent = fEvent->GetSubEvent(subEventIndex++);

// check the magic word of the sub event
if (!fSubEvent->GetHeader()->IsValid()) {
if (fSubEvent && !fSubEvent->GetHeader()->IsValid()) {
result |= kErrMagic;
return result;
}
Expand Down Expand Up @@ -714,16 +714,33 @@ Int_t AliRawReaderRoot::CheckData() const
continue;
}

// Here we have to check if we have header v2 or v3
// check consistency of data size in the header and in the equipment
AliRawDataHeader* header = (AliRawDataHeader*) position;
if ((position + header->fSize) != end) {
if (header->fSize != 0xFFFFFFFF)
Warning("ReadHeader",
"Equipment %d : raw data size found in the header is wrong (%d != %ld)! Using the equipment size instead !",
equipment->GetEquipmentHeader()->GetId(),header->fSize, end - position);
header->fSize = end - position;
result |= kErrSize;
UChar_t version = header->GetVersion();
if (version==2) {
if ((position + header->fSize) != end) {
if (header->fSize != 0xFFFFFFFF)
Warning("CheckData",
"Equipment %d : raw data size found in the header V2 is wrong (%d != %ld)! Using the equipment size instead !",
equipment->GetEquipmentHeader()->GetId(),header->fSize, end - position);
header->fSize = end - position;
result |= kErrSize;
}
}
else if (version==3) {

AliRawDataHeaderV3 * headerV3 = (AliRawDataHeaderV3*) position;
if ((position + headerV3->fSize) != end) {
if (headerV3->fSize != 0xFFFFFFFF)
Warning("CheckData",
"Equipment %d : raw data size found in the header V3 is wrong (%d != %ld)! Using the equipment size instead !",
equipment->GetEquipmentHeader()->GetId(),headerV3->fSize, end - position);
headerV3->fSize = end - position;
result |= kErrSize;
}
}

}
position = end;
};
Expand Down

0 comments on commit bc16e84

Please sign in to comment.