Changing the output of the collection and removing the very old opening of the file...
[u/mrichter/AliRoot.git] / ITS / AliITSHuffman.h
CommitLineData
b0f5e3fc 1#ifndef AliITSHUFFMAN_H
2#define AliITSHUFFMAN_H
3
4///////////////////////////////////////////////////
5// Huffman Table associated classes for set:ITS //
6///////////////////////////////////////////////////
7
8//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9// Attention! Two classes in this file.
10// They have to stay in the same file.
11//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
13#include <TObject.h>
b0f5e3fc 14
15class AliITSInStream;
92c19c36 16class TObjectArray;
b0f5e3fc 17class AliITSHNode: public TObject {
18
19 public:
b0f5e3fc 20 AliITSHNode();
21 AliITSHNode(UChar_t symbol, ULong_t freq);
22 virtual ~AliITSHNode() {
23 // destructor
24 }
25 AliITSHNode(const AliITSHNode &source); // copy constructor
26 AliITSHNode& operator=(const AliITSHNode &source); // ass. op.
27
28 Bool_t IsSortable() const {
29 // is sortable
30 return kTRUE;
31 }
2a941f4e 32 Int_t Compare(const TObject *obj) const;
b0f5e3fc 33
34 ClassDef(AliITSHNode,1) //HuffT node object for set:ITS
e8189707 35
36 public:
37
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
43};
b0f5e3fc 44
45//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
46// Attention! Next class has kept deliberaty in
47// the same file as the previous one
48//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
49//___________________________________________
50class AliITSHTable: public TObject{
51
52public:
53 AliITSHTable();
54 AliITSHTable(Int_t size);
55 virtual ~AliITSHTable();
56 AliITSHTable(const AliITSHTable &source); // copy constructor
57 AliITSHTable& operator=(const AliITSHTable &source); // ass. op.
58
59 Int_t Size() {
60 // size
61 return fSize;
62 }
63 UChar_t *CodeLen() {
64 // code len
65 return fCodeLen;
66 }
67 ULong_t *Code() {
68 // code
69 return fCode;
70 }
71 TObjArray *HNodes() {
72 // HNodes
73 return fHNodes;
74 }
75
76
77 void GetFrequencies(Int_t len, UChar_t *stream);
78 void BuildHTable();
79 Bool_t SpanTree(AliITSHNode*start, ULong_t code, UChar_t len);
80 void ResetHNodes();
e8189707 81 void ClearTable();
b0f5e3fc 82
83 protected:
84
85 Int_t fSize; // size of the arrays
e8189707 86 UChar_t *fCodeLen; //![fSize] number of bits array
87 ULong_t *fCode; //![fSize] coded symbols array
b0f5e3fc 88
e8189707 89 Short_t *fSym; //![fSize] array of input symbols
b0f5e3fc 90 TObjArray *fHNodes; // array of nodes
91 Int_t fNnodes; // number of nodes
92
93 ClassDef(AliITSHTable,1) //Huffman Table object for set:ITS
94 };
95
96#endif