ROOT logo
// $Id$
//**************************************************************************
//* This file is property of and copyright by the ALICE HLT Project        *
//* ALICE Experiment at CERN, All rights reserved.                         *
//*                                                                        *
//* Primary Authors: Thorsten Kollegger <kollegge@ikf.uni-frankfurt.de>    *
//*                  for The ALICE HLT Project.                            *
//*                                                                        *
//* Permission to use, copy, modify and distribute this software and its   *
//* documentation strictly for non-commercial purposes is hereby granted   *
//* without fee, provided that the above copyright notice appears in all   *
//* copies and that both the copyright notice and this permission notice   *
//* appear in the supporting documentation. The authors make no claims     *
//* about the suitability of this software for any purpose. It is          *
//* provided "as is" without express or implied warranty.                  *
//**************************************************************************

/// @file   AliHLTHuffman.cxx
/// @author Thorsten Kollegger, Matthias Richter
/// @date   2011-08-14
/// @brief  Huffman code generator/encoder/decoder

#include "AliHLTHuffman.h"

#include <iostream>
#include <set>
#include <bitset>
#include <algorithm>

AliHLTHuffmanNode::AliHLTHuffmanNode() 
	: TObject()
	, fValue(-1)
	, fWeight(0.)
{
        // nop
}

AliHLTHuffmanNode::AliHLTHuffmanNode(const AliHLTHuffmanNode& other)
	: TObject()
	, fValue(other.GetValue())
	, fWeight(other.GetWeight())
{
}

AliHLTHuffmanNode& AliHLTHuffmanNode::operator =(const AliHLTHuffmanNode& other) {
        /// assignment operator
        if (this==&other) return *this;
	this->fValue = other.fValue;
	this->fWeight = other.fWeight;
	return *this;
}

AliHLTHuffmanNode::~AliHLTHuffmanNode() {
}

void AliHLTHuffmanNode::AssignCode(bool bReverse) {
        /// assign code to this node loop to right and left nodes
        /// the decoding always has to start from the least significant bit since the
        /// code length is variable. Thats why the bit corresponding to the parent node
        /// has to be right of the bit of child nodes, i.e. bits correspond to the
        /// current code length. For storage in a bit stream however, bits are stored
        /// in a stream from MSB to LSB and overwrapping to the MSBs of the next byte.
        /// Here the reverse code is needed and the word of fixed length read from the
        /// stream needs to be reversed before decoding.
        /// Note: by changing the AliHLTDataDeflater interface to write from LSB to MSB
        /// this can be avoided.
	if (GetLeftChild()) {
	  if (bReverse) {
		std::bitset < 64 > v = (this->GetBinaryCode() << 1);
		v.set(0);
		GetLeftChild()->SetBinaryCode(this->GetBinaryCodeLength() + 1, v);
	  } else {
		std::bitset < 64 > v = (this->GetBinaryCode());
		int codelen=this->GetBinaryCodeLength();
		v.set(codelen);
		GetLeftChild()->SetBinaryCode(codelen + 1, v);
	  }
	  GetLeftChild()->AssignCode(bReverse);
	}
	if (GetRightChild()) {
	  if (bReverse) {
		std::bitset < 64 > v = (this->GetBinaryCode() << 1);
		v.reset(0);
		GetRightChild()->SetBinaryCode(this->GetBinaryCodeLength() + 1, v);
	  } else {
		std::bitset < 64 > v = (this->GetBinaryCode());
		int codelen=this->GetBinaryCodeLength();
		v.reset(codelen);
		GetRightChild()->SetBinaryCode(codelen + 1, v);
	  }
	  GetRightChild()->AssignCode(bReverse);
	}
}

void AliHLTHuffmanNode::Print(Option_t* /*option*/) const {
        /// print info
	std::cout << "value=" << GetValue() << ", weight=" << GetWeight() << ", length="
			<< GetBinaryCodeLength() << ", code=" << GetBinaryCode().to_string()
			<< std::endl;
	if (GetLeftChild()) {
		GetLeftChild()->Print();
	}
	if (GetRightChild()) {
		GetRightChild()->Print();
	}
}

ClassImp(AliHLTHuffmanNode)

///////////////////////////////////////////////////////////////////////////////////////////////

AliHLTHuffmanTreeNode::AliHLTHuffmanTreeNode() 
	: AliHLTHuffmanNode()
	, fBinaryCodeLength(0)
	, fBinaryCode(0)
	, fLeft(NULL)
	, fRight(NULL)
{
        // nop
}

AliHLTHuffmanTreeNode::AliHLTHuffmanTreeNode(const AliHLTHuffmanTreeNode& other)
	: AliHLTHuffmanNode(other)
	, fBinaryCodeLength(other.fBinaryCodeLength)
	, fBinaryCode(other.fBinaryCode)
	, fLeft(other.GetLeftChild())
	, fRight(other.GetRightChild())
{

}

AliHLTHuffmanTreeNode& AliHLTHuffmanTreeNode::operator =(const AliHLTHuffmanTreeNode& other)
{
        /// assignment operator
        if (&other==this) return *this;
	this->fBinaryCodeLength = other.GetBinaryCodeLength();
	this->fBinaryCode = other.GetBinaryCode();
	this->fLeft = other.GetLeftChild();
	this->fRight = other.GetRightChild();
	AliHLTHuffmanNode::operator=(other);
	return *this;
}

AliHLTHuffmanTreeNode::AliHLTHuffmanTreeNode(AliHLTHuffmanNode* l, AliHLTHuffmanNode* r)
	: AliHLTHuffmanNode()
	, fBinaryCodeLength(0)
	, fBinaryCode(0)
	, fLeft(l)
	, fRight(r) {
	if (l && r) {
		SetWeight(l->GetWeight() + r->GetWeight());
	} else if (l && !r) {
		SetWeight(l->GetWeight());
	} else if (!l && r) {
		SetWeight(r->GetWeight());
	}
}

AliHLTHuffmanTreeNode::~AliHLTHuffmanTreeNode() 
{
        // nop
}

ClassImp(AliHLTHuffmanTreeNode)

///////////////////////////////////////////////////////////////////////////////////////////////

AliHLTHuffmanLeaveNode::AliHLTHuffmanLeaveNode() 
	: AliHLTHuffmanNode()
	, fBinaryCodeLength(0)
	, fBinaryCode(0)
	, fLeft(NULL)
	, fRight(NULL)
{
        // nop
}

AliHLTHuffmanLeaveNode::AliHLTHuffmanLeaveNode(const AliHLTHuffmanLeaveNode& other)
	: AliHLTHuffmanNode(other)
	, fBinaryCodeLength(other.fBinaryCodeLength)
	, fBinaryCode(other.fBinaryCode)
	, fLeft(other.GetLeftChild())
	, fRight(other.GetRightChild())
{

}

AliHLTHuffmanLeaveNode& AliHLTHuffmanLeaveNode::operator =(const AliHLTHuffmanLeaveNode& other)
{
        /// assignment operator
        if (&other==this) return *this;
	this->fBinaryCodeLength = other.GetBinaryCodeLength();
	this->fBinaryCode = other.GetBinaryCode();
	this->fLeft = other.GetLeftChild();
	this->fRight = other.GetRightChild();
	AliHLTHuffmanNode::operator=(other);
	return *this;
}

AliHLTHuffmanLeaveNode::~AliHLTHuffmanLeaveNode() 
{
        // nop
}

ClassImp(AliHLTHuffmanLeaveNode)

///////////////////////////////////////////////////////////////////////////////////////////////

AliHLTHuffman::AliHLTHuffman()
	: TNamed()
	, fMaxBits(0)
	, fMaxValue(0)
	, fNodes(0)
	, fHuffTopNode(NULL)
	, fReverseCode(true)
	, fMaxCodeLength(0)
	, fDecodingNodes()
	, fDecodingTopNode(NULL)
{
        /// nop
}

AliHLTHuffman::AliHLTHuffman(const AliHLTHuffman& other)
	: TNamed()
	, AliHLTLogging()
	, fMaxBits(other.fMaxBits)
	, fMaxValue(other.fMaxValue)
	, fNodes(other.fNodes)
	, fHuffTopNode(NULL)
	, fReverseCode(other.fReverseCode)
	, fMaxCodeLength(other.fMaxCodeLength)
	, fDecodingNodes()
	, fDecodingTopNode(NULL)
{
        /// nop
}

AliHLTHuffman::AliHLTHuffman(const char* name, UInt_t maxBits)
        : TNamed(name, name)
	, fMaxBits(maxBits)
	, fMaxValue((((AliHLTUInt64_t) 1) << maxBits) - 1)
	, fNodes((((AliHLTUInt64_t) 1) << maxBits))
	, fHuffTopNode(NULL)
	, fReverseCode(true)
	, fMaxCodeLength(0)
	, fDecodingNodes()
	, fDecodingTopNode(NULL)
 {
        /// standard constructor
	for (AliHLTUInt64_t i = 0; i <= fMaxValue; i++) {
		fNodes[i].SetValue(i);
	}
}

AliHLTHuffman::~AliHLTHuffman() {
        /// destructor, nop
}

const std::bitset<64>& AliHLTHuffman::Encode(const AliHLTUInt64_t v, AliHLTUInt64_t& codeLength) const {
        /// encode a value
	codeLength = 0;
	if (v <= fMaxValue) {
		// valid symbol/value
		if (fHuffTopNode) {
			// huffman code has been generated
			codeLength = fNodes[v].GetBinaryCodeLength();
			return fNodes[v].GetBinaryCode();
		} else {
		  HLTError("encoder '%s' does not seem to be initialized", GetName());
		}
	} else {
	  HLTError("encoder %s: value %llu exceeds range of %d bits", GetName(), v, GetMaxBits());
	}

	static const std::bitset<64> dummy;
	return dummy;
}

Bool_t AliHLTHuffman::DecodeLSB(std::bitset<64> bits, AliHLTUInt64_t& value,
				AliHLTUInt32_t& length, AliHLTUInt32_t& codeLength) const
{
	// huffman decoding
	AliHLTHuffmanNode* currNode = fHuffTopNode;
	if (!currNode) return kFALSE;
	if (currNode->GetValue() >= 0) {
		// handle case with just one node - also quite unlikely
		value = currNode->GetValue();
		return kTRUE;
	}
	while (currNode) {
		if (bits[0] && currNode->GetLeftChild()) {
			// follow left branch
			currNode = currNode->GetLeftChild();
			bits >>= 1;
			if (currNode && currNode->GetValue() >= 0) {
				value = currNode->GetValue();
				length = fMaxBits;
				codeLength = currNode->GetBinaryCodeLength();
				return kTRUE;
			}
			continue;
		}
		if (!bits[0] && currNode->GetRightChild()) {
			currNode = currNode->GetRightChild();
			bits >>= 1;
			if (currNode && currNode->GetValue() >= 0) {
				value = currNode->GetValue();
				length = fMaxBits;
				codeLength = currNode->GetBinaryCodeLength();
				return kTRUE;
			}
			continue;
		}
		break;
	}
	value = ((AliHLTUInt64_t)1) << 63;
	return kFALSE;
}

Bool_t AliHLTHuffman::DecodeMSB(std::bitset<64> bits, AliHLTUInt64_t& value,
			        AliHLTUInt32_t& length, AliHLTUInt32_t& codeLength) const
{
	// huffman decoding
	AliHLTHuffmanNode* currNode = fHuffTopNode;
	if (!currNode) return kFALSE;
	if (currNode->GetValue() >= 0) {
		// handle case with just one node - also quite unlikely
		value = currNode->GetValue();
		return kTRUE;
	}
	while (currNode) {
		if (bits[63] && currNode->GetLeftChild()) {
			// follow left branch
			currNode = currNode->GetLeftChild();
			bits <<= 1;
			if (currNode && currNode->GetValue() >= 0) {
				value = currNode->GetValue();
				length = fMaxBits;
				codeLength = currNode->GetBinaryCodeLength();
				return kTRUE;
			}
			continue;
		}
		if (!bits[63] && currNode->GetRightChild()) {
			currNode = currNode->GetRightChild();
			bits <<= 1;
			if (currNode && currNode->GetValue() >= 0) {
				value = currNode->GetValue();
				length = fMaxBits;
				codeLength = currNode->GetBinaryCodeLength();
				return kTRUE;
			}
			continue;
		}
		break;
	}
	value = ((AliHLTUInt64_t)1) << 63;
	return kFALSE;
}

Bool_t AliHLTHuffman::FastDecodeMSB(std::bitset<64> bits, AliHLTUInt64_t& value,
				    AliHLTUInt32_t& length, AliHLTUInt32_t& codeLength) const
{
	// huffman decoding using the binary node map
        HLTFatal("this function needs to be tested and commisioned");
	AliHuffmanDecodingNode* currNode = fDecodingTopNode;
	if (!currNode) return kFALSE;
	if (currNode->fValue >= 0) {
		// handle case with just one node - also quite unlikely
		value = currNode->fValue;
		return kTRUE;
	}
	while (currNode) {
		if (bits[63] && currNode->fLeft) {
			// follow left branch
			currNode = currNode->fLeft;
			bits <<= 1;
			if (currNode && currNode->fValue >= 0) {
				value = currNode->fValue;
				length = fMaxBits;
				codeLength = currNode->fBinaryCodeLength;
				return kTRUE;
			}
			continue;
		}
		if (!bits[63] && currNode->fRight) {
			currNode = currNode->fRight;
			bits <<= 1;
			if (currNode && currNode->fValue >= 0) {
				value = currNode->fValue;
				length = fMaxBits;
				codeLength = currNode->fBinaryCodeLength;
				return kTRUE;
			}
			continue;
		}
		break;
	}
	value = ((AliHLTUInt64_t)1) << 63;
	return kFALSE;
}

Bool_t AliHLTHuffman::AddTrainingValue(const AliHLTUInt64_t value,
		const Float_t weight) {
	if (value > fMaxValue) {
		/* TODO: ERROR message */
		return kFALSE;
	}
	fNodes[value].AddWeight(weight);
	return kTRUE;
}

Bool_t AliHLTHuffman::GenerateHuffmanTree() {
	// insert pointer to nodes into ordered structure to build tree
	std::multiset<AliHLTHuffmanNode*, AliHLTHuffmanNode::less> nodeCollection;
	//	std::copy(fNodes.begin(), fNodes.end(),
	//			std::inserter(freq_coll, freq_coll.begin()));
	for (std::vector<AliHLTHuffmanLeaveNode>::iterator i = fNodes.begin(); i
			!= fNodes.end(); ++i) {
		nodeCollection.insert(&(*i));
	}
	while (nodeCollection.size() > 1) {
		// insert new node into structure, combining the two with lowest probability
		AliHLTHuffmanNode* node=new AliHLTHuffmanTreeNode(*nodeCollection.begin(), *++nodeCollection.begin());
		if (!node) return kFALSE;
		nodeCollection.insert(node);
		nodeCollection.erase(nodeCollection.begin());
		nodeCollection.erase(nodeCollection.begin());
	}
	//assign value
	fHuffTopNode = *nodeCollection.begin();
	fHuffTopNode->AssignCode(fReverseCode);
	InitMaxCodeLength();
	return kTRUE;
}

void AliHLTHuffman::Print(Option_t* option) const {
        std::cout << GetName() << endl;
        bool bPrintShort=strcmp(option, "full")!=0;
	if (fHuffTopNode && !bPrintShort) {
		std::cout << "Huffman tree:" << endl;
		fHuffTopNode->Print();
	}
	Double_t uncompressedSize = 0;
	Double_t compressedSize = 0;
	Double_t totalWeight = 0;
	if (!bPrintShort)
	  std::cout << std::endl << "Huffman codes:" << std::endl;
	for (AliHLTUInt64_t i = 0; i <= fMaxValue; i++) {
	  if (!bPrintShort) fNodes[i].Print();
		totalWeight += fNodes[i].GetWeight();
		uncompressedSize += fNodes[i].GetWeight() * fMaxBits;
		compressedSize += fNodes[i].GetWeight()
				* fNodes[i].GetBinaryCodeLength();
	}
	if (uncompressedSize > 0) {
		std::cout << "compression ratio: " << compressedSize
				/ uncompressedSize << std::endl;
		std::cout << "<bits> uncompressed: " << uncompressedSize / totalWeight
				<< std::endl;
		std::cout << "<bits> compressed:   " << compressedSize / totalWeight
				<< std::endl;
	}
}

AliHLTHuffman& AliHLTHuffman::operator =(const AliHLTHuffman& other) {
        if (this==&other) return *this;
	fMaxValue = other.fMaxValue;
	fNodes = other.fNodes;
	fHuffTopNode = NULL;
	fMaxCodeLength = 0;
	return *this;
}

bool AliHLTHuffman::CheckConsistency() const
{
  if (!fHuffTopNode) {
    cout << "huffman table not yet generated" << endl;
  }

  for (AliHLTUInt64_t v=0; v<GetMaxValue(); v++) {
    AliHLTUInt64_t codeLength=0;
    std::bitset<64> code=AliHLTHuffman::Encode(v, codeLength);
    AliHLTUInt64_t readback=0;
    AliHLTUInt32_t readbacklen=0;
    AliHLTUInt32_t readbackcodelen=0;
    if (fReverseCode) {
      code<<=64-codeLength;
      if (!DecodeMSB(code, readback, readbacklen, readbackcodelen)) {
	cout << "Decode failed" << endl;
	return false;
      }
    } else {
    if (!DecodeLSB(code, readback, readbacklen, readbackcodelen)) {
      cout << "Decode failed" << endl;
      return false;
    }
    }
    if (v!=readback) {
      cout << "readback of value " << v << " code length " << codeLength << " failed: got " << readback << " code length " << readbackcodelen << endl;
      return false;
    }
  }
  return true;
}

UInt_t AliHLTHuffman::InitMaxCodeLength()
{
  // loop over leave nodes and set maximum code length
  fMaxCodeLength=0;
  for (std::vector<AliHLTHuffmanLeaveNode>::const_iterator node=fNodes.begin();
       node!=fNodes.end(); node++) {
    if (fMaxCodeLength<node->GetBinaryCodeLength())
      fMaxCodeLength=node->GetBinaryCodeLength();
  }
  return fMaxCodeLength;
}

int AliHLTHuffman::EnableDecodingMap()
{
  // build decoder nodes from node tree
  fDecodingTopNode=NULL;
  fDecodingNodes.clear();
  if (fNodes.size()==0) {
    return 0;
  }
  fDecodingNodes.reserve(2*fNodes.size());
  fDecodingTopNode=BuildDecodingNode(fHuffTopNode, fDecodingNodes);
  if (!fDecodingTopNode) {
    fDecodingNodes.clear();
  } else {
    HLTError("decoder nodes created sucessfully");
  }
  return 0;
}

AliHLTHuffman::AliHuffmanDecodingNode* AliHLTHuffman::BuildDecodingNode(AliHLTHuffmanNode* node, vector<AliHuffmanDecodingNode>& decodernodes) const
{
  // build and add decoder node structure corresponding to huffman node
  if (!node) {
    HLTError("invalid node pointer");
    return NULL;
  }
  for (vector<AliHuffmanDecodingNode>::iterator i=decodernodes.begin();
       i!=decodernodes.end(); i++) {
    if (i->fParent==node) {
      HLTError("node %p already existing in decoder nodes", node);
      return NULL;
    }
  }

  AliHuffmanDecodingNode* decodernode=NULL;
  if (decodernodes.size()+1>decodernodes.capacity()) {
    HLTError("initial size of array too small, can not add more nodes because pointers will become invalid when growing vector");
  } else {
    AliHuffmanDecodingNode dn;
    dn.fParent=node;
    dn.fValue=node->GetValue();
    dn.fLeft=NULL;
    dn.fRight=NULL;
    dn.fBinaryCodeLength=0;
    decodernodes.push_back(dn);
    decodernode=&(decodernodes.back());
  }

  if (decodernode && decodernode->fValue<0) {
    decodernode->fRight=BuildDecodingNode(node->GetRightChild(), decodernodes);
    decodernode->fLeft=BuildDecodingNode(node->GetLeftChild(), decodernodes);
    if (decodernode->fLeft==NULL || decodernode->fRight==0) {
      HLTError("failed to build corresponding decoder node for node %p", node);
      decodernode=NULL;
    }
  }

  return decodernode;
}

ClassImp(AliHLTHuffman)

 AliHLTHuffman.cxx:1
 AliHLTHuffman.cxx:2
 AliHLTHuffman.cxx:3
 AliHLTHuffman.cxx:4
 AliHLTHuffman.cxx:5
 AliHLTHuffman.cxx:6
 AliHLTHuffman.cxx:7
 AliHLTHuffman.cxx:8
 AliHLTHuffman.cxx:9
 AliHLTHuffman.cxx:10
 AliHLTHuffman.cxx:11
 AliHLTHuffman.cxx:12
 AliHLTHuffman.cxx:13
 AliHLTHuffman.cxx:14
 AliHLTHuffman.cxx:15
 AliHLTHuffman.cxx:16
 AliHLTHuffman.cxx:17
 AliHLTHuffman.cxx:18
 AliHLTHuffman.cxx:19
 AliHLTHuffman.cxx:20
 AliHLTHuffman.cxx:21
 AliHLTHuffman.cxx:22
 AliHLTHuffman.cxx:23
 AliHLTHuffman.cxx:24
 AliHLTHuffman.cxx:25
 AliHLTHuffman.cxx:26
 AliHLTHuffman.cxx:27
 AliHLTHuffman.cxx:28
 AliHLTHuffman.cxx:29
 AliHLTHuffman.cxx:30
 AliHLTHuffman.cxx:31
 AliHLTHuffman.cxx:32
 AliHLTHuffman.cxx:33
 AliHLTHuffman.cxx:34
 AliHLTHuffman.cxx:35
 AliHLTHuffman.cxx:36
 AliHLTHuffman.cxx:37
 AliHLTHuffman.cxx:38
 AliHLTHuffman.cxx:39
 AliHLTHuffman.cxx:40
 AliHLTHuffman.cxx:41
 AliHLTHuffman.cxx:42
 AliHLTHuffman.cxx:43
 AliHLTHuffman.cxx:44
 AliHLTHuffman.cxx:45
 AliHLTHuffman.cxx:46
 AliHLTHuffman.cxx:47
 AliHLTHuffman.cxx:48
 AliHLTHuffman.cxx:49
 AliHLTHuffman.cxx:50
 AliHLTHuffman.cxx:51
 AliHLTHuffman.cxx:52
 AliHLTHuffman.cxx:53
 AliHLTHuffman.cxx:54
 AliHLTHuffman.cxx:55
 AliHLTHuffman.cxx:56
 AliHLTHuffman.cxx:57
 AliHLTHuffman.cxx:58
 AliHLTHuffman.cxx:59
 AliHLTHuffman.cxx:60
 AliHLTHuffman.cxx:61
 AliHLTHuffman.cxx:62
 AliHLTHuffman.cxx:63
 AliHLTHuffman.cxx:64
 AliHLTHuffman.cxx:65
 AliHLTHuffman.cxx:66
 AliHLTHuffman.cxx:67
 AliHLTHuffman.cxx:68
 AliHLTHuffman.cxx:69
 AliHLTHuffman.cxx:70
 AliHLTHuffman.cxx:71
 AliHLTHuffman.cxx:72
 AliHLTHuffman.cxx:73
 AliHLTHuffman.cxx:74
 AliHLTHuffman.cxx:75
 AliHLTHuffman.cxx:76
 AliHLTHuffman.cxx:77
 AliHLTHuffman.cxx:78
 AliHLTHuffman.cxx:79
 AliHLTHuffman.cxx:80
 AliHLTHuffman.cxx:81
 AliHLTHuffman.cxx:82
 AliHLTHuffman.cxx:83
 AliHLTHuffman.cxx:84
 AliHLTHuffman.cxx:85
 AliHLTHuffman.cxx:86
 AliHLTHuffman.cxx:87
 AliHLTHuffman.cxx:88
 AliHLTHuffman.cxx:89
 AliHLTHuffman.cxx:90
 AliHLTHuffman.cxx:91
 AliHLTHuffman.cxx:92
 AliHLTHuffman.cxx:93
 AliHLTHuffman.cxx:94
 AliHLTHuffman.cxx:95
 AliHLTHuffman.cxx:96
 AliHLTHuffman.cxx:97
 AliHLTHuffman.cxx:98
 AliHLTHuffman.cxx:99
 AliHLTHuffman.cxx:100
 AliHLTHuffman.cxx:101
 AliHLTHuffman.cxx:102
 AliHLTHuffman.cxx:103
 AliHLTHuffman.cxx:104
 AliHLTHuffman.cxx:105
 AliHLTHuffman.cxx:106
 AliHLTHuffman.cxx:107
 AliHLTHuffman.cxx:108
 AliHLTHuffman.cxx:109
 AliHLTHuffman.cxx:110
 AliHLTHuffman.cxx:111
 AliHLTHuffman.cxx:112
 AliHLTHuffman.cxx:113
 AliHLTHuffman.cxx:114
 AliHLTHuffman.cxx:115
 AliHLTHuffman.cxx:116
 AliHLTHuffman.cxx:117
 AliHLTHuffman.cxx:118
 AliHLTHuffman.cxx:119
 AliHLTHuffman.cxx:120
 AliHLTHuffman.cxx:121
 AliHLTHuffman.cxx:122
 AliHLTHuffman.cxx:123
 AliHLTHuffman.cxx:124
 AliHLTHuffman.cxx:125
 AliHLTHuffman.cxx:126
 AliHLTHuffman.cxx:127
 AliHLTHuffman.cxx:128
 AliHLTHuffman.cxx:129
 AliHLTHuffman.cxx:130
 AliHLTHuffman.cxx:131
 AliHLTHuffman.cxx:132
 AliHLTHuffman.cxx:133
 AliHLTHuffman.cxx:134
 AliHLTHuffman.cxx:135
 AliHLTHuffman.cxx:136
 AliHLTHuffman.cxx:137
 AliHLTHuffman.cxx:138
 AliHLTHuffman.cxx:139
 AliHLTHuffman.cxx:140
 AliHLTHuffman.cxx:141
 AliHLTHuffman.cxx:142
 AliHLTHuffman.cxx:143
 AliHLTHuffman.cxx:144
 AliHLTHuffman.cxx:145
 AliHLTHuffman.cxx:146
 AliHLTHuffman.cxx:147
 AliHLTHuffman.cxx:148
 AliHLTHuffman.cxx:149
 AliHLTHuffman.cxx:150
 AliHLTHuffman.cxx:151
 AliHLTHuffman.cxx:152
 AliHLTHuffman.cxx:153
 AliHLTHuffman.cxx:154
 AliHLTHuffman.cxx:155
 AliHLTHuffman.cxx:156
 AliHLTHuffman.cxx:157
 AliHLTHuffman.cxx:158
 AliHLTHuffman.cxx:159
 AliHLTHuffman.cxx:160
 AliHLTHuffman.cxx:161
 AliHLTHuffman.cxx:162
 AliHLTHuffman.cxx:163
 AliHLTHuffman.cxx:164
 AliHLTHuffman.cxx:165
 AliHLTHuffman.cxx:166
 AliHLTHuffman.cxx:167
 AliHLTHuffman.cxx:168
 AliHLTHuffman.cxx:169
 AliHLTHuffman.cxx:170
 AliHLTHuffman.cxx:171
 AliHLTHuffman.cxx:172
 AliHLTHuffman.cxx:173
 AliHLTHuffman.cxx:174
 AliHLTHuffman.cxx:175
 AliHLTHuffman.cxx:176
 AliHLTHuffman.cxx:177
 AliHLTHuffman.cxx:178
 AliHLTHuffman.cxx:179
 AliHLTHuffman.cxx:180
 AliHLTHuffman.cxx:181
 AliHLTHuffman.cxx:182
 AliHLTHuffman.cxx:183
 AliHLTHuffman.cxx:184
 AliHLTHuffman.cxx:185
 AliHLTHuffman.cxx:186
 AliHLTHuffman.cxx:187
 AliHLTHuffman.cxx:188
 AliHLTHuffman.cxx:189
 AliHLTHuffman.cxx:190
 AliHLTHuffman.cxx:191
 AliHLTHuffman.cxx:192
 AliHLTHuffman.cxx:193
 AliHLTHuffman.cxx:194
 AliHLTHuffman.cxx:195
 AliHLTHuffman.cxx:196
 AliHLTHuffman.cxx:197
 AliHLTHuffman.cxx:198
 AliHLTHuffman.cxx:199
 AliHLTHuffman.cxx:200
 AliHLTHuffman.cxx:201
 AliHLTHuffman.cxx:202
 AliHLTHuffman.cxx:203
 AliHLTHuffman.cxx:204
 AliHLTHuffman.cxx:205
 AliHLTHuffman.cxx:206
 AliHLTHuffman.cxx:207
 AliHLTHuffman.cxx:208
 AliHLTHuffman.cxx:209
 AliHLTHuffman.cxx:210
 AliHLTHuffman.cxx:211
 AliHLTHuffman.cxx:212
 AliHLTHuffman.cxx:213
 AliHLTHuffman.cxx:214
 AliHLTHuffman.cxx:215
 AliHLTHuffman.cxx:216
 AliHLTHuffman.cxx:217
 AliHLTHuffman.cxx:218
 AliHLTHuffman.cxx:219
 AliHLTHuffman.cxx:220
 AliHLTHuffman.cxx:221
 AliHLTHuffman.cxx:222
 AliHLTHuffman.cxx:223
 AliHLTHuffman.cxx:224
 AliHLTHuffman.cxx:225
 AliHLTHuffman.cxx:226
 AliHLTHuffman.cxx:227
 AliHLTHuffman.cxx:228
 AliHLTHuffman.cxx:229
 AliHLTHuffman.cxx:230
 AliHLTHuffman.cxx:231
 AliHLTHuffman.cxx:232
 AliHLTHuffman.cxx:233
 AliHLTHuffman.cxx:234
 AliHLTHuffman.cxx:235
 AliHLTHuffman.cxx:236
 AliHLTHuffman.cxx:237
 AliHLTHuffman.cxx:238
 AliHLTHuffman.cxx:239
 AliHLTHuffman.cxx:240
 AliHLTHuffman.cxx:241
 AliHLTHuffman.cxx:242
 AliHLTHuffman.cxx:243
 AliHLTHuffman.cxx:244
 AliHLTHuffman.cxx:245
 AliHLTHuffman.cxx:246
 AliHLTHuffman.cxx:247
 AliHLTHuffman.cxx:248
 AliHLTHuffman.cxx:249
 AliHLTHuffman.cxx:250
 AliHLTHuffman.cxx:251
 AliHLTHuffman.cxx:252
 AliHLTHuffman.cxx:253
 AliHLTHuffman.cxx:254
 AliHLTHuffman.cxx:255
 AliHLTHuffman.cxx:256
 AliHLTHuffman.cxx:257
 AliHLTHuffman.cxx:258
 AliHLTHuffman.cxx:259
 AliHLTHuffman.cxx:260
 AliHLTHuffman.cxx:261
 AliHLTHuffman.cxx:262
 AliHLTHuffman.cxx:263
 AliHLTHuffman.cxx:264
 AliHLTHuffman.cxx:265
 AliHLTHuffman.cxx:266
 AliHLTHuffman.cxx:267
 AliHLTHuffman.cxx:268
 AliHLTHuffman.cxx:269
 AliHLTHuffman.cxx:270
 AliHLTHuffman.cxx:271
 AliHLTHuffman.cxx:272
 AliHLTHuffman.cxx:273
 AliHLTHuffman.cxx:274
 AliHLTHuffman.cxx:275
 AliHLTHuffman.cxx:276
 AliHLTHuffman.cxx:277
 AliHLTHuffman.cxx:278
 AliHLTHuffman.cxx:279
 AliHLTHuffman.cxx:280
 AliHLTHuffman.cxx:281
 AliHLTHuffman.cxx:282
 AliHLTHuffman.cxx:283
 AliHLTHuffman.cxx:284
 AliHLTHuffman.cxx:285
 AliHLTHuffman.cxx:286
 AliHLTHuffman.cxx:287
 AliHLTHuffman.cxx:288
 AliHLTHuffman.cxx:289
 AliHLTHuffman.cxx:290
 AliHLTHuffman.cxx:291
 AliHLTHuffman.cxx:292
 AliHLTHuffman.cxx:293
 AliHLTHuffman.cxx:294
 AliHLTHuffman.cxx:295
 AliHLTHuffman.cxx:296
 AliHLTHuffman.cxx:297
 AliHLTHuffman.cxx:298
 AliHLTHuffman.cxx:299
 AliHLTHuffman.cxx:300
 AliHLTHuffman.cxx:301
 AliHLTHuffman.cxx:302
 AliHLTHuffman.cxx:303
 AliHLTHuffman.cxx:304
 AliHLTHuffman.cxx:305
 AliHLTHuffman.cxx:306
 AliHLTHuffman.cxx:307
 AliHLTHuffman.cxx:308
 AliHLTHuffman.cxx:309
 AliHLTHuffman.cxx:310
 AliHLTHuffman.cxx:311
 AliHLTHuffman.cxx:312
 AliHLTHuffman.cxx:313
 AliHLTHuffman.cxx:314
 AliHLTHuffman.cxx:315
 AliHLTHuffman.cxx:316
 AliHLTHuffman.cxx:317
 AliHLTHuffman.cxx:318
 AliHLTHuffman.cxx:319
 AliHLTHuffman.cxx:320
 AliHLTHuffman.cxx:321
 AliHLTHuffman.cxx:322
 AliHLTHuffman.cxx:323
 AliHLTHuffman.cxx:324
 AliHLTHuffman.cxx:325
 AliHLTHuffman.cxx:326
 AliHLTHuffman.cxx:327
 AliHLTHuffman.cxx:328
 AliHLTHuffman.cxx:329
 AliHLTHuffman.cxx:330
 AliHLTHuffman.cxx:331
 AliHLTHuffman.cxx:332
 AliHLTHuffman.cxx:333
 AliHLTHuffman.cxx:334
 AliHLTHuffman.cxx:335
 AliHLTHuffman.cxx:336
 AliHLTHuffman.cxx:337
 AliHLTHuffman.cxx:338
 AliHLTHuffman.cxx:339
 AliHLTHuffman.cxx:340
 AliHLTHuffman.cxx:341
 AliHLTHuffman.cxx:342
 AliHLTHuffman.cxx:343
 AliHLTHuffman.cxx:344
 AliHLTHuffman.cxx:345
 AliHLTHuffman.cxx:346
 AliHLTHuffman.cxx:347
 AliHLTHuffman.cxx:348
 AliHLTHuffman.cxx:349
 AliHLTHuffman.cxx:350
 AliHLTHuffman.cxx:351
 AliHLTHuffman.cxx:352
 AliHLTHuffman.cxx:353
 AliHLTHuffman.cxx:354
 AliHLTHuffman.cxx:355
 AliHLTHuffman.cxx:356
 AliHLTHuffman.cxx:357
 AliHLTHuffman.cxx:358
 AliHLTHuffman.cxx:359
 AliHLTHuffman.cxx:360
 AliHLTHuffman.cxx:361
 AliHLTHuffman.cxx:362
 AliHLTHuffman.cxx:363
 AliHLTHuffman.cxx:364
 AliHLTHuffman.cxx:365
 AliHLTHuffman.cxx:366
 AliHLTHuffman.cxx:367
 AliHLTHuffman.cxx:368
 AliHLTHuffman.cxx:369
 AliHLTHuffman.cxx:370
 AliHLTHuffman.cxx:371
 AliHLTHuffman.cxx:372
 AliHLTHuffman.cxx:373
 AliHLTHuffman.cxx:374
 AliHLTHuffman.cxx:375
 AliHLTHuffman.cxx:376
 AliHLTHuffman.cxx:377
 AliHLTHuffman.cxx:378
 AliHLTHuffman.cxx:379
 AliHLTHuffman.cxx:380
 AliHLTHuffman.cxx:381
 AliHLTHuffman.cxx:382
 AliHLTHuffman.cxx:383
 AliHLTHuffman.cxx:384
 AliHLTHuffman.cxx:385
 AliHLTHuffman.cxx:386
 AliHLTHuffman.cxx:387
 AliHLTHuffman.cxx:388
 AliHLTHuffman.cxx:389
 AliHLTHuffman.cxx:390
 AliHLTHuffman.cxx:391
 AliHLTHuffman.cxx:392
 AliHLTHuffman.cxx:393
 AliHLTHuffman.cxx:394
 AliHLTHuffman.cxx:395
 AliHLTHuffman.cxx:396
 AliHLTHuffman.cxx:397
 AliHLTHuffman.cxx:398
 AliHLTHuffman.cxx:399
 AliHLTHuffman.cxx:400
 AliHLTHuffman.cxx:401
 AliHLTHuffman.cxx:402
 AliHLTHuffman.cxx:403
 AliHLTHuffman.cxx:404
 AliHLTHuffman.cxx:405
 AliHLTHuffman.cxx:406
 AliHLTHuffman.cxx:407
 AliHLTHuffman.cxx:408
 AliHLTHuffman.cxx:409
 AliHLTHuffman.cxx:410
 AliHLTHuffman.cxx:411
 AliHLTHuffman.cxx:412
 AliHLTHuffman.cxx:413
 AliHLTHuffman.cxx:414
 AliHLTHuffman.cxx:415
 AliHLTHuffman.cxx:416
 AliHLTHuffman.cxx:417
 AliHLTHuffman.cxx:418
 AliHLTHuffman.cxx:419
 AliHLTHuffman.cxx:420
 AliHLTHuffman.cxx:421
 AliHLTHuffman.cxx:422
 AliHLTHuffman.cxx:423
 AliHLTHuffman.cxx:424
 AliHLTHuffman.cxx:425
 AliHLTHuffman.cxx:426
 AliHLTHuffman.cxx:427
 AliHLTHuffman.cxx:428
 AliHLTHuffman.cxx:429
 AliHLTHuffman.cxx:430
 AliHLTHuffman.cxx:431
 AliHLTHuffman.cxx:432
 AliHLTHuffman.cxx:433
 AliHLTHuffman.cxx:434
 AliHLTHuffman.cxx:435
 AliHLTHuffman.cxx:436
 AliHLTHuffman.cxx:437
 AliHLTHuffman.cxx:438
 AliHLTHuffman.cxx:439
 AliHLTHuffman.cxx:440
 AliHLTHuffman.cxx:441
 AliHLTHuffman.cxx:442
 AliHLTHuffman.cxx:443
 AliHLTHuffman.cxx:444
 AliHLTHuffman.cxx:445
 AliHLTHuffman.cxx:446
 AliHLTHuffman.cxx:447
 AliHLTHuffman.cxx:448
 AliHLTHuffman.cxx:449
 AliHLTHuffman.cxx:450
 AliHLTHuffman.cxx:451
 AliHLTHuffman.cxx:452
 AliHLTHuffman.cxx:453
 AliHLTHuffman.cxx:454
 AliHLTHuffman.cxx:455
 AliHLTHuffman.cxx:456
 AliHLTHuffman.cxx:457
 AliHLTHuffman.cxx:458
 AliHLTHuffman.cxx:459
 AliHLTHuffman.cxx:460
 AliHLTHuffman.cxx:461
 AliHLTHuffman.cxx:462
 AliHLTHuffman.cxx:463
 AliHLTHuffman.cxx:464
 AliHLTHuffman.cxx:465
 AliHLTHuffman.cxx:466
 AliHLTHuffman.cxx:467
 AliHLTHuffman.cxx:468
 AliHLTHuffman.cxx:469
 AliHLTHuffman.cxx:470
 AliHLTHuffman.cxx:471
 AliHLTHuffman.cxx:472
 AliHLTHuffman.cxx:473
 AliHLTHuffman.cxx:474
 AliHLTHuffman.cxx:475
 AliHLTHuffman.cxx:476
 AliHLTHuffman.cxx:477
 AliHLTHuffman.cxx:478
 AliHLTHuffman.cxx:479
 AliHLTHuffman.cxx:480
 AliHLTHuffman.cxx:481
 AliHLTHuffman.cxx:482
 AliHLTHuffman.cxx:483
 AliHLTHuffman.cxx:484
 AliHLTHuffman.cxx:485
 AliHLTHuffman.cxx:486
 AliHLTHuffman.cxx:487
 AliHLTHuffman.cxx:488
 AliHLTHuffman.cxx:489
 AliHLTHuffman.cxx:490
 AliHLTHuffman.cxx:491
 AliHLTHuffman.cxx:492
 AliHLTHuffman.cxx:493
 AliHLTHuffman.cxx:494
 AliHLTHuffman.cxx:495
 AliHLTHuffman.cxx:496
 AliHLTHuffman.cxx:497
 AliHLTHuffman.cxx:498
 AliHLTHuffman.cxx:499
 AliHLTHuffman.cxx:500
 AliHLTHuffman.cxx:501
 AliHLTHuffman.cxx:502
 AliHLTHuffman.cxx:503
 AliHLTHuffman.cxx:504
 AliHLTHuffman.cxx:505
 AliHLTHuffman.cxx:506
 AliHLTHuffman.cxx:507
 AliHLTHuffman.cxx:508
 AliHLTHuffman.cxx:509
 AliHLTHuffman.cxx:510
 AliHLTHuffman.cxx:511
 AliHLTHuffman.cxx:512
 AliHLTHuffman.cxx:513
 AliHLTHuffman.cxx:514
 AliHLTHuffman.cxx:515
 AliHLTHuffman.cxx:516
 AliHLTHuffman.cxx:517
 AliHLTHuffman.cxx:518
 AliHLTHuffman.cxx:519
 AliHLTHuffman.cxx:520
 AliHLTHuffman.cxx:521
 AliHLTHuffman.cxx:522
 AliHLTHuffman.cxx:523
 AliHLTHuffman.cxx:524
 AliHLTHuffman.cxx:525
 AliHLTHuffman.cxx:526
 AliHLTHuffman.cxx:527
 AliHLTHuffman.cxx:528
 AliHLTHuffman.cxx:529
 AliHLTHuffman.cxx:530
 AliHLTHuffman.cxx:531
 AliHLTHuffman.cxx:532
 AliHLTHuffman.cxx:533
 AliHLTHuffman.cxx:534
 AliHLTHuffman.cxx:535
 AliHLTHuffman.cxx:536
 AliHLTHuffman.cxx:537
 AliHLTHuffman.cxx:538
 AliHLTHuffman.cxx:539
 AliHLTHuffman.cxx:540
 AliHLTHuffman.cxx:541
 AliHLTHuffman.cxx:542
 AliHLTHuffman.cxx:543
 AliHLTHuffman.cxx:544
 AliHLTHuffman.cxx:545
 AliHLTHuffman.cxx:546
 AliHLTHuffman.cxx:547
 AliHLTHuffman.cxx:548
 AliHLTHuffman.cxx:549
 AliHLTHuffman.cxx:550
 AliHLTHuffman.cxx:551
 AliHLTHuffman.cxx:552
 AliHLTHuffman.cxx:553
 AliHLTHuffman.cxx:554
 AliHLTHuffman.cxx:555
 AliHLTHuffman.cxx:556
 AliHLTHuffman.cxx:557
 AliHLTHuffman.cxx:558
 AliHLTHuffman.cxx:559
 AliHLTHuffman.cxx:560
 AliHLTHuffman.cxx:561
 AliHLTHuffman.cxx:562
 AliHLTHuffman.cxx:563
 AliHLTHuffman.cxx:564
 AliHLTHuffman.cxx:565
 AliHLTHuffman.cxx:566
 AliHLTHuffman.cxx:567
 AliHLTHuffman.cxx:568
 AliHLTHuffman.cxx:569
 AliHLTHuffman.cxx:570
 AliHLTHuffman.cxx:571
 AliHLTHuffman.cxx:572
 AliHLTHuffman.cxx:573
 AliHLTHuffman.cxx:574
 AliHLTHuffman.cxx:575
 AliHLTHuffman.cxx:576
 AliHLTHuffman.cxx:577
 AliHLTHuffman.cxx:578
 AliHLTHuffman.cxx:579