]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONRawStreamTracker.h
Removing obsolete option
[u/mrichter/AliRoot.git] / MUON / AliMUONRawStreamTracker.h
index 84f190da7313e15a0c16657199a4aa1cc36dad74..59c94c615f8bbce188db6be38a19966dc31d048d 100644 (file)
@@ -5,7 +5,7 @@
 
 /*$Id$*/
 
-/// \ingroup base
+/// \ingroup raw
 /// \class AliMUONRawStreamTracker
 /// \brief Class for reading MUON raw digits
 ///
 
 #include <TObject.h>
 #include "AliMUONPayloadTracker.h"
+#include "AliMUONVRawStreamTracker.h"
 
 class AliRawReader;
 class AliMUONDDLTracker;
+class AliMUONDspHeader;
+class AliMUONBusStruct;
+class AliMUONBlockHeader;
 
-
-class AliMUONRawStreamTracker: public TObject {
+class AliMUONRawStreamTracker: public AliMUONVRawStreamTracker {
   public :
     AliMUONRawStreamTracker();
     AliMUONRawStreamTracker(AliRawReader* rawReader);
     virtual ~AliMUONRawStreamTracker();
 
-    virtual Bool_t   Next();
-    virtual Bool_t   NextDDL();
-
-    /// Return maximum number of DDL in DATE file
-    Int_t GetMaxDDL()   const {return fMaxDDL;}
+    /// Initialize iterator
+    void First();
+
+    /// Returns current DDL object during iteration
+    AliMUONDDLTracker* CurrentDDL() const { return fCurrentDDL; }
+    
+    /// Returns current BlockHeader object during iteration
+    AliMUONBlockHeader* CurrentBlockHeader() const { return fCurrentBlockHeader; }
+    
+    /// Returns current DspHeader object during iteration
+    AliMUONDspHeader* CurrentDspHeader() const { return fCurrentDspHeader; }
+    
+    /// Returns current BusStruct object during iteration
+    AliMUONBusStruct* CurrentBusStruct() const { return fCurrentBusStruct; }
+    
+    /// Advance one step in the iteration. Returns false if finished.
+    virtual Bool_t Next(Int_t& busPatchId, 
+                        UShort_t& manuId, UChar_t& manuChannel, 
+                        UShort_t& adc);
+    
+    virtual Bool_t NextDDL();
+
+    /// Return maximum number of DDLs
+    Int_t GetMaxDDL() const {return fgkMaxDDL;}
     /// Return maximum number of block per DDL in DATE file
     Int_t GetMaxBlock() const {return  fPayload->GetMaxBlock();}
     /// Return maximum number of Dsp per block in DATE file
@@ -37,7 +59,6 @@ class AliMUONRawStreamTracker: public TObject {
     Int_t GetMaxBus()   const {return  fPayload->GetMaxBus();}
 
     // check input before assigment
-    void SetMaxDDL(Int_t ddl);
     void SetMaxBlock(Int_t blk);
 
     /// Set maximum number of Dsp per block in DATE file
@@ -47,17 +68,36 @@ class AliMUONRawStreamTracker: public TObject {
     /// does not check, done via BusPatchManager
     void SetMaxBus(Int_t bus) {fPayload->SetMaxBus(bus);}
 
-    /// Set object for reading the raw data
-    void SetReader(AliRawReader* rawReader) {fRawReader = rawReader;}
-
     /// Return pointer for DDL
     AliMUONDDLTracker*      GetDDLTracker() const {return fPayload->GetDDLTracker();}
 
+    /// Return number of DDL
+    Int_t GetDDL() const {return fDDL - 1;}
+               
+               /// Return current DDL index
+    Int_t GetCurentDDL() const {return fCurrentDDLIndex;}
+
     /// Return pointer for payload
     AliMUONPayloadTracker*  GetPayLoad()    const {return fPayload;}
 
-    /// Return number of DDL
-    Int_t                   GetDDL()        const {return fDDL - 1;}
+    /// Whether the iteration is finished or not
+    Bool_t IsDone() const;
+
+    /// add error message into error logger
+    void AddErrorMessage();
+    
+    /// Disable Warnings
+    void DisableWarnings() {fPayload->DisableWarnings();}
+    
+    /// check error/Warning presence
+    Bool_t IsErrorMessage() const;
+
+    /// error numbers
+    enum rawStreamTrackerError {
+      kGlitchErr      = 1, ///< glitch error 
+      kPaddingWordErr = 2, ///< padding word error
+      kParityErr      = 3  ///< parity error
+    };
 
   private :
     /// Not implemented
@@ -65,20 +105,28 @@ class AliMUONRawStreamTracker: public TObject {
     /// Not implemented
     AliMUONRawStreamTracker& operator = (const AliMUONRawStreamTracker& stream);
 
-    AliRawReader*    fRawReader;    ///< object for reading the raw data
-    Int_t  fDDL;          ///< number of DDL
-    Int_t  fBusPatchId;   ///< entry of buspatch structure
-    Int_t  fDspId;        ///< entry of Dsp header
-    Int_t  fBlkId;        ///< entry of Block header
-
-    Bool_t fNextDDL;      ///< flag for next DDL to be read
-
-    Int_t  fMaxDDL;       ///< maximum number of DDL in DATE file
+    Bool_t GetNextDDL();
+    Bool_t GetNextBlockHeader();
+    Bool_t GetNextDspHeader();
+    Bool_t GetNextBusStruct();
 
-    AliMUONPayloadTracker* fPayload; ///< pointer to payload decoder
-
-    ClassDef(AliMUONRawStreamTracker, 2)    // base class for reading MUON raw digits
+ private:
+
+    AliMUONPayloadTracker* fPayload;         ///< pointer to payload decoder
+    AliMUONDDLTracker* fCurrentDDL;          //!< for iterator: current ddl ptr
+    Int_t fCurrentDDLIndex;                  //!< for iterator: current ddl index
+    AliMUONBlockHeader* fCurrentBlockHeader; //!< for iterator: current block ptr
+    Int_t fCurrentBlockHeaderIndex;          //!< for iterator: current block index    
+    AliMUONDspHeader* fCurrentDspHeader;     //!< for iterator: current dsp ptr
+    Int_t fCurrentDspHeaderIndex;            //!< for iterator: current dsp index    
+    AliMUONBusStruct* fCurrentBusStruct;     //!< for iterator: current bus ptr
+    Int_t fCurrentBusStructIndex;            //!< for iterator: current bus index    
+    Int_t fCurrentDataIndex;                 //!< for iterator: current data index
+    Int_t  fDDL;                             //!< number of DDL
+    static const Int_t  fgkMaxDDL;           //!< maximum number of DDLs
+
+    ClassDef(AliMUONRawStreamTracker, 4)    // base class for reading MUON raw digits
 };
 
 #endif