1 #ifndef AliITSHUFFMAN_H
2 #define AliITSHUFFMAN_H
4 ///////////////////////////////////////////////////
5 // Huffman Table associated classes for set:ITS //
6 ///////////////////////////////////////////////////
8 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9 // Attention! Two classes in this file.
10 // They have to stay in the same file.
11 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14 #include <TObjArray.h>
18 class AliITSHNode: public TObject {
22 AliITSHNode(UChar_t symbol, ULong_t freq);
23 virtual ~AliITSHNode() {
26 AliITSHNode(const AliITSHNode &source); // copy constructor
27 AliITSHNode& operator=(const AliITSHNode &source); // ass. op.
29 Bool_t IsSortable() const {
33 Int_t Compare(TObject *obj);
35 ClassDef(AliITSHNode,1) //HuffT node object for set:ITS
39 UChar_t fSymbol; // comment to be written
40 ULong_t fFrequency; // comment to be written
41 AliITSHNode *fLeft; // comment to be written
42 AliITSHNode *fRight; // comment to be written
43 AliITSHNode *fFather; // not used
46 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
47 // Attention! Next class has kept deliberaty in
48 // the same file as the previous one
49 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
50 //___________________________________________
51 class AliITSHTable: public TObject{
55 AliITSHTable(Int_t size);
56 virtual ~AliITSHTable();
57 AliITSHTable(const AliITSHTable &source); // copy constructor
58 AliITSHTable& operator=(const AliITSHTable &source); // ass. op.
78 void GetFrequencies(Int_t len, UChar_t *stream);
80 Bool_t SpanTree(AliITSHNode*start, ULong_t code, UChar_t len);
86 Int_t fSize; // size of the arrays
87 UChar_t *fCodeLen; //![fSize] number of bits array
88 ULong_t *fCode; //![fSize] coded symbols array
90 Short_t *fSym; //![fSize] array of input symbols
91 TObjArray *fHNodes; // array of nodes
92 Int_t fNnodes; // number of nodes
94 ClassDef(AliITSHTable,1) //Huffman Table object for set:ITS