return fEquipment->GetEquipmentHeader()->GetBasicSizeType();
}
+Int_t AliRawReaderRoot::GetEquipmentHeaderSize() const
+{
+// get the size of the equipment header (28 bytes by default)
+
+ if (!fEvent || !fEquipment || !fEquipment->GetEquipmentHeader()) return 0;
+ return fEquipment->GetEquipmentHeader()->HeaderSize();
+}
+
Bool_t AliRawReaderRoot::ReadHeader()
{
// "read" the data header
fHeader = (AliRawDataHeader*) fPosition;
+ if ((fPosition + fHeader->fSize) != fEnd) {
+ Warning("ReadHeader",
+ "raw data size found in the header is wrong (%d != %d)! Using the equipment size instead !",
+ fHeader->fSize, fEnd - fPosition);
+ fHeader->fSize = fEnd - fPosition;
+ }
fPosition += sizeof(AliRawDataHeader);
}
if (!fFile) return kFALSE;
do {
- if (fBranch->GetEntry(fEventIndex+1) <= 0) {
- delete fEvent;
- fEvent = new AliRawEvent;
- fBranch->SetAddress(&fEvent);
+ delete fEvent;
+ fEvent = new AliRawEvent;
+ fBranch->SetAddress(&fEvent);
+ if (fBranch->GetEntry(fEventIndex+1) <= 0)
return kFALSE;
- }
fEventIndex++;
} while (!IsEventSelected());
return Reset();
// check consistency of data size in the header and in the equipment
AliRawDataHeader* header = (AliRawDataHeader*) position;
- if (header->fSize != 0xFFFFFFFF) {
- if (position + header->fSize > end) result |= kErrSize;
+ if ((position + header->fSize) != end) {
+ Warning("ReadHeader",
+ "raw data size found in the header is wrong (%d != %d)! Using the equipment size instead !",
+ header->fSize, end - position);
+ header->fSize = end - position;
+ result |= kErrSize;
}
}
+ position = end;
};
return result;