]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Small addition to the altro raw stream decoder in order to handle correctly altro...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 4 Jun 2006 20:25:34 +0000 (20:25 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 4 Jun 2006 20:25:34 +0000 (20:25 +0000)
RAW/AliAltroRawStream.cxx
RAW/AliAltroRawStream.h

index 82e7bf83c66a9eafc51d8996f8216ffa0e1df4a8..9cbeb00a3768660d1bbd24742b22291984069ad4 100644 (file)
@@ -37,6 +37,7 @@ ClassImp(AliAltroRawStream)
 AliAltroRawStream::AliAltroRawStream(AliRawReader* rawReader) :
   fNoAltroMapping(kTRUE),
   fIsOldRCUFormat(kFALSE),
 AliAltroRawStream::AliAltroRawStream(AliRawReader* rawReader) :
   fNoAltroMapping(kTRUE),
   fIsOldRCUFormat(kFALSE),
+  fIsShortDataHeader(kFALSE),
   fDDLNumber(-1),
   fPrevDDLNumber(-1),
   fRCUId(-1),
   fDDLNumber(-1),
   fPrevDDLNumber(-1),
   fRCUId(-1),
@@ -64,6 +65,7 @@ AliAltroRawStream::AliAltroRawStream(const AliAltroRawStream& stream) :
   TObject(stream),
   fNoAltroMapping(kTRUE),
   fIsOldRCUFormat(kFALSE),
   TObject(stream),
   fNoAltroMapping(kTRUE),
   fIsOldRCUFormat(kFALSE),
+  fIsShortDataHeader(kFALSE),
   fDDLNumber(-1),
   fPrevDDLNumber(-1),
   fRCUId(-1),
   fDDLNumber(-1),
   fPrevDDLNumber(-1),
   fRCUId(-1),
@@ -336,12 +338,28 @@ Int_t AliAltroRawStream::GetPosition()
     // Therefore we need to transform it to number of bytes
     position *= 5;
 
     // Therefore we need to transform it to number of bytes
     position *= 5;
 
-    // Check the consistency of the header and trailer
-    if ((fRawReader->GetDataSize() - 4) != position)
-      AliFatal(Form("Inconsistent raw data size ! Expected %d bytes (from the header), found %d bytes (in the RCU trailer)!",
-                   fRawReader->GetDataSize()-4,
-                   position));
+    if (!fIsShortDataHeader) {
 
 
+      // Check the consistency of the header and trailer
+      if ((fRawReader->GetDataSize() - 4) != position)
+       AliFatal(Form("Inconsistent raw data size ! Expected %d bytes (from the header), found %d bytes (in the RCU trailer)!",
+                     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)
+       AliFatal(Form("Inconsistent raw data size ! Expected %d bytes (from the header), found %d bytes (in the RCU trailer)!",
+                     fRawReader->GetDataSize(),
+                     position));
+
+      // 7 32-bit words Common Data Header
+      // therefore we have to shift back by 4 bytes
+      // the pointer to the raw data payload
+      fData -= 4;
+    }
+     
     // Return the position in units of 10-bit words
     return position*8/10;
   }
     // Return the position in units of 10-bit words
     return position*8/10;
   }
index ab0271f7b36e8bf475d92049b7202b2770427ac8..08b03c2ec54faf142eb804ce6aa2a3a72de96050 100644 (file)
@@ -9,7 +9,9 @@
 ///
 /// This is a base class for reading raw data digits in Altro format
 /// The class is able to read both old and new RCU trailer formats
 ///
 /// This is a base class for reading raw data digits in Altro format
 /// The class is able to read both old and new RCU trailer formats
-/// One can switch between formats using fIsOldRCUFormat flag
+/// One can switch between formats using fIsOldRCUFormat flag.
+/// In case the Common Data Header is 7 32-bit words long, one
+/// can use the fIsShortDataHeader flag.
 ///
 ///////////////////////////////////////////////////////////////////////////////
 
 ///
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -47,6 +49,7 @@ class AliAltroRawStream: public TObject {
 
     void  SetNoAltroMapping(Bool_t flag) { fNoAltroMapping = flag; }  // Specify whenever to use or not the altro mapping
     void  SetOldRCUFormat(Bool_t flag)   { fIsOldRCUFormat = flag; }  // Specify whenever to use or not the old RCU trailer format
 
     void  SetNoAltroMapping(Bool_t flag) { fNoAltroMapping = flag; }  // Specify whenever to use or not the altro mapping
     void  SetOldRCUFormat(Bool_t flag)   { fIsOldRCUFormat = flag; }  // Specify whenever to use or not the old RCU trailer format
+    void  SetShortDataHeader(Bool_t flag) { fIsShortDataHeader = flag; } // Specify whenever to assume or not a short CDH format
 
   protected:
     AliAltroRawStream(const AliAltroRawStream& stream);
 
   protected:
     AliAltroRawStream(const AliAltroRawStream& stream);
@@ -56,6 +59,7 @@ class AliAltroRawStream: public TObject {
     Short_t          fSegmentation[3]; // temporary container for the dummy trailer, to be removed
 
     Bool_t           fIsOldRCUFormat;  // flag used to select between old and new RCU trailer format
     Short_t          fSegmentation[3]; // temporary container for the dummy trailer, to be removed
 
     Bool_t           fIsOldRCUFormat;  // flag used to select between old and new RCU trailer format
+    Bool_t           fIsShortDataHeader; // flag used to select between normal and short CDH format
 
   private :
 
 
   private :