]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTDDLDecoder.h
Removing this file that was added to CVS by accident
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTDDLDecoder.h
1 #ifndef ALIHLTDDLDECODER_H
2 #define ALIHLTDDLDECODER_H
3
4 /**************************************************************************
5  * This file is property of and copyright by the Experimental Nuclear     *
6  * Physics Group, Dep. of Physics                                         *
7  * University of Oslo, Norway, 2007                                       *
8  *                                                                        *
9  * Authors: Ã˜ystein Djuvsland <oystein.djuvsland@gmail.com>               * 
10  *      &   Per Thomas Hille <perthi@fys.uio.no>                          *
11  * for the ALICE HLT Project.                                             *
12  * Contributors are mentioned in the code where appropriate.              *
13  * Please report bugs to perthi@fys.uio.no                                * 
14  *                                                                        *
15  * Permission to use, copy, modify and distribute this software and its   *
16  * documentation strictly for non-commercial purposes is hereby granted   *
17  * without fee, provided that the above copyright notice appears in all   *
18  * copies and that both the copyright notice and this permission notice   *
19  * appear in the supporting documentation. The authors make no claims     *
20  * about the suitability of this software for any purpose. It is          *
21  * provided "as is" without express or implied warranty.                  *
22  **************************************************************************/
23
24 #include "Rtypes.h"
25 #include <iostream>
26 using  std::cout;
27 using  std::endl;
28 #define DDL_32BLOCK_SIZE 5
29 #include "AliHLTPHOSConstants.h"
30 using namespace PhosHLTConst;
31 class AliHLTAltroData;
32
33
34 class AliHLTDDLDecoder
35 {
36  public:
37   AliHLTDDLDecoder();
38   virtual ~AliHLTDDLDecoder();
39   bool CheckPayload();
40   bool Decode();
41   bool NextChannel(AliHLTAltroData *altroDataPtr);
42
43   template<typename T> 
44   void  DumpData(T *array, int N, int nPerLine)
45   {
46     cout <<   "DumpData N=  " << N <<endl;
47     for(int i= 0; i< N; i++)
48       {
49         if((i%nPerLine == 0)  &&  (i != 0))
50           {
51             printf("\n");
52           }
53
54         cout << array[i]<< "\t";
55
56       }
57   }
58
59
60   void SetMemory(UChar_t  *dtaPtr, UInt_t size);
61
62   //  void SetNTrailerWords(int N);
63
64   void PrintInfo(AliHLTAltroData &altrodata, int n = 0, int nPerLine = 4);
65   float GetFailureRate();
66
67
68  private:
69   void DecodeDDLBlock();
70   void DecodeLastDDLBlock();
71   int GetMarker(UInt_t *buffer, int index);
72   int countAAApaddings();
73
74   UInt_t  *f32DtaPtr;
75   UChar_t *f8DtaPtr;   
76
77   const long int fN32HeaderWords;
78   const long int fN32RcuTrailerWords;
79  
80
81   unsigned int fNDDLBlocks;
82   long int fBufferPos;
83
84   unsigned long  fN40AltroWords;
85   unsigned long  fN40RcuAltroWords;
86
87   UInt_t  fSize;
88   unsigned int fSegmentation;
89   unsigned int f32LastDDLBlockSize;
90   UInt_t f32PayloadSize;
91   UInt_t fBufferIndex;
92   UInt_t fN10bitWords;
93   UInt_t fBuffer[N_FEECS*N_BRANCHES*8*N_ALTROCHANNELS*(ALTRO_MAX_SAMPLES + ALTRO_MAX_TRALER_SIZE)];  
94   UInt_t fDDLBlockDummy[DDL_BLOCK_SIZE];
95   UInt_t fDDLBlockCnt;
96   UInt_t fNAltro10bitWords;
97   UInt_t fNAltroLastSequence10bitWords;
98   UInt_t fHadd;
99   UInt_t fI;
100   int fComplete;
101   int fInComplete;
102
103   int fBad;
104   int fGood;
105
106 };
107
108 #endif