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 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17 class AliITSHNode: public TObject {
21 AliITSHNode(UChar_t symbol, ULong_t freq);
22 virtual ~AliITSHNode() {
25 AliITSHNode(const AliITSHNode &source); // copy constructor
26 AliITSHNode& operator=(const AliITSHNode &source); // ass. op.
28 Bool_t IsSortable() const {
32 Int_t Compare(const TObject *obj) const;
34 ClassDef(AliITSHNode,1) //HuffT node object for set:ITS
38 UChar_t fSymbol; // comment to be written
39 ULong_t fFrequency; // comment to be written
40 AliITSHNode *fLeft; // comment to be written
41 AliITSHNode *fRight; // comment to be written
42 AliITSHNode *fFather; // not used
45 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
46 // Attention! Next class has kept deliberaty in
47 // the same file as the previous one
48 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
49 //___________________________________________
50 class AliITSHTable: public TObject{
54 AliITSHTable(Int_t size);
55 virtual ~AliITSHTable();
56 AliITSHTable(const AliITSHTable &source); // copy constructor
57 AliITSHTable& operator=(const AliITSHTable &source); // ass. op.
77 void GetFrequencies(Int_t len, UChar_t *stream);
79 Bool_t SpanTree(AliITSHNode*start, ULong_t code, UChar_t len);
85 Int_t fSize; // size of the arrays
86 UChar_t *fCodeLen; //![fSize] number of bits array
87 ULong_t *fCode; //![fSize] coded symbols array
89 Short_t *fSym; //![fSize] array of input symbols
90 TObjArray *fHNodes; // array of nodes
91 Int_t fNnodes; // number of nodes
93 ClassDef(AliITSHTable,1) //Huffman Table object for set:ITS