void* /* event */
#endif
) :
- fRequireMiniHeader(kTRUE),
+ fRequireHeader(kTRUE),
fEvent(NULL),
fSubEvent(NULL),
fEquipment(NULL),
Int_t /*eventNumber*/
#endif
) :
- fRequireMiniHeader(kTRUE),
+ fRequireHeader(kTRUE),
fEvent(NULL),
fSubEvent(NULL),
fEquipment(NULL),
AliRawReaderDate::AliRawReaderDate(const AliRawReaderDate& rawReader) :
AliRawReader(rawReader),
- fRequireMiniHeader(rawReader.fRequireMiniHeader),
+ fRequireHeader(rawReader.fRequireHeader),
fEvent(rawReader.fEvent),
fSubEvent(rawReader.fSubEvent),
fEquipment(rawReader.fEquipment),
Bool_t AliRawReaderDate::ReadHeader()
{
-// read a mini header at the current position
-// returns kFALSE if the mini header could not be read
+// read a data header at the current position
+// returns kFALSE if the data header could not be read
fErrorCode = 0;
// continue with the next sub event if no data left in the payload
if (fPosition >= fEnd) continue;
- fMiniHeader = NULL;
- if (fRequireMiniHeader) {
- // check that there are enough bytes left for the mini header
- if (fPosition + sizeof(AliMiniHeader) > fEnd) {
- Error("ReadHeader", "could not read mini header data!");
+ fHeader = NULL;
+ if (fRequireHeader) {
+ // check that there are enough bytes left for the data header
+ if (fPosition + sizeof(AliRawDataHeader) > fEnd) {
+ Error("ReadHeader", "could not read data header data!");
Warning("ReadHeader", "skipping %d bytes\n"
" run: %d event: %d %d LDC: %d GDC: %d\n",
fEnd - fPosition, fSubEvent->eventRunNb,
fSubEvent->eventLdcId, fSubEvent->eventGdcId);
fCount = 0;
fPosition = fEnd;
- fErrorCode = kErrNoMiniHeader;
+ fErrorCode = kErrNoDataHeader;
continue;
}
- // "read" and check the mini header
- fMiniHeader = (AliMiniHeader*) fPosition;
- fPosition += sizeof(AliMiniHeader);
- if (!CheckMiniHeader()) {
- Error("ReadHeader", "wrong magic word in mini header!");
- Warning("ReadHeader", "skipping %d bytes\n"
- " run: %d event: %d %d LDC: %d GDC: %d\n",
- fEnd - fPosition, fSubEvent->eventRunNb,
- fSubEvent->eventId[0], fSubEvent->eventId[1],
- fSubEvent->eventLdcId, fSubEvent->eventGdcId);
- fCount = 0;
- fPosition = fEnd;
- fErrorCode = kErrMiniMagic;
- continue;
- }
-
- } else { // if mini header not required
- // assume there is a mini header if the magic word is correct
- if ((fPosition + sizeof(AliMiniHeader) <= fEnd) &&
- CheckMiniHeader((AliMiniHeader*) fPosition)) {
- fMiniHeader = (AliMiniHeader*) fPosition;
- fPosition += sizeof(AliMiniHeader);
- }
+ // "read" the data header
+ fHeader = (AliRawDataHeader*) fPosition;
+ fPosition += sizeof(AliRawDataHeader);
}
- if (fMiniHeader) {
- fCount = fMiniHeader->fSize;
+ if (fHeader && (fHeader->fSize != 0xFFFFFFFF)) {
+ fCount = fHeader->fSize - sizeof(AliRawDataHeader);
- // check consistency of data size in the mini header and in the sub event
+ // check consistency of data size in the header and in the sub event
if (fPosition + fCount > fEnd) {
- Error("ReadHeader", "size in mini header exceeds event size!");
+ Error("ReadHeader", "size in data header exceeds event size!");
Warning("ReadHeader", "skipping %d bytes\n"
" run: %d event: %d %d LDC: %d GDC: %d\n",
fEnd - fPosition, fSubEvent->eventRunNb,
// continue with the next sub event if no data left in the payload
if (position >= end) continue;
- // check that there are enough bytes left for the mini header
- if (position + sizeof(AliMiniHeader) > end) {
- result |= kErrNoMiniHeader;
+ // check that there are enough bytes left for the data header
+ if (position + sizeof(AliRawDataHeader) > end) {
+ result |= kErrNoDataHeader;
position = end;
continue;
}
- // "read" and check the mini header
- AliMiniHeader* miniHeader = (AliMiniHeader*) position;
- position += sizeof(AliMiniHeader);
- if (!CheckMiniHeader(miniHeader)){
- result |= kErrMiniMagic;
+ // check consistency of data size in the data header and in the sub event
+ AliRawDataHeader* header = (AliRawDataHeader*) position;
+ if (fHeader->fSize != 0xFFFFFFFF) {
+ if (position + header->fSize > end) {
+ result |= kErrSize;
+ position = end;
+ } else {
+ position += header->fSize;
+ }
+ } else {
position = end;
- continue;
}
-
- // check consistency of data size in the mini header and in the sub event
- if (position + miniHeader->fSize > end) result |= kErrSize;
- position += miniHeader->fSize;
};
#endif