]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliAltroRawStream.h
fixed coding conventions
[u/mrichter/AliRoot.git] / RAW / AliAltroRawStream.h
index fba99132898cb23ee1be377584f45fca55515a4e..068c1a5989682ed077f7dc0e3f9545edc3d8be01 100644 (file)
@@ -27,6 +27,12 @@ class AliAltroRawStream: public TObject {
     virtual void             Reset();
     virtual Bool_t           Next();
 
+    virtual Bool_t NextDDL(UChar_t* data = NULL);              // Iterate over DDLs/RCUs
+    virtual Bool_t NextChannel();                              // Iterate over altro channels
+    virtual Bool_t NextBunch(UShort_t *bunchData,
+                            Int_t &bunchLength,
+                            Int_t &startTimeBin);             // Iterate over altro bunches
+
     Int_t GetDDLNumber()  const { return fDDLNumber; }  // Provide current DDL number
     Int_t GetPrevDDLNumber() const { return fPrevDDLNumber; }// Provide previous DDL number
     Bool_t  IsNewDDLNumber() const {return (fDDLNumber != fPrevDDLNumber);};
@@ -42,6 +48,9 @@ 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 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
     Int_t GetAltro()      const; // Provide the altro chip index for the current hardware address
@@ -62,13 +71,14 @@ class AliAltroRawStream: public TObject {
 
     UInt_t  GetAltroCFG1() const { return fAltroCFG1; }
     UChar_t GetBaselineCorr() const { return fAltroCFG1 & 0xF; }
-    UChar_t GetNPresamples() const  { return (fAltroCFG1 >> 4) & 0x3; }
-    UChar_t GetNPostsamples() const { return (fAltroCFG1 >> 6) & 0xF; }
-    Bool_t  GetSecondBaselineCorr() const { return (fAltroCFG1 >> 10) & 0x1; }
-    UChar_t GetGlitchFilter() const { return (fAltroCFG1 >> 11) & 0x3; }
-    UChar_t GetNNonZSPostsamples() const { return (fAltroCFG1 >> 13) & 0x7; }
-    UChar_t GetNNonZSPresamples() const  { return (fAltroCFG1 >> 16) & 0x3; }
-    Bool_t  GetZeroSupp() const          { return (fAltroCFG1 >> 18) & 0x1; }
+    Bool_t  GetPolarity() const { return (fAltroCFG1 >> 4) & 0x1; }
+    UChar_t GetNPresamples() const  { return (fAltroCFG1 >> 5) & 0x3; }
+    UChar_t GetNPostsamples() const { return (fAltroCFG1 >> 7) & 0xF; }
+    Bool_t  GetSecondBaselineCorr() const { return (fAltroCFG1 >> 11) & 0x1; }
+    UChar_t GetGlitchFilter() const { return (fAltroCFG1 >> 12) & 0x3; }
+    UChar_t GetNNonZSPostsamples() const { return (fAltroCFG1 >> 14) & 0x7; }
+    UChar_t GetNNonZSPresamples() const  { return (fAltroCFG1 >> 17) & 0x3; }
+    Bool_t  GetZeroSupp() const          { return (fAltroCFG1 >> 19) & 0x1; }
     
     UInt_t   GetAltroCFG2() const { return fAltroCFG2; }
     Bool_t   GetNAltroBuffers() const     { return (fAltroCFG2 >> 24) & 0x1; }
@@ -82,7 +92,6 @@ class AliAltroRawStream: public TObject {
     void SelectRawData(Int_t detId);                           // Select raw data for specific detector id
     void SelectRawData(const char *detName);                   // Select raw data for specific detector name
 
-    void  SetNoAltroMapping(Bool_t flag) { fNoAltroMapping = flag; }  // Specify whenever to use or not the altro mapping
     void  SetShortDataHeader(Bool_t flag) { fIsShortDataHeader = flag; } // Specify whenever to assume or not a short CDH format
 
     void PrintDebug() const; // Print debug information in case of decoding errors
@@ -104,16 +113,12 @@ class AliAltroRawStream: public TObject {
 
   protected:
 
-    Bool_t           fNoAltroMapping;  // temporary flag in case of no altro mapping is provided
-    Short_t          fSegmentation[3]; // temporary container for the dummy trailer, to be removed
-
     Bool_t           fIsShortDataHeader; // flag used to select between normal and short CDH format
 
   private :
 
     UShort_t         GetNextWord();
     Bool_t           ReadTrailer();
-    Bool_t           ReadDummyTrailer();
     void             ReadBunch();
     void             ReadAmplitude();
     Int_t            GetPosition();
@@ -138,6 +143,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