]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliAltroRawStream.cxx
Remove AliTRDclusterizerV1
[u/mrichter/AliRoot.git] / RAW / AliAltroRawStream.cxx
index f3e9e0717612c55e5c51e3a766c21ad21839c92a..a6b008857eac4d7e9d27764a545dbfb91ddbf5b7 100644 (file)
@@ -63,28 +63,30 @@ AliAltroRawStream::AliAltroRawStream(AliRawReader* rawReader) :
 //_____________________________________________________________________________
 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];
 }
 
 //_____________________________________________________________________________
@@ -369,16 +371,20 @@ Int_t AliAltroRawStream::GetPosition()
     // 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);
@@ -387,12 +393,17 @@ Int_t AliAltroRawStream::GetPosition()
     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;
@@ -415,7 +426,8 @@ Int_t AliAltroRawStream::GetPosition()
     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));
@@ -429,7 +441,8 @@ Int_t AliAltroRawStream::GetPosition()
     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));