]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/comp/AliHLTCOMPHuffmanData.h
d0f1e273b0d89a6a4c398ad6cee8baa86b0f34d7
[u/mrichter/AliRoot.git] / HLT / comp / AliHLTCOMPHuffmanData.h
1 //-*- Mode: C++ -*-
2
3 #ifndef ALIHLTCOMPHUFFMANDATA_H
4 #define ALIHLTCOMPHUFFMANDATA_H
5
6 /**************************************************************************
7  * This file is property of and copyright by the ALICE HLT Project        * 
8  * All rights reserved.                                                   *
9  *                                                                        *
10  * Primary Author: Jenny Wagner  (jwagner@cern.ch)                        *
11  *                                                                        *
12  * Permission to use, copy, modify and distribute this software and its   *
13  * documentation strictly for non-commercial purposes is hereby granted   *
14  * without fee, provided that the above copyright notice appears in all   *
15  * copies and that both the copyright notice and this permission notice   *
16  * appear in the supporting documentation. The authors make no claims     *
17  * about the suitability of this software for any purpose. It is          * 
18  * provided "as is" without express or implied warranty.                  *
19  **************************************************************************/
20
21 /** @file   AliHLTCOMPHuffmanData.h
22     @author Jenny Wagner
23     @date   29-08-2007
24     @brief  The Huffman Data containing the Huffman code table and the occurrence table of ADV-values
25 */
26
27 #include "AliHLTLogging.h"
28 #include "AliHLTDataTypes.h"
29 #include "AliHLTCOMPHuffmanOccurrenceData.h"
30 #include "AliHLTCOMPHuffmanCodeData.h"
31
32 // type definitions needed for the Huffman compression
33 /** @class   AliHLTCOMPHuffmanData
34     @author Jenny Wagner
35     @date   29-08-2007
36     @brief  The Huffman Data containing the Huffman code table and the occurrence table of ADC-values
37 */
38
39 #define TIMEBINS 1024
40
41 class AliHLTCOMPHuffmanData : public TObject, public AliHLTLogging
42 {
43 public:
44
45   /** typedef for the nodes in the Huffman tree */
46   typedef struct AliHLTCOMPHuffmanTreeData_t
47   {
48     AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanData_t leafcontents;
49     AliHLTCOMPHuffmanTreeData_t* left;
50     AliHLTCOMPHuffmanTreeData_t* right;
51     AliHLTCOMPHuffmanTreeData_t* parent;
52     
53     AliHLTCOMPHuffmanTreeData_t* next;
54     AliHLTCOMPHuffmanTreeData_t* previous;
55    
56   } AliHLTCOMPHuffmanTreeData_t;
57   
58   
59   /** standard constructor */
60   AliHLTCOMPHuffmanData();
61
62   /** destructor */
63   virtual ~AliHLTCOMPHuffmanData();
64
65   /** get data from OCDB (currently from ROOT-file) and write into instance of HuffmanData 
66    * @param occurrencetable   pointer to occurrence table
67    * @param codetable         pointer to Huffman code table
68    */
69   void InitHuffmanData(AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanData_t* occurrencetable, AliHLTCOMPHuffmanCodeData::AliHLTCOMPHuffmanCode_t* codetable);
70
71   /** return occurrence table to be used/written somewhere else (intialisation of Huffman Compressor tables)
72    * @param occurrence table  pointer to occurrence table
73    */
74   AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanData_t* GetOccurrenceTable(AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanData_t* occurrencetable);
75   
76   /** return code table to be used/ written somewhere else (initialisation of the Huffman Compressor tables)
77    * @param codetable   pointer to Huffman code table
78   */
79   AliHLTCOMPHuffmanCodeData::AliHLTCOMPHuffmanCode_t* GetCodeTable(AliHLTCOMPHuffmanCodeData::AliHLTCOMPHuffmanCode_t* codetable);
80
81 private:
82
83   /** copy constructor prohibited */
84   AliHLTCOMPHuffmanData(const AliHLTCOMPHuffmanData&);
85
86   /** assignment operator prohibited */
87   AliHLTCOMPHuffmanData& operator=(const AliHLTCOMPHuffmanData&);
88   
89   /** array of instances of HuffmanOccurrenceData that contains occurrence table */
90   AliHLTCOMPHuffmanOccurrenceData fOccurrenceTable[TIMEBINS]; // occurrence table for all ADC-values
91   /** array of instances of HuffmanCodeData thtat contains complete Huffman code table */
92   AliHLTCOMPHuffmanCodeData fCodeTable[TIMEBINS];             // Huffman translation table for all ADC-values
93     
94   ClassDef(AliHLTCOMPHuffmanData, 1)
95     
96     };
97 #endif
98