]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/comp/AliHLTCOMPHuffmanData.h
TPC NoiseMapComponent & calibration (Kelly)
[u/mrichter/AliRoot.git] / HLT / comp / AliHLTCOMPHuffmanData.h
CommitLineData
c2440081 1//-*- Mode: C++ -*-
90f0bce8 2// $Id$
c2440081 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"
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
45class AliHLTCOMPHuffmanData : public TObject, public AliHLTLogging
46{
47public:
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;
c2440081 61
62
63 /** standard constructor */
64 AliHLTCOMPHuffmanData();
65
66 /** destructor */
67 virtual ~AliHLTCOMPHuffmanData();
68
69 /** get data from OCDB (currently from ROOT-file) and write into instance of HuffmanData
70 * @param occurrencetable pointer to occurrence table
71 * @param codetable pointer to Huffman code table
72 */
bf7a3243 73 void InitHuffmanData(AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanDataStruct* occurrencetable, AliHLTCOMPHuffmanCodeData::AliHLTCOMPHuffmanCodeStruct* codetable);
c2440081 74
75 /** return occurrence table to be used/written somewhere else (intialisation of Huffman Compressor tables)
a7ad9794 76 * @param occurrencetable table pointer to occurrence table
c2440081 77 */
bf7a3243 78 AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanDataStruct* GetOccurrenceTable(AliHLTCOMPHuffmanOccurrenceData::AliHLTCOMPHuffmanDataStruct* occurrencetable);
c2440081 79
80 /** return code table to be used/ written somewhere else (initialisation of the Huffman Compressor tables)
81 * @param codetable pointer to Huffman code table
82 */
bf7a3243 83 AliHLTCOMPHuffmanCodeData::AliHLTCOMPHuffmanCodeStruct* GetCodeTable(AliHLTCOMPHuffmanCodeData::AliHLTCOMPHuffmanCodeStruct* codetable);
c2440081 84
92272b35 85 /** set specifications for Huffman data to be recognised again in the Preprocessor before storing the data in the OCDB
86 * @param origin string to detector origin
87 * @param dataspec integer to define data specification
88 * @return 0 upon success
89 **/
90 Int_t SetOCDBSpecifications(TString origin, Int_t dataspec);
91
92 /** get detector origin (used in Preprocessor of OCDB)
93 * @return fOrigin (TString)
94 **/
95 TString GetOrigin() {return fOrigin;}
96
97 /** get dataspec (i.e. table number from 1 to 6) (used in Preprocessor of OCDB)
98 * @return dataspec (Int_t)
99 **/
100 Int_t GetDataSpec() {return fDataSpec;}
101
c2440081 102private:
103
104 /** copy constructor prohibited */
105 AliHLTCOMPHuffmanData(const AliHLTCOMPHuffmanData&);
106
107 /** assignment operator prohibited */
108 AliHLTCOMPHuffmanData& operator=(const AliHLTCOMPHuffmanData&);
109
110 /** array of instances of HuffmanOccurrenceData that contains occurrence table */
111 AliHLTCOMPHuffmanOccurrenceData fOccurrenceTable[TIMEBINS]; // occurrence table for all ADC-values
112 /** array of instances of HuffmanCodeData thtat contains complete Huffman code table */
113 AliHLTCOMPHuffmanCodeData fCodeTable[TIMEBINS]; // Huffman translation table for all ADC-values
92272b35 114
115 /** define detector where this data comes from **/
116 TString fOrigin;
117
118 /** define dataspecification where this data comes from **/
119 Int_t fDataSpec;
120
c2440081 121
122 ClassDef(AliHLTCOMPHuffmanData, 1)
123
124 };
125#endif
126