fInComplete(0),
fDecodeIfCorruptedTrailer(kTRUE),
fIsDecoded(kFALSE),
- fIsFatalCorruptedTrailer(kTRUE)
+ fIsFatalCorruptedTrailer(kTRUE)
+// fRcuFirmwareVersion(2)
{
// Default constructor
}
// cout << "Size of datablock is " << fSize << endl;
// cout << "fN40AltroWords = " << fN40AltroWords << endl;
// cout << "fN40RcuAltroWords = " << fN40RcuAltroWords << endl;
+
+ printf("\n< ERROR: data integrity check failed, discarding data \n" );
+ printf( "Size of datablock is %d\n", fSize);
+ printf( "fN40AltroWords = %d\n", fN40AltroWords);
+ printf( "fN40RcuAltroWords = %d\n", fN40RcuAltroWords);
return kFALSE;
}
-
}
}
+
Bool_t AliAltroDecoder::NextChannel(AliAltroData *altroDataPtr)
{
// Reads the next altro channel in the RCU payload after the RCU payload
// Sets the pointer to the memory block that should be decoded
// Returns a negative value if an inconsistency in the data is detected
+
+
if(dtaPtr == 0)
{
printf("\nAliAltroDecoder::SetMemory(UChar_t *dtaPtr, UInt_t size) FATAL ERROR, dtaPtr = ZERO !!!!!!!!!!!!\n");
return -99;
}
-
int iRet = 0;
Int_t tmpTrailerSize;
fIsDecoded = kFALSE;
fSize = size;
f8DtaPtr =f8DtaPtr + fSize;
f32DtaPtr = (UInt_t *)f8DtaPtr;
- tmpTrailerSize = *(f32DtaPtr - 1);
+
+ // if(fRcuFirmwareVersion ==1)
+ // {
+
+
+
+ //tmpTrailerSize = *(f32DtaPtr - 1);
+ tmpTrailerSize = (*(f32DtaPtr - 1))&(0x7f);
+
+ // printf("\nThe trailersize is %d\n", tmpTrailerSize);
+
+// for(int i=0; i<tmpTrailerSize+2; i++)
+// {
+// printf("trailer %d = %d\n", i, *(f32DtaPtr - i));
+
+// }
+
+
+ // }
+ // else
+ // {
+
+ // }
if(tmpTrailerSize <= MAX_TRAILER_WORDS)
{
if(tmpTrailerSize > 0 && tmpTrailerSize < 5)
{
+ //if(fRcuFirmwareVersion ==1)
+ // {
+ // printf("\nfRcuFirmwareVersion ==1\n");
f32DtaPtr = f32DtaPtr - tmpTrailerSize;
fN40RcuAltroWords = *f32DtaPtr;
f32DtaPtr = (UInt_t *)dtaPtr + fkN32HeaderWords;
+
+ // printf("\nthe number of altrowords is %d\n", fN40RcuAltroWords);
+ // printf("\nthe number of altrowords is %u\n", fN40RcuAltroWords);
+
fIsFatalCorruptedTrailer = kFALSE;
+
+
+
+
+ // }
+
+ // else if(fRcuFirmwareVersion ==2)
+ // {
+ // printf("\nfRcuFirmwareVersion ==2\n");
+
+ // f32DtaPtr = f32DtaPtr - tmpTrailerSize;
+ // fN40RcuAltroWords = *f32DtaPtr;
+ // f32DtaPtr = (UInt_t *)dtaPtr + fkN32HeaderWords;
+ // fIsFatalCorruptedTrailer = kFALSE;
+
+ // }
+ // }
+
+ // else
+ // {
+ // printf("ERROR, unknown RCU firmvare version");
+ // }
}
else
{
- // printf("\n AliAltroDecoder::SetMemory, ERROR\n, trailer is corrupted");
+ printf("\n AliAltroDecoder::SetMemory, ERROR\n, trailer is corrupted");
fIsFatalCorruptedTrailer = kTRUE;
iRet = -1;
}
Int_t fInComplete; // Number of altro channels that is read out properly
Bool_t fDecodeIfCorruptedTrailer; // Wether or not to try to decode the data if the RCU trailer is incorrect (will succseed in most cases)
Bool_t fIsDecoded; // Wether or not the buffer set last by the "SetMemory()" function has been decoded
- Bool_t fIsFatalCorruptedTrailer; // If trailer is fataly corrupted, not possible in any way to recover, then it is not allowed to decode the DDL payload.
+ Bool_t fIsFatalCorruptedTrailer; // If trailer is fataly corrupted, not possible in any way to recover, then it is not allowed to decode the DDL payload.
+ // const int fRcuFirmwareVersion;
ClassDef(AliAltroDecoder, 0) // class for decoding Altro payload
};