4 #ifndef ALIHLTTPCCOMPMODELDEFLATER_H
5 #define ALIHLTTPCCOMPMODELDEFLATER_H
6 //* This file is property of and copyright by the ALICE HLT Project *
7 //* ALICE Experiment at CERN, All rights reserved. *
8 //* See cxx source for full Copyright notice *
10 /** @file AliHLTTPCCompModelDeflater.h
11 @author Timm Steinbeck
13 @brief Declaration of a compressor class for TPC track data. */
15 #include "AliHLTTPCTrackArray.h"
16 #include "AliHLTTPCTrackletDataFormat.h"
17 #include "AliHLTTPCClusterDataFormat.h"
18 #include "AliHLTLogging.h"
19 #include "AliHLTTPCModels.h"
22 * @class AliHLTTPCCompModelDeflater
23 * @brief A HLT TPC track compressor.
25 * A class that can compress HLT TPC track model data
27 class AliHLTTPCCompModelDeflater: public AliHLTLogging
30 /** standard constructor */
31 AliHLTTPCCompModelDeflater();
32 /** standard destructor */
33 virtual ~AliHLTTPCCompModelDeflater();
35 /** function to write shape */
36 void WriteShape( bool write=true )
41 /** function to compress tracks
42 * @param inData AliHLTUInt8_t* pointer to input data
43 * @param inputSize UInt_t const& input size
44 * @param output AliHLTUInt8_t* pointer to output data
45 * @param outputSize UInt_t& output size
46 * @return zero upon success
48 int CompressTracks( AliHLTUInt8_t* inData, UInt_t const& inputSize, AliHLTUInt8_t* output, UInt_t& outputSize );
50 /** function to compress remaining clusters
51 * @param inData AliHLTUInt8_t* pointer to input data
52 * @param inputSize UInt_t const& input size
53 * @param output AliHLTUInt8_t* pointer to output data
54 * @param outputSize UInt_t& output size
55 * @return zero upon success
57 int CompressRemainingClusters( AliHLTUInt8_t* inData, UInt_t const& inputSize, AliHLTUInt8_t* output, UInt_t& outputSize );
61 /** member variable to write shape */
62 bool fWriteShape; // member variable to write shape
64 /** function to initialise bit data output
65 * @param output AliHLTUInt8_t* pointer to output data
66 * @param outputSize UInt_t output size
68 void InitBitDataOutput( AliHLTUInt8_t* output, UInt_t outputSize );
70 /** function to close bit data output */
71 void CloseBitDataOutput()
76 /** function to get current byte output position
77 * @return unsigned long value for current byte output position
79 unsigned long GetCurrentByteOutputPosition() const
81 return (unsigned long)( fBitDataCurrentOutput - fBitDataCurrentOutputStart );
84 /** function to get current bit output position
85 * @return unsigned long value for current bit output position
87 unsigned GetCurrentBitOutputPosition() const
89 return fBitDataCurrentPosInWord;
92 /** function to get current output byte
93 * @param offset Int_t (set to zero if not specified explicitly)
94 * @return AliHLTUInt8_t value for current output byte
96 AliHLTUInt8_t GetCurrentOutputByte( Int_t offset=0 ) const;
98 /** function to get bit data output size bytes
99 * @return UInt_t value of bit data output size bytes
101 UInt_t GetBitDataOutputSizeBytes() const
103 return fBitDataCurrentOutput-fBitDataCurrentOutputStart;
106 /** function for output bit
107 * @param value AliHLTUInt32_t const & input
108 * @return boolean (output bit)
110 bool OutputBit( AliHLTUInt32_t const & value );
112 /** function to output bits
113 * @param value AliHLTUInt64_t const &
114 * @param bitCount UInt_t const &
115 * @return zero upon success
117 bool OutputBits( AliHLTUInt64_t const & value, UInt_t const & bitCount );
119 /** function pad 8 bits */
122 /** function to output bytes
123 * @param data AliHLTUInt8_t const *
124 * @param byteCount UInt_t const &
125 * @return boolean (output bytes)
127 bool OutputBytes( AliHLTUInt8_t const * data, UInt_t const & byteCount );
129 /** copy constructor prohibited */
130 AliHLTTPCCompModelDeflater(const AliHLTTPCCompModelDeflater&);
131 /** assignment operator prohibited */
132 AliHLTTPCCompModelDeflater& operator=(const AliHLTTPCCompModelDeflater&);
134 /** member variable for bit data current word */
135 AliHLTUInt8_t fBitDataCurrentWord; // member variable for bit data current word
136 /** member variable for bit data current position in word */
137 UInt_t fBitDataCurrentPosInWord; // member variable for bit data current position in word
138 /** member variable for bit data current output */
139 AliHLTUInt8_t *fBitDataCurrentOutput; // member variable for bit data current output
140 /** member variable for bit data current output start */
141 AliHLTUInt8_t *fBitDataCurrentOutputStart; // member variable for bit data current output start
142 /** member variable for bit data current output end */
143 AliHLTUInt8_t *fBitDataCurrentOutputEnd; // member variable for bit data current output end
145 ClassDef(AliHLTTPCCompModelDeflater, 0);