3 #ifndef ALIHLTCOMPHUFFMANALTROCOMPONENT_H
4 #define ALIHLTCOMPHUFFMANALTROCOMPONENT_H
6 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * See cxx source for full Copyright notice */
9 /** @file AliHLTCOMPHuffmanAltroComponent.h
12 @brief The Huffman compressor component.
15 #include "AliHLTProcessor.h"
17 class AliHLTCOMPHuffmanAltro;
18 class AliHLTCOMPHuffmanData;
21 * @class AliHLTCOMPHuffmanAltroComponent
22 * Implementation of the Huffman compressor component.
23 * The component implements the interface methods of the @ref AliHLTProcessor.
24 * The actual Huffman compression and decompression algorithms are implemented in @ref AliHLTCOMPHuffmanAltro.
25 * The component can handle compressed and decompressed data of different formats.
26 * Two components are registered, the HuffmanCompressor and the HuffmanDecompressor.
27 * Component ID: \b COMPHuffmanCompressor, COMPHuffmanCompressor <br>
28 * Library: \b libAliHLTComp
30 * Mandatory arguments: <br>
31 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
32 * \li -origin <i> detector <\i> <br>
33 * set origin of data to specify Huffman code table to be read in (parameter transient)
34 * \li -runnumber <i> decimal number <\i> <br>
35 * set runnumber to specify Huffman code table to be read in (parameter transient)
36 * \li -dataspec <i> 0xYYXXaabb <\i> <br>
37 * set usual HLT dataspec (last slice, first slice, last patch, first patch)_Hexadezimal to specify Huffman code table to be read in
38 * \li -trailerwords <i> decimal number <\i> <br>
39 * set number of trailerwords of incoming data (ranging from 1 to 3)
41 * Optional arguments: <br>
42 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
43 * \li -tablepath <i> path to Huffman code table <\i> <br>
44 * set path to read Huffman code table from root file, if no path is given, path is set to current path (parameter transient)
46 * @ingroup alihlt_comp
48 class AliHLTCOMPHuffmanAltroComponent : public AliHLTProcessor {
52 * @param compression whether to use the compressor or decompressor
54 AliHLTCOMPHuffmanAltroComponent(bool compression);
56 virtual ~AliHLTCOMPHuffmanAltroComponent();
58 // Public functions to implement AliHLTComponent's interface.
59 // These functions are required for the registration process
61 const char* GetComponentID();
62 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
63 AliHLTComponentDataType GetOutputDataType();
64 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
65 AliHLTComponent* Spawn();
70 // Protected functions to implement AliHLTComponent's interface.
71 // These functions provide initialization as well as the actual processing
72 // capabilities of the component.
74 int DoInit( int argc, const char** argv );
76 int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
77 AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
78 AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
81 /** copy constructor prohibited */
82 AliHLTCOMPHuffmanAltroComponent(const AliHLTCOMPHuffmanAltroComponent&);
83 /** assignment operator prohibited */
84 AliHLTCOMPHuffmanAltroComponent& operator=(const AliHLTCOMPHuffmanAltroComponent&);
86 /** the entropy encoder object */
87 AliHLTCOMPHuffmanAltro* fHuffmanCompressor; // instance of Huffman compressor component
88 /** bool to decide whether to compress (TRUE) or to decompress (FALSE) */
89 Bool_t fCompressionSwitch; // mode choice for compressor instance from input line arguments
90 /** bool to decide wheter to calibrate (create a new code table) (TRUE) or to (de)compress data (FALSE) */
91 Bool_t fTrainingMode; // mode choice for training instance from input line arguments
92 /** specification of origin of input data to load correct Huffman code table */
93 TString fOrigin; // gets input line argument to specify the origin of the Huffman table
94 /** specification of run number to load correct Huffman code table */
95 AliHLTUInt64_t fRunNumber; // gets input line argument to specify run type of Huffman Table
96 /** data specifications (0xYYXXaabb) to load correct Huffman code table */
97 AliHLTUInt64_t fDataSpec; // gets input line argument to specify the data of the Huffman table
98 /** path to load Huffman code table from (if not explicitly given, table is taken from current path) */
99 TString fTablePath; // gets explicit path for Huffman table from command line
100 /** number of NRCU trailer words of incoming data */
101 Int_t fNrcuTrailerwords; // number of rcu trailer words
102 /** pointer to Huffman code table for read in */
103 AliHLTCOMPHuffmanData* fHuffmanData; // instance of Huffman Data containing the code table
105 //AliHLTUInt8_t fSlice; // determine slice number from input event block
106 //AliHLTUInt8_t fPatch; // determine patch number from input event bloc
108 ClassDef(AliHLTCOMPHuffmanAltroComponent, 0)