//_____________________________________________________________________________
AliAltroRawStream::AliAltroRawStream(const AliAltroRawStream& stream) :
TObject(stream),
- fNoAltroMapping(kTRUE),
- fIsOldRCUFormat(kFALSE),
- fIsShortDataHeader(kFALSE),
- fDDLNumber(-1),
- fPrevDDLNumber(-1),
- fRCUId(-1),
- fPrevRCUId(-1),
- fHWAddress(-1),
- fPrevHWAddress(-1),
- fTime(-1),
- fPrevTime(-1),
- fSignal(-1),
- fTimeBunch(-1),
- fRawReader(NULL),
- fData(NULL),
- fPosition(0),
- fCount(0),
- fBunchLength(0),
- fRCUTrailerData(NULL),
- fRCUTrailerSize(0)
+ fNoAltroMapping(stream.fNoAltroMapping),
+ fIsOldRCUFormat(stream.fIsOldRCUFormat),
+ fIsShortDataHeader(stream.fIsShortDataHeader),
+ fDDLNumber(stream.fDDLNumber),
+ fPrevDDLNumber(stream.fPrevDDLNumber),
+ fRCUId(stream.fRCUId),
+ fPrevRCUId(stream.fPrevRCUId),
+ fHWAddress(stream.fHWAddress),
+ fPrevHWAddress(stream.fPrevHWAddress),
+ fTime(stream.fTime),
+ fPrevTime(stream.fPrevTime),
+ fSignal(stream.fSignal),
+ fTimeBunch(stream.fTimeBunch),
+ fRawReader(stream.fRawReader),
+ fData(stream.fData),
+ fPosition(stream.fPosition),
+ fCount(stream.fCount),
+ fBunchLength(stream.fBunchLength),
+ fRCUTrailerData(stream.fRCUTrailerData),
+ fRCUTrailerSize(stream.fRCUTrailerSize)
{
- Fatal("AliAltroRawStream", "copy constructor not implemented");
+ fSegmentation[0] = stream.fSegmentation[0];
+ fSegmentation[1] = stream.fSegmentation[1];
+ fSegmentation[2] = stream.fSegmentation[2];
}
//_____________________________________________________________________________
// Now read the beginning of the trailer
// where the payload size is written
if (trailerSize < 2) {
- PrintDebug();
- AliFatal(Form("Invalid trailer size found (%d bytes) !",trailerSize*4));
+ fRawReader->AddMajorErrorLog(kRCUTrailerErr,Form("tr=%d bytes",
+ trailerSize*4));
+ AliWarning(Form("Invalid trailer size found (%d bytes) !",
+ trailerSize*4));
}
fRCUTrailerSize = (trailerSize-2)*4;
index -= fRCUTrailerSize;
if (index < 4) {
- PrintDebug();
- AliFatal(Form("Invalid trailer size found (%d bytes) ! The size is bigger than the raw data size (%d bytes)!",
- trailerSize*4,
- fRawReader->GetDataSize()));
+ fRawReader->AddMajorErrorLog(kRCUTrailerErr,Form("tr=%d raw=%d bytes",
+ trailerSize*4,
+ fRawReader->GetDataSize()));
+ AliWarning(Form("Invalid trailer size found (%d bytes) ! The size is bigger than the raw data size (%d bytes)!",
+ trailerSize*4,
+ fRawReader->GetDataSize()));
}
fRCUTrailerData = fData + index;
Int_t position = Get32bitWord(index);
position *= 5;
// Check the consistency of the header and trailer
- if ((fRawReader->GetDataSize() - trailerSize*4) != position) {
- PrintDebug();
- AliFatal(Form("Inconsistent raw data size ! Raw data size - %d bytes (from the header), RCU trailer - %d bytes, raw data paylod - %d bytes !",
+ if (((fRawReader->GetDataSize() - trailerSize*4) < position) ||
+ ((fRawReader->GetDataSize() - trailerSize*4) >= (position + 4))) {
+ fRawReader->AddMajorErrorLog(kRCUTrailerSizeErr,Form("h=%d tr=%d rcu=%d bytes",
+ fRawReader->GetDataSize(),
+ trailerSize*4,
+ position));
+ AliWarning(Form("Inconsistent raw data size ! Raw data size - %d bytes (from the header), RCU trailer - %d bytes, raw data paylod - %d bytes !",
fRawReader->GetDataSize(),
trailerSize*4,
position));
+ position = fRawReader->GetDataSize() - trailerSize*4;
}
return position * 8 / 10;
if (!fIsShortDataHeader) {
// Check the consistency of the header and trailer
- if ((fRawReader->GetDataSize() - 4) != position) {
+ if (((fRawReader->GetDataSize() - 4) < position) ||
+ ((fRawReader->GetDataSize() - 4) >= (position + 4))) {
fRawReader->AddMajorErrorLog(kRCUTrailerSizeErr,Form("h=%d rcu=%d bytes",
fRawReader->GetDataSize()-4,
position));
else {
// Check the consistency of the header and trailer
// In this case the header is shorter by 4 bytes
- if (fRawReader->GetDataSize() != position) {
+ if ((fRawReader->GetDataSize() < position) ||
+ (fRawReader->GetDataSize() >= (position + 4))) {
fRawReader->AddMajorErrorLog(kRCUTrailerSizeErr,Form("h=%d rcu=%d bytes",
fRawReader->GetDataSize(),
position));