]>
Commit | Line | Data |
---|---|---|
c2440081 | 1 | //-*- Mode: C++ -*- |
90f0bce8 | 2 | // $Id$ |
c2440081 | 3 | #ifndef ALIHLTCOMPHUFFMANDATA_H |
4 | #define ALIHLTCOMPHUFFMANDATA_H | |
5 | ||
e3107b54 | 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 | /// | |
c2440081 | 26 | |
27 | #include "AliHLTLogging.h" | |
bf7a3243 | 28 | #include "AliHLTCompDefinitions.h" |
c2440081 | 29 | #include "AliHLTCOMPHuffmanOccurrenceData.h" |
30 | #include "AliHLTCOMPHuffmanCodeData.h" | |
31 | ||
bf7a3243 | 32 | #define TIMEBINS 1024 |
33 | ||
c2440081 | 34 | // type definitions needed for the Huffman compression |
35 | /** @class AliHLTCOMPHuffmanData | |
36 | @author Jenny Wagner | |
37 | @date 29-08-2007 | |
38 | @brief The Huffman Data containing the Huffman code table and the occurrence table of ADC-values | |
bf7a3243 | 39 | it uses the classes @ref AliHLTCOMPHuffmanOccurrenceData and @ref AliHLTCOMPHuffmanCodeData |
40 | to convert all structs into classes (and instances) such that this information can be written | |
41 | to a ROOT file | |
c2440081 | 42 | */ |
43 | ||
c2440081 | 44 | |
45 | class AliHLTCOMPHuffmanData : public TObject, public AliHLTLogging | |
46 | { | |
47 | public: | |
48 | ||
49 | /** typedef for the nodes in the Huffman tree */ | |
bf7a3243 | 50 | typedef struct AliHLTCOMPHuffmanTreeDataStruct // struct containing all information for Huffman tree |
c2440081 | 51 | { |
bf7a3243 | 52 | AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanDataStruct fleafcontents; // contains all info about one leaf (node) |
53 | AliHLTCOMPHuffmanTreeDataStruct* fleft; // pointer to left children | |
54 | AliHLTCOMPHuffmanTreeDataStruct* fright; // pointer to right children | |
55 | AliHLTCOMPHuffmanTreeDataStruct* fparent; // pointer to parent node | |
c2440081 | 56 | |
bf7a3243 | 57 | AliHLTCOMPHuffmanTreeDataStruct* fnext; // pointer to next element in remaining list to build tree from |
58 | AliHLTCOMPHuffmanTreeDataStruct* fprevious; // pointer to previous element in remaining list to build tree from | |
c2440081 | 59 | |
bf7a3243 | 60 | } AliHLTCOMPHuffmanTreeDataStruct; |
e3107b54 | 61 | |
c2440081 | 62 | /** standard constructor */ |
63 | AliHLTCOMPHuffmanData(); | |
64 | ||
65 | /** destructor */ | |
66 | virtual ~AliHLTCOMPHuffmanData(); | |
67 | ||
e3107b54 | 68 | /** init internal occurrencetable and codetable |
c2440081 | 69 | * @param occurrencetable pointer to occurrence table |
70 | * @param codetable pointer to Huffman code table | |
71 | */ | |
e3107b54 | 72 | int InitHuffmanData(const AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanDataStruct* occurrencetable, const AliHLTCOMPHuffmanCodeData::AliHLTCOMPHuffmanCodeStruct* codetable); |
c2440081 | 73 | |
e3107b54 | 74 | /** copy occurrencetable to target |
a7ad9794 | 75 | * @param occurrencetable table pointer to occurrence table |
c2440081 | 76 | */ |
e3107b54 | 77 | AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanDataStruct* GetOccurrenceTable(AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanDataStruct* occurrencetable) const; |
78 | ||
79 | /** copy codetable to target | |
c2440081 | 80 | * @param codetable pointer to Huffman code table |
81 | */ | |
e3107b54 | 82 | AliHLTCOMPHuffmanCodeData::AliHLTCOMPHuffmanCodeStruct* GetCodeTable(AliHLTCOMPHuffmanCodeData::AliHLTCOMPHuffmanCodeStruct* codetable) const; |
c2440081 | 83 | |
92272b35 | 84 | /** set specifications for Huffman data to be recognised again in the Preprocessor before storing the data in the OCDB |
85 | * @param origin string to detector origin | |
86 | * @param dataspec integer to define data specification | |
87 | * @return 0 upon success | |
88 | **/ | |
e3107b54 | 89 | Int_t SetOCDBSpecifications(const TString& origin, Int_t dataspec); |
92272b35 | 90 | |
91 | /** get detector origin (used in Preprocessor of OCDB) | |
92 | * @return fOrigin (TString) | |
93 | **/ | |
e3107b54 | 94 | TString GetOrigin() const {return fOrigin;} |
92272b35 | 95 | |
96 | /** get dataspec (i.e. table number from 1 to 6) (used in Preprocessor of OCDB) | |
97 | * @return dataspec (Int_t) | |
98 | **/ | |
e3107b54 | 99 | Int_t GetDataSpec() const {return fDataSpec;} |
92272b35 | 100 | |
c2440081 | 101 | private: |
102 | ||
103 | /** copy constructor prohibited */ | |
104 | AliHLTCOMPHuffmanData(const AliHLTCOMPHuffmanData&); | |
105 | ||
106 | /** assignment operator prohibited */ | |
107 | AliHLTCOMPHuffmanData& operator=(const AliHLTCOMPHuffmanData&); | |
108 | ||
109 | /** array of instances of HuffmanOccurrenceData that contains occurrence table */ | |
110 | AliHLTCOMPHuffmanOccurrenceData fOccurrenceTable[TIMEBINS]; // occurrence table for all ADC-values | |
111 | /** array of instances of HuffmanCodeData thtat contains complete Huffman code table */ | |
112 | AliHLTCOMPHuffmanCodeData fCodeTable[TIMEBINS]; // Huffman translation table for all ADC-values | |
92272b35 | 113 | |
114 | /** define detector where this data comes from **/ | |
115 | TString fOrigin; | |
116 | ||
117 | /** define dataspecification where this data comes from **/ | |
118 | Int_t fDataSpec; | |
119 | ||
c2440081 | 120 | |
121 | ClassDef(AliHLTCOMPHuffmanData, 1) | |
122 | ||
123 | }; | |
124 | #endif | |
125 |