]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDRawStream.h
Add more histograms for trigger patch monitoring
[u/mrichter/AliRoot.git] / PMD / AliPMDRawStream.h
index 7ddde3fe341351f9372bb5cf34f1f2adf0390e6a..7c87ff6be40daf91c43367445ffcda8c9d282308 100644 (file)
 #include <TObject.h>
 
 class AliRawReader;
+class AliCDBManager;
+class AliCDBStorage;
+class AliCDBEntry;
+class AliPMDMappingData;
 
 
 class AliPMDRawStream: public TObject {
@@ -21,42 +25,58 @@ class AliPMDRawStream: public TObject {
     AliPMDRawStream(AliRawReader* rawReader);
     virtual ~AliPMDRawStream();
 
-    virtual Bool_t   Next();
-
-    Int_t            GetModule() const {return fModule;};
-    Int_t            GetPrevModule() const {return fPrevModule;};
-    Bool_t           IsNewModule() const {return fModule != fPrevModule;};
-    Int_t            GetMCM() const {return fMCM;};
-    Int_t            GetChannel() const {return fChannel;};
-    Int_t            GetRow() const {return fRow;};
-    Int_t            GetColumn() const {return fColumn;};
-    Int_t            GetSignal() const {return fSignal;};
-    Int_t            GetDetector() const {return fDetector;};
-    Int_t            GetSMN() const {return fSMN;};
-
+    Int_t DdlData(TObjArray *pmdddlcont);
 
     enum {kDDLOffset = 0xC00};      // offset for DDL numbers
 
+    enum EPMDRawStreamError {
+      kDDLIndexMismatch = 1,
+      kNoMappingFile = 2,
+      kParityError = 3
+    };
+
   private :
     AliPMDRawStream(const AliPMDRawStream& stream);
     AliPMDRawStream& operator = (const AliPMDRawStream& stream);
 
-    void             GetRowCol(Int_t ddlno, UInt_t mcmno, UInt_t chno,
-                              Int_t &um, Int_t &row, Int_t &col) const;
+    void             GetRowCol(Int_t imodule, Int_t pbusid, 
+                              UInt_t mcmno, UInt_t chno,
+                              Int_t startRowBus[], Int_t endRowBus[],
+                              Int_t startColBus[], Int_t endColBus[],
+                              Int_t &row, Int_t &col) const;
+    void             ConvertDDL2SMN(Int_t iddl, Int_t imodule,
+                                   Int_t &smn, Int_t &detector) const;
+    void             TransformH2S(Int_t smn, Int_t &row, Int_t &col) const;
+    Int_t            ComputeParity(UInt_t data1);
+    UInt_t           GetNextWord();
+    void             Ddl0Mapping(Int_t moduleNo[],    Int_t mcmperBus[],
+                                Int_t startRowBus[], Int_t endRowBus[],
+                                Int_t startColBus[], Int_t endColBus[]);
+    void             Ddl1Mapping(Int_t moduleNo[],    Int_t mcmperBus[],
+                                Int_t startRowBus[], Int_t endRowBus[],
+                                Int_t startColBus[], Int_t endColBus[]);
+    void             Ddl2Mapping(Int_t moduleNo[],    Int_t mcmperBus[],
+                                Int_t startRowBus[], Int_t endRowBus[],
+                                Int_t startColBus[], Int_t endColBus[]);
+    void             Ddl3Mapping(Int_t moduleNo[],    Int_t mcmperBus[],
+                                Int_t startRowBus[], Int_t endRowBus[],
+                                Int_t startColBus[], Int_t endColBus[]);
+    void             Ddl4Mapping(Int_t moduleNo[],    Int_t mcmperBus[],
+                                Int_t startRowBus[], Int_t endRowBus[],
+                                Int_t startColBus[], Int_t endColBus[]);
+    void             Ddl5Mapping(Int_t moduleNo[],    Int_t mcmperBus[],
+                                Int_t startRowBus[], Int_t endRowBus[],
+                                Int_t startColBus[], Int_t endColBus[]);
+
+    AliPMDMappingData *GetMappingData() const;
 
     AliRawReader*    fRawReader;    // object for reading the raw data
+    UChar_t*         fData;         // pointer to the data
+    Int_t            fPosition;
+
+    AliPMDMappingData  *fMapData;   //! Mapping data
 
-    Int_t            fModule;       // index of current module
-    Int_t            fPrevModule;   // index of previous module
-    Int_t            fMCM;          // index of current MCM
-    Int_t            fChannel;      // index of current channel
-    Int_t            fRow;          // index of current row
-    Int_t            fColumn;       // index of current column
-    Int_t            fSignal;       // signal in ADC counts
-    Int_t            fDetector;     // PRE = 0, CPV = 1
-    Int_t            fSMN;          // serial module number (0-23)
-
-    ClassDef(AliPMDRawStream, 0)    // class for reading PMD raw digits
+    ClassDef(AliPMDRawStream, 8)    // class for reading PMD raw digits
 };
 
 #endif