]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSRawStreamSDD.h
Another histos for lumi
[u/mrichter/AliRoot.git] / ITS / AliITSRawStreamSDD.h
index bd588879c55b0ab85c95b1b91b92b0488b1b0031..d9ec48d8a5855a961b66492821bf9486eeb470d6 100644 (file)
@@ -12,6 +12,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "AliITSRawStream.h"
+#include "AliITSDDLModuleMapSDD.h"
 
 class AliRawReader;
 
@@ -19,44 +20,67 @@ class AliRawReader;
 class AliITSRawStreamSDD: public AliITSRawStream {
   public :
     AliITSRawStreamSDD(AliRawReader* rawReader);
-    virtual ~AliITSRawStreamSDD() {};
+    AliITSRawStreamSDD(const AliITSRawStreamSDD& rs);
+    AliITSRawStreamSDD& operator=(const AliITSRawStreamSDD& rs);
+    virtual ~AliITSRawStreamSDD();
+
+    static UChar_t ReadBlockAttributes(AliRawReader* rawReader);
+    static UInt_t  ReadAMSamplFreqFromCDH(UChar_t cdhAttr){
+      if(cdhAttr&0x10) return 40;
+      else return 20;
+    }
+    static AliITSRawStream* CreateRawStreamSDD(AliRawReader* rawReader, UChar_t attributes);
+    static AliITSRawStream* CreateRawStreamSDD(AliRawReader* rawReader);
 
     virtual Bool_t   Next();
 
     virtual Int_t    GetAnode() const {return fCoord1;}
     virtual Int_t    GetTime() const {return fCoord2;}
     virtual Int_t    GetChannel() const {return fChannel;}
-    virtual Int_t    ReadJitter() const {return 0;}
+    virtual Int_t    GetEightBitSignal() const {return fEightBitSignal;}
     virtual Int_t    GetCarlosId() const {return fCarlosId;}
+    virtual Int_t    GetEventId() const {return fEventId;}
+    virtual Int_t    GetJitter() const {return fJitter;}  
+
 
-    virtual void     SetLowCarlosThreshold(Int_t th, Int_t i) 
-      {fLowThreshold[i]=th;}
-    virtual void     SetNCarlos(Int_t nC=12){fNCarlos=nC;}
-    static  Int_t    GetModuleNumber(UInt_t iDDL, UInt_t iModule)
-                     {return fgkDDLModuleMap[iDDL][iModule];}
+    virtual void     SetDecompressAmbra(Bool_t deco=kTRUE){
+      fDecompressAmbra=deco;
+    }
+    virtual void SetDDLModuleMap(AliITSDDLModuleMapSDD* ddlsdd){
+      if(!fDDLModuleMap) fDDLModuleMap=new AliITSDDLModuleMapSDD();
+      fDDLModuleMap->SetDDLMap(ddlsdd);
+    }
+    virtual void     SetZeroSuppLowThreshold(Int_t iMod, Int_t iSid, Int_t th) 
+      {fLowThresholdArray[iMod][iSid]=th;}
+    Int_t   GetModuleNumber(UInt_t iDDL, UInt_t iModule) const {
+      if(!fDDLModuleMap) return kSPDModules+1; // dummy module number if the DDL map is not set (case of DAs)
+      return fDDLModuleMap->GetModuleNumber(iDDL,iModule);
+    }
     virtual void     Reset(); 
-    virtual Bool_t   ResetSkip(Int_t ddln); 
 
-    enum {kDDLsNumber = 24};      // number of DDLs in SDD
-    enum {kModulesPerDDL = 12};   // number of modules in each DDL 
+    enum {kSDDModules = 260};      // number of SDD modules
+    enum {kSPDModules = 240};      // number of SPD modules (used as offset)
+    enum {kDDLsNumber = 24};       // number of DDLs in SDD
+    enum {kModulesPerDDL = 12};    // number of modules in each DDL 
     enum {kCarlosWords = 12};      // number of FIFOCARLOS Words
-    enum {kFifoWords =  4};      // number of FIFO Words
+    enum {kFifoWords =  4};        // number of FIFO Words
     enum ESDDRawStreamError { 
       kDataError = 1,
       kDataFormatErr = 2
     };
   protected:
-    static const Int_t fgkDDLModuleMap[kDDLsNumber][kModulesPerDDL]; //  mapping DDL/module -> module number
-
+    virtual Bool_t   SkipHeaderWord(); 
     virtual UInt_t   ReadBits();
     virtual Int_t    DecompAmbra(Int_t value) const;
 
     static const UInt_t fgkCodeLength[8]; //code length
 
+    AliITSDDLModuleMapSDD* fDDLModuleMap; // mapping DDL/module -> module number 
     UInt_t           fData;         // data read for file
-    Int_t            fSkip[kDDLsNumber];// number of skipped words
-    Int_t            fCarlosId;     // carlos ID
+    Bool_t           fResetSkip;    // flag for end of DDL data
+
     Int_t            fEventId;      // event ID from header
+    Int_t            fCarlosId;     // carlos ID
     Int_t            fChannel;      // current channel
     Int_t            fJitter;          // jitter between L0 and pascal stop (x25ns)
     ULong64_t        fChannelData[kModulesPerDDL][2];// packed data for the 2 channels
@@ -64,18 +88,18 @@ class AliITSRawStreamSDD: public AliITSRawStream {
     UInt_t           fChannelCode[kModulesPerDDL][2];// current channel code
     Bool_t           fReadCode[kModulesPerDDL][2];   // next bits are code or data
     UInt_t           fReadBits[kModulesPerDDL][2];   // number of bits to read
-    Int_t            fLowThreshold[2]; // low Carlos threshold
-    Int_t            fNCarlos;         // number of Carlos 
-    Int_t            fNfifo[kFifoWords];
+    Int_t            fLowThresholdArray[kSDDModules][2]; // array with low thresholds for all modules
+
+    Int_t            fNfifo[kFifoWords];  // FIFO number
     Int_t            fTimeBin[kModulesPerDDL][2];  // current timebin [ncarlos][nchannels]
     Int_t            fAnode[kModulesPerDDL][2]; // current anode [ncarlos][nchannels]
-    Int_t            fDDL;        //current ddl number
-    UInt_t           fICarlosWord[kCarlosWords];
-    UInt_t           fIFifoWord[kFifoWords];
-    Int_t            fICountFoot[kModulesPerDDL];
-    Int_t            fEndWords;//number of 3f1f1f1f
-    Int_t            fResetSkip; //if it is 0, the ResetSkip Funcion is called
-    ClassDef(AliITSRawStreamSDD, 7) // class for reading ITS SDD raw digits
+    UInt_t           fICarlosWord[kCarlosWords]; // Carlos words
+    UInt_t           fIFifoWord[kFifoWords];     // FIFO words
+    Int_t            fICountFoot[kModulesPerDDL]; // counter for carlos footer words
+    Int_t            fEightBitSignal;    // signal at 8 bit
+    Bool_t           fDecompressAmbra; //flag to switch off decompression
+
+    ClassDef(AliITSRawStreamSDD, 14) // class for reading ITS SDD raw digits
 };
 
 #endif