]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSRawStreamSPD.h
Obsolete.
[u/mrichter/AliRoot.git] / ITS / AliITSRawStreamSPD.h
index babc5ec6e5bcad00214e6d896d42892e31435e39..4e23c76a5ff5f4897ffbb7e64522547fb36f5ca9 100644 (file)
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "AliITSRawStream.h"
-
+#include "AliITSRawStreamSPDErrorLog.h"
 
 class AliITSRawStreamSPD: public AliITSRawStream {
   public :
     AliITSRawStreamSPD(AliRawReader* rawReader);
+    AliITSRawStreamSPD(const AliITSRawStreamSPD& rstream);
+    AliITSRawStreamSPD& operator=(const AliITSRawStreamSPD& rstream);
     virtual ~AliITSRawStreamSPD() {};
 
-    virtual Bool_t   Next();
-    virtual Bool_t   ReadCalibHeader();
+    virtual Bool_t  Next();
+    virtual Int_t   ReadCalibHeader();
 
     // the 2 methods below are equivalent to AliITSRawStream::GetCoord1 and GetCoord2
     // together with the AliITSRawStream::GetModuleID these are the "offline" coordinates
@@ -49,9 +51,21 @@ class AliITSRawStreamSPD: public AliITSRawStream {
     static UInt_t GetOnlineRowFromOffline(UInt_t module, UInt_t rowM);
     // coordinate conversions - online->offline
     static UInt_t GetOfflineModuleFromOnline(UInt_t eqId, UInt_t hs, UInt_t chip);
+    static UInt_t GetOfflineChipKeyFromOnline(UInt_t eqId, UInt_t hs, UInt_t chip);
     static UInt_t GetOfflineColFromOnline(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col);
     static UInt_t GetOfflineRowFromOnline(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t row);
 
+    Bool_t  GetFastOrSignal(UInt_t eq, UInt_t hs, UInt_t chip);
+
+    Int_t   GetEventCounter() const {return fEventCounter;}    // get last read event counter value
+    Short_t GetEventCounterFullEq(UInt_t eq) const;
+    Short_t GetEventCounterFullHS(UInt_t eq, UInt_t hs) const;
+    Short_t GetEventCounterFullChip(UInt_t eq, UInt_t hs, UInt_t chip) const;
+    Bool_t  IsEventCounterFullConsistent() const;
+
+    Bool_t IsActiveEq(UInt_t eq) const;
+    Bool_t IsActiveHS(UInt_t eq, UInt_t hs) const;
+    Bool_t IsActiveChip(UInt_t eq, UInt_t hs, UInt_t chip) const;
 
     Bool_t GetHalfStavePresent(UInt_t hs);
 
@@ -74,42 +88,78 @@ class AliITSRawStreamSPD: public AliITSRawStream {
     UInt_t GetHdacLow(UInt_t hs) const;
     UInt_t GetHTPAmp(UInt_t hs) const;
     Bool_t GetHminTHchipPresent(UInt_t chip) const;
+    void   ActivateAdvancedErrorLog(Bool_t activate, AliITSRawStreamSPDErrorLog* advLogger = NULL);
+    AliITSRawStreamSPDErrorLog* GetAdvancedErrorLog() {return fAdvLogger;}
+
+    static const Char_t* GetErrorName(UInt_t errorCode);
+
 
     enum {kDDLsNumber = 20};      // number of DDLs in SPD
     enum {kModulesPerDDL = 12};   // number of modules in each DDL
     enum {kCalHeadLenMax = 16};   // maximum number of calib header words
     enum ESPDRawStreamError {
-      kCalHeaderLengthErr = 1,
-      kDDLNumberErr = 2,
-      kEventNumberErr = 3,
-      kChipAddrErr = 4,
-      kStaveNumberErr = 5,
-      kNumbHitsErr = 6,
-      kWrongWordErr = 7,
-      kHalfStaveStatusErr = 8
+      kTotal,
+      kHeaderMissingErr,
+      kTrailerMissingErr,
+      kTrailerWithoutHeaderErr,
+      kHeaderCountErr,
+      kTrailerCountErr,
+      kFillUnexpectErr,
+      kFillMissingErr,
+      kWrongFillWordErr,
+      kNumberHitsErr,
+      kEventCounterErr,
+      kDDLNumberErr,
+      kHSNumberErr,
+      kChipAddrErr,
+      kCalHeaderLengthErr,
+      kAdvEventCounterErr,     // used by SPDmood
+      kAdvEventCounterOrderErr,// used by SPDmood
+      kTrailerErrorBitErr
     };
 
   private :
     static const Int_t fgkDDLModuleMap[kDDLsNumber][kModulesPerDDL];  // mapping DDL/module -> module number
 
-    Bool_t           ReadNextShort();
-    Bool_t           ReadNextInt();
-    void             NewEvent();
-
-    Int_t            fEventNumber;                 // chip event counter
-    UShort_t         fChipAddr;                    // chip nr
-    UShort_t         fHalfStaveNr;                 // half stave nr
-    UInt_t           fCol;                         // chip column nr
-    UInt_t           fRow;                         // chip row nr
-    UInt_t           fCalHeadWord[kCalHeadLenMax]; // calibration header words
-
-    UShort_t         fData;            // 16 bit data word read
-    UInt_t           fOffset;          // offset for cell column
-    UInt_t           fHitCount;        // counter of hits
-    UChar_t          fDataChar1, fDataChar2, fDataChar3, fDataChar4; // temps part of a 32bit word
-    Bool_t           fFirstWord;       // keeps track of which of the two 16bit words out of the 32bit word to read when ReadNextShort is called
-    Bool_t           fCalHeadRead[20];             // calibration header read flags (reset at new event)
-    UInt_t           fPrevEventId;                 // previous event id (needed to know if there is a new event)
+    Bool_t      ReadNextShort();
+    Bool_t      ReadNextInt();
+    void        NewEvent();
+    void       CheckHeaderAndTrailerCount(Int_t ddlID);
+
+    Int_t       fEventCounter;                // chip event counter
+    Short_t     fEventCounterFull[20][6][10]; // chip event counter
+
+    UShort_t    fChipAddr;                    // chip nr
+    UShort_t    fHalfStaveNr;                 // half stave nr
+    UInt_t      fCol;                         // chip column nr
+    UInt_t      fRow;                         // chip row nr
+    UInt_t      fCalHeadWord[kCalHeadLenMax]; // calibration header words
+               
+    UShort_t    fData;            // 16 bit data word read
+    UInt_t      fOffset;          // offset for cell column
+    UInt_t      fHitCount;        // counter of hits
+    UChar_t     fDataChar1, fDataChar2, fDataChar3, fDataChar4; // temps part of a 32bit word
+    Bool_t      fFirstWord;       // keeps track of which of the two 16bit words out of the 32bit word to read when ReadNextShort is called
+    Bool_t      fCalHeadRead[20];            // calibration header read flags (reset at new event)
+    UInt_t      fPrevEventId;                // previous event id (needed to know if there is a new event)
+
+    UInt_t      fEqPLBytesRead;              // bytes read for current equipment payload
+    UInt_t      fEqPLChipHeadersRead;        // number of chip headers found in current equipment payload
+    UInt_t      fEqPLChipTrailersRead;       // number of chip trailers found in current equipment payload
+    Bool_t      fHeaderOrTrailerReadLast;    // in previous words, was a header (true) or a trailer (false) read last
+    UInt_t      fExpectedHeaderTrailerCount; // expected number of headers and trailers for the current equipment payload
+    Bool_t      fFillOutOfSynch;             // has a fill word been put in the wrong place?
+    Int_t       fDDLID;                      // ddl id 
+    Int_t       fLastDDLID;                  // ddl id for equipment read in previous words
+
+    Bool_t      fAdvancedErrorLog;           // is the advanced error logging activated?
+    AliITSRawStreamSPDErrorLog *fAdvLogger;  // pointer to special error logger object
+
+    Bool_t      fFastOrSignal[20][6][10];    // fastor signal bit (one per chip)
+
+    Bool_t      fActiveEq[20];               // which equipments are active (found in data)
+    Bool_t      fActiveHS[20][6];            // which half-staves are active (blockattribute bits)
+    Bool_t      fActiveChip[20][6][10];      // which chips are active (found in data)
 
     ClassDef(AliITSRawStreamSPD, 0) // class for reading ITS SPD raw digits
 };