]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliAltroRawStreamV3.h
Changes for report #76227: ZDC TDC info in ESD and physics selection (for release...
[u/mrichter/AliRoot.git] / RAW / AliAltroRawStreamV3.h
index 09d5589fdc00043e9a7fa8cf98d03f35cba7b541..2eb82c19c894c80e06f7036b37d655f5057050f5 100644 (file)
@@ -19,6 +19,7 @@
 #include <TObject.h>
 
 class AliRawReader;
+class AliAltroRawStream;
 
 class AliAltroRawStreamV3: public TObject {
   public :
@@ -42,11 +43,14 @@ class AliAltroRawStreamV3: public TObject {
     Int_t  GetRCUId()          const { return fRCUId; }        // Provide current RCU identifier
  
     UInt_t GetStartTimeBin()   const { return fStartTimeBin; } // Provide the index if the first time-bin in current bunch
-    UInt_t GetEndTimeBin()     const { return fStartTimeBin+fBunchLength-1; } // Provide the index of the last time-bin in current bunch
+    UInt_t GetEndTimeBin()     const { return fStartTimeBin-fBunchLength+1; } // Provide the index of the last time-bin in current bunch
     Int_t  GetBunchLength()    const { return fBunchLength; }  // Provide the current bunch length
-    const UShort_t* GetSignals() const { return fBunchData; }  // Provide access to altro data itself
+    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; }
+    UChar_t *GetRCUPayloadInSOD() const;
+    Int_t GetRCUPayloadSizeInSOD() const;
 
     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
@@ -60,8 +64,8 @@ class AliAltroRawStreamV3: public TObject {
     UInt_t  GetFECERRA() const { return fFECERRA; }
     UInt_t  GetFECERRB() const { return fFECERRB; }
     UShort_t GetERRREG2() const { return fERRREG2; }
-    UShort_t GetNChAddrMismatch() const { return fERRREG3; }
-    UShort_t GetNChLengthMismatch() const { return fERRREG4; }
+    UShort_t GetNChAddrMismatch() const { return (fERRREG3 & 0xFFF); }
+    UShort_t GetNChLengthMismatch() const { return ((fERRREG3 >> 12) & 0x1FFF); }
 
     UShort_t GetActiveFECsA() const { return fActiveFECsA; }
     UShort_t GetActiveFECsB() const { return fActiveFECsB; }
@@ -88,6 +92,10 @@ class AliAltroRawStreamV3: public TObject {
  
     void  SetShortDataHeader(Bool_t flag) { fIsShortDataHeader = flag; } // Specify whenever to assume or not a short CDH format
 
+    void  SetCheckAltroPayload(Bool_t check) { fCheckAltroPayload = check; }
+
+    void HexDumpChannel() const;
+
     enum EAltroRawStreamV3Error {
       kRCUTrailerErr = 1,
       kRCUVerErr = 2,
@@ -127,7 +135,11 @@ class AliAltroRawStreamV3: public TObject {
     Bool_t           fBadChannel;   //
     Int_t            fPayloadSize;  //
 
-    UShort_t         fBunchData[kMaxNTimeBins];    // cache for the bunch data - altro samples
+    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
 
     UChar_t*         fRCUTrailerData; // pointer to RCU trailer data
     Int_t            fRCUTrailerSize; // size of RCU trailer data in bytes
@@ -136,13 +148,16 @@ class AliAltroRawStreamV3: public TObject {
     UInt_t           fFECERRA;      // contains errors related to ALTROBUS transactions
     UInt_t           fFECERRB;      // contains errors related to ALTROBUS transactions
     UShort_t         fERRREG2;      // contains errors related to ALTROBUS transactions or trailer of ALTRO channel block
-    UShort_t         fERRREG3;      // contains number of altro channels skipped due to an address mismatch 
-    UShort_t         fERRREG4;      // contains number of altro channels skipped due to a block length mismatch 
+    UInt_t           fERRREG3;      // contains number of altro channels skipped due to an address mismatch 
     UShort_t         fActiveFECsA;  // bit pattern of active FECs in branch A
     UShort_t         fActiveFECsB;  // bit pattern of active FECs in branch B
     UInt_t           fAltroCFG1;    // ALTROCFG1 register
     UInt_t           fAltroCFG2;    // ALTROCFG2 and ALTROIF registers
 
+    AliAltroRawStream* fOldStream;  // streamer for old altro format
+
+    Bool_t           fCheckAltroPayload; // check altro payload correctness or not?
+
     ClassDef(AliAltroRawStreamV3, 0)  // base class for reading Altro raw digits
 };