]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTDDLDecoder.h
Cleanup
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTDDLDecoder.h
CommitLineData
8d17cebb 1#ifndef ALIHLTDDLDECODER_H
2#define ALIHLTDDLDECODER_H
3
4#include "Rtypes.h"
8d17cebb 5#include <iostream>
6
7using std::cout;
8using std::endl;
9
10#define DDL_32BLOCK_SIZE 5
11
6f5d0920 12
8d17cebb 13#include "AliHLTPHOSConstants.h"
14using namespace PhosHLTConst;
15
16class AliHLTAltroData;
17
18
19class AliHLTDDLDecoder
20{
21 public:
22 AliHLTDDLDecoder();
23 virtual ~AliHLTDDLDecoder();
24 bool CheckPayload();
25 bool Decode();
26
27 bool NextChannel(AliHLTAltroData *altroDataPtr);
28
29
30 template<typename T>
31 void DumpData(T *array, int N, int nPerLine)
32 {
33 cout << "DumpData N= " << N <<endl;
34 for(int i= 0; i< N; i++)
35 {
36 if((i%nPerLine == 0) && (i != 0))
37 {
38 printf("\n");
39 }
40
41 cout << array[i]<< "\t";
42
43 }
44 }
45
46
6f5d0920 47 void SetMemory(UChar_t *dtaPtr, UInt_t size);
8d17cebb 48 void SetNTrailerWords(int N);
49 void PrintInfo(AliHLTAltroData &altrodata, int n = 0, int nPerLine = 4);
8d17cebb 50
51 private:
6f5d0920 52 void DecodeDDLBlock();
53 void DecodeLastDDLBlock();
8d17cebb 54 int GetMarker(UInt_t *buffer, int index);
6f5d0920 55
56 // void ReadAltroTrailer();
57
58 // void ResetBuffer();
59
8d17cebb 60 UInt_t *f32DtaPtr;
61 UChar_t *f8DtaPtr;
6f5d0920 62 unsigned int fN32HeaderWords;
63 unsigned int fN32RcuTrailerWords;
64 unsigned int fNDDLBlocks;
65 unsigned int fBufferPos;
8d17cebb 66 unsigned long fN40AltroWords;
67 unsigned long fN40RcuAltroWords;
8d17cebb 68 UInt_t fSize;
6f5d0920 69 unsigned int fSegmentation;
70 unsigned int f32LastDDLBlockSize;
8d17cebb 71 UInt_t f32PayloadSize;
72 UInt_t fBufferIndex;
73 UInt_t fN10bitWords;
8d17cebb 74 UInt_t fBuffer[N_FEECS*N_BRANCHES*8*N_ALTROCHANNELS*(ALTRO_MAX_SAMPLES + ALTRO_MAX_TRALER_SIZE)];
8d17cebb 75 UInt_t fDDLBlockDummy[DDL_BLOCK_SIZE];
8d17cebb 76 UInt_t fDDLBlockCnt;
8d17cebb 77 UInt_t fNAltro10bitWords;
78 UInt_t fNAltroLastSequence10bitWords;
79 UInt_t fHadd;
6f5d0920 80 // UInt_t f10Wc;
81 // UInt_t fCnt;
82 UInt_t fI;
8d17cebb 83};
84
85#endif