Bug #56232: Providing access to the altro channel payload size as requested by PHOS...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Oct 2009 20:00:02 +0000 (20:00 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Oct 2009 20:00:02 +0000 (20:00 +0000)
RAW/AliAltroRawStream.cxx
RAW/AliAltroRawStream.h
RAW/AliAltroRawStreamV3.cxx
RAW/AliAltroRawStreamV3.h

index 2e9bef8..69f8983 100644 (file)
@@ -50,6 +50,7 @@ AliAltroRawStream::AliAltroRawStream(AliRawReader* rawReader) :
   fData(NULL),
   fPosition(0),
   fCount(0),
+  fChannelPayloadSize(-1),
   fBunchLength(0),
   fRCUTrailerData(NULL),
   fRCUTrailerSize(0),
@@ -84,6 +85,7 @@ AliAltroRawStream::AliAltroRawStream(const AliAltroRawStream& stream) :
   fData(stream.fData),
   fPosition(stream.fPosition),
   fCount(stream.fCount),
+  fChannelPayloadSize(stream.fChannelPayloadSize),
   fBunchLength(stream.fBunchLength),
   fRCUTrailerData(stream.fRCUTrailerData),
   fRCUTrailerSize(stream.fRCUTrailerSize),
@@ -119,6 +121,7 @@ AliAltroRawStream& AliAltroRawStream::operator = (const AliAltroRawStream& strea
   fData              = stream.fData;
   fPosition          = stream.fPosition;
   fCount             = stream.fCount;
+  fChannelPayloadSize= stream.fChannelPayloadSize;
   fBunchLength       = stream.fBunchLength;
   fRCUTrailerData    = stream.fRCUTrailerData;
   fRCUTrailerSize    = stream.fRCUTrailerSize;
@@ -148,6 +151,7 @@ void AliAltroRawStream::Reset()
 // reset altro raw stream params
 
   fPosition = fCount = fBunchLength = 0;
+  fChannelPayloadSize = -1;
 
   fRCUTrailerData = NULL;
   fRCUTrailerSize = 0;
@@ -207,6 +211,7 @@ Bool_t AliAltroRawStream::NextDDL(UChar_t *data)
   }
 
   fDDLNumber = fRawReader->GetDDLID();
+  fChannelPayloadSize = -1;
   fPosition = GetPosition();
 
   return kTRUE;
@@ -330,6 +335,7 @@ Bool_t AliAltroRawStream::ReadTrailer()
     return kFALSE;
   }
   fCount |= ((temp & 0x3FF) >> 6);
+  fChannelPayloadSize = fCount;
 
   if (fCount >= fPosition) {
     fRawReader->AddMajorErrorLog(kAltroTrailerErr,"invalid size");
index 817d1ac..d9f2626 100644 (file)
@@ -48,6 +48,8 @@ class AliAltroRawStream: public TObject {
     Int_t GetSignal()     const { return fSignal; }     // Provide signal in ADC counts
     Int_t GetTimeLength() const { return fTimeBunch; }  // Provide total length of current time bunch
 
+    Int_t GetChannelPayloadSize() const { return fChannelPayloadSize; }
+
     Int_t GetBranch()     const; // Provide the branch index for the current hardware address
     Int_t GetFEC()        const; // Provide the front-end card index for the current hardware address
     Int_t GetAltro()      const; // Provide the altro chip index for the current hardware address
@@ -140,6 +142,7 @@ class AliAltroRawStream: public TObject {
 
     Int_t            fPosition;     // current (10 bit) position in fData
     Int_t            fCount;        // counter of words to be read for current trailer
+    Int_t            fChannelPayloadSize;        //
     Int_t            fBunchLength;  // remaining number of signal bins in the current bunch
 
     UChar_t*         fRCUTrailerData; // pointer to RCU trailer data
index 73f8830..aa848fa 100644 (file)
@@ -48,6 +48,7 @@ AliAltroRawStreamV3::AliAltroRawStreamV3(AliRawReader* rawReader) :
   fBunchLength(-1),
   fBadChannel(kFALSE),
   fPayloadSize(-1),
+  fChannelPayloadSize(-1),
   fBunchDataPointer(NULL),
   fBunchDataIndex(-1),
   fRCUTrailerData(NULL),
@@ -92,6 +93,7 @@ AliAltroRawStreamV3::AliAltroRawStreamV3(const AliAltroRawStreamV3& stream) :
   fBunchLength(stream.fBunchLength),
   fBadChannel(stream.fBadChannel),
   fPayloadSize(stream.fPayloadSize),
+  fChannelPayloadSize(stream.fChannelPayloadSize),
   fBunchDataPointer(stream.fBunchDataPointer),
   fBunchDataIndex(stream.fBunchDataIndex),
   fRCUTrailerData(stream.fRCUTrailerData),
@@ -134,6 +136,7 @@ AliAltroRawStreamV3& AliAltroRawStreamV3::operator = (const AliAltroRawStreamV3&
   fBunchLength       = stream.fBunchLength;
   fBadChannel        = stream.fBadChannel;
   fPayloadSize       = stream.fPayloadSize;
+  fChannelPayloadSize= stream.fChannelPayloadSize;
   fBunchDataPointer  = stream.fBunchDataPointer;
   fBunchDataIndex    = stream.fBunchDataIndex;
   fRCUTrailerData    = stream.fRCUTrailerData;
@@ -171,6 +174,7 @@ void AliAltroRawStreamV3::Reset()
   fBunchLength = fStartTimeBin = -1;
   fBadChannel = kFALSE;
   fPayloadSize = -1;
+  fChannelPayloadSize = -1;
   fBunchDataPointer = NULL;
   fBunchDataIndex = -1;
 
@@ -200,6 +204,7 @@ Bool_t AliAltroRawStreamV3::NextDDL()
   } while (fRawReader->GetDataSize() == 0);
 
   fDDLNumber = fRawReader->GetDDLID();
+  fChannelPayloadSize = -1;
 
   UChar_t rcuVer = fRawReader->GetBlockAttributes();
 
@@ -241,7 +246,10 @@ Bool_t AliAltroRawStreamV3::NextChannel()
   // RCU signals readout error in this channel
   if (fOldStream) {
     Bool_t status = fOldStream->NextChannel();
-    if (status) fHWAddress = fOldStream->GetHWAddress();
+    if (status) {
+      fHWAddress = fOldStream->GetHWAddress();
+      fChannelPayloadSize = fOldStream->GetChannelPayloadSize();
+    }
     return status;
   }
 
@@ -262,6 +270,7 @@ Bool_t AliAltroRawStreamV3::NextChannel()
 
   // extract channel payload and hw address
   fCount = (word >> 16) & 0x3FF; 
+  fChannelPayloadSize = fCount;
   fHWAddress = word & 0xFFF;
 
   // Now unpack the altro data
index b75e7c5..ea7a21f 100644 (file)
@@ -48,6 +48,7 @@ class AliAltroRawStreamV3: public TObject {
     const UShort_t* GetSignals() const { return fBunchDataPointer; }  // Provide access to altro data itself
     Bool_t IsChannelBad()      const { return fBadChannel; }   // Is the channel data bad or not
 
+    Int_t GetChannelPayloadSize() const { return fChannelPayloadSize; }
 
     Int_t GetBranch()     const; // Provide the branch index for the current hardware address
     Int_t GetFEC()        const; // Provide the front-end card index for the current hardware address
@@ -130,6 +131,8 @@ class AliAltroRawStreamV3: public TObject {
     Bool_t           fBadChannel;   //
     Int_t            fPayloadSize;  //
 
+    Int_t            fChannelPayloadSize; //
+
     UShort_t         fBunchData[kMaxNTimeBins];    // cache for the decoded altro payload
     UShort_t*        fBunchDataPointer;            // pointer to the current bunch samples
     Int_t            fBunchDataIndex;              // current position in the payload