]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/comp/AliHLTTPCCompModelInflater.h
treatment of MC labels added
[u/mrichter/AliRoot.git] / HLT / TPCLib / comp / AliHLTTPCCompModelInflater.h
1 // XEmacs -*-C++-*-
2 // $Id$
3
4 #ifndef ALIHLTTPCCOMPMODELINFLATER_H
5 #define ALIHLTTPCCOMPMODELINFLATER_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                               *
9
10 /** @file   AliHLTTPCCompModelInflater.h
11     @author Timm Steinbeck
12     @date   
13     @brief  Declaration of an uncompressor class for TPC track data. */
14
15 #include "AliHLTTPCTrackArray.h"
16 #include "AliHLTTPCTrackletDataFormat.h"
17 #include "AliHLTTPCClusterDataFormat.h"
18 #include "AliHLTLogging.h"
19 #include "AliHLTTPCModels.h"
20
21 /**
22  * @class AliHLTTPCCompModelInflater
23  * @brief A HLT TPC track compressor. 
24  *
25  * A class that can compress HLT TPC track model data
26  * The model inflater is the counterpart of the deflater component
27  * which decompresses the data after a conversion and compression.
28  * The deflater is followed by a deconverter in order to get the
29  * original standard HLT cluster track format back
30  *
31  */
32 class AliHLTTPCCompModelInflater: public AliHLTLogging
33     {
34     public:
35       /** standard constructor */
36       AliHLTTPCCompModelInflater();
37       /** standard destructor */
38       virtual ~AliHLTTPCCompModelInflater();
39
40       /** function to decompress tracks 
41        * @param inData     AliHLTUInt8_t* pointer to input
42        * @param inputSize  UInt_t const& input data size
43        * @param output     AliHLTUInt8_t* pointer to output
44        * @param outputSize UInt_t& output data size
45        * @return zero upon success
46        */
47         int DecompressTracks( AliHLTUInt8_t* inData, UInt_t const& inputSize, AliHLTUInt8_t* output, UInt_t& outputSize );
48
49       /** function to decompress remaining clusters
50        * @param inData     AliHLTUInt8_t* pointer to input
51        * @param inputSize  UInt_t const& input data size
52        * @param output     AliHLTUInt8_t* pointer to output
53        * @param outputSize UInt_t& output data size
54        * @return zero upon success
55        */
56         int DecompressRemainingClusters( AliHLTUInt8_t* inData, UInt_t const& inputSize, AliHLTUInt8_t* output, UInt_t& outputSize );
57
58     protected:
59
60       /** function to initialise the bit data input
61        * @param input  AliHLTUInt8_t* pointer to input data
62        * @param inputSize UInt_t input data size
63        */
64       void InitBitDataInput( AliHLTUInt8_t* input, UInt_t inputSize );
65
66       /** function to close bit data input */   
67       void CloseBitDataInput()
68       {
69       }
70       
71       /** function to get current byte input position 
72        * @return unsigned long value of current byte input position
73        */
74       unsigned long GetCurrentByteInputPosition() const
75       {
76         return (unsigned long)( fBitDataCurrentInput - fBitDataCurrentInputStart );
77       }
78
79       /** function to get current bit input position
80        * @return unsigned value of current bit input position
81        */
82       unsigned GetCurrentBitInputPosition() const
83       {
84         return fBitDataCurrentPosInWord;
85       }
86
87       /** function to get current input byte
88        * @return AliHLTUInt8_t value of current input byte
89        */
90       AliHLTUInt8_t GetCurrentInputByte() const
91       {
92                 return fBitDataCurrentWord;
93       }
94
95       /** function to determine end of bit input
96        * @return boolean if end is reached or not
97        */
98       bool EndOfBitInput() const
99       {
100         return (fBitDataCurrentInput>=fBitDataCurrentInputEnd);
101       }
102       
103       /** function to get bit data input size bytes
104        * @return UInt_t value of bit data input size bytes
105        */
106       UInt_t GetBitDataInputSizeBytes() const
107       {
108         return fBitDataCurrentInput-fBitDataCurrentInputStart;
109       }
110
111       /** function to determine input bit
112        * @return boolean (if bit is 1 or 0)
113        */
114       bool InputBit( AliHLTUInt8_t & value );
115
116       /** function to determine input bits below 8 bits
117        * @param value    AliHLTUInt8_t &
118        * @param bitCount UInt_t const &
119        * @return boolean 
120        */
121       bool InputBits( AliHLTUInt8_t & value, UInt_t const & bitCount );
122
123       /** function to determine input bits between 8 and 16 bits
124        * @param value    AliHLTUInt16_t &
125        * @param bitCount UInt_t const &
126        * @return boolean 
127        */
128       bool InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount );
129
130       /** function to determine input bits between 16 and 32 bits
131        * @param value    AliHLTUInt32_t &
132        * @param bitCount UInt_t const &
133        * @return boolean 
134        */
135       bool InputBits( AliHLTUInt32_t & value, UInt_t const & bitCount );
136
137       /** function to determine input bits between 16 and 32 bits
138        * @param value    Int_t_t &
139        * @param bitCount UInt_t const &
140        * @return boolean 
141        */
142       bool InputBits( Int_t & value, UInt_t const & bitCount );
143
144       /** function to determine input bits between 32 and 64 bits
145        * @param value    AliHLTUInt64_t &
146        * @param bitCount UInt_t const &
147        * @return boolean 
148        */
149       bool InputBits( AliHLTUInt64_t & value, UInt_t const & bitCount );
150  
151       /** function pad 8 bits */
152       void Pad8Bits();
153
154       /** function to determine input bytes
155        * @param data       AliHLTUInt8_t* pointer to input data
156        * @param byteCount  UInt_t const &
157        * @return boolean
158        */
159       bool InputBytes( AliHLTUInt8_t* data, UInt_t const & byteCount );
160       
161     private:
162       /** copy constructor prohibited */
163       AliHLTTPCCompModelInflater(const AliHLTTPCCompModelInflater&);
164       /** assignment operator prohibited */
165       AliHLTTPCCompModelInflater& operator=(const AliHLTTPCCompModelInflater&);
166
167       /** member variable for bit data current word */
168       AliHLTUInt8_t fBitDataCurrentWord; // member variable for bit data current word
169       /** member variable for bit data current position in word */
170       UInt_t fBitDataCurrentPosInWord;// member variable for bit data current position in word
171       /** member variable for bit data current input */
172       AliHLTUInt8_t *fBitDataCurrentInput; // member variable for bit data current input
173       /** member variable for bit data current input start */
174       AliHLTUInt8_t *fBitDataCurrentInputStart; // member variable for bit data current input star
175       /** member variable for bit data current input end */
176       AliHLTUInt8_t *fBitDataCurrentInputEnd; // member variable for bit data current input end
177       
178       ClassDef(AliHLTTPCCompModelInflater, 0);
179
180             
181
182     };
183 #endif