]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/comp/AliHLTCOMPHuffmanAltroComponent.h
extracting DDL id from HLT origin and specification for RawReader initialization...
[u/mrichter/AliRoot.git] / HLT / comp / AliHLTCOMPHuffmanAltroComponent.h
CommitLineData
a7ad9794 1//-*- Mode: C++ -*-
2// $Id$
c2440081 3#ifndef ALIHLTCOMPHUFFMANALTROCOMPONENT_H
4#define ALIHLTCOMPHUFFMANALTROCOMPONENT_H
5
a7ad9794 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 *
c2440081 9
8bdb460b 10/// @file AliHLTCOMPHuffmanAltroComponent.h
11/// @author Jenny Wagner, maintained by Matthias.Richter@cern.ch
12/// @date 20-11-2007
13/// @brief The Huffman compressor component.
14///
c2440081 15
16#include "AliHLTProcessor.h"
17
18class AliHLTCOMPHuffmanAltro;
19class AliHLTCOMPHuffmanData;
20
21/**
22 * @class AliHLTCOMPHuffmanAltroComponent
23 * Implementation of the Huffman compressor component.
24 * The component implements the interface methods of the @ref AliHLTProcessor.
a7ad9794 25 * The actual Huffman compression and decompression algorithms are implemented
26 * in AliHLTCOMPHuffmanAltro.
c2440081 27 * The component can handle compressed and decompressed data of different formats.
28 * Two components are registered, the HuffmanCompressor and the HuffmanDecompressor.
a7ad9794 29 *
30 * <h2>General properties:</h2>
31 *
32 * Component ID: \b COMPHuffmanCompressor, \b COMPHuffmanDecompressor <br>
33 * Library: \b libAliHLTComp.so <br>
34 * Input Data Types: <br>
35 * \li COMPHuffmanDecompressor: AliHLTCompDefinitions::fgkDDLEncodedHuffmanAltroDataType
36 * \li COMPHuffmanCompressor: ::kAliHLTDataTypeDDLRaw <br>
37 *
38 * Output Data Types: <br>
39 * \li COMPHuffmanCompressor: AliHLTCompDefinitions::fgkDDLEncodedHuffmanAltroDataType
40 * \li COMPHuffmanDecompressor: ::kAliHLTDataTypeDDLRaw <br>
c2440081 41 *
a7ad9794 42 * <h2>Mandatory arguments:</h2>
1ac82ce6 43 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
a7ad9794 44 * \li -origin <i> detector </i> <br>
c2440081 45 * set origin of data to specify Huffman code table to be read in (parameter transient)
a7ad9794 46 * \li -runnumber <i> decimal number </i> <br>
c2440081 47 * set runnumber to specify Huffman code table to be read in (parameter transient)
a7ad9794 48 * \li -dataspec <i> 0xYYXXaabb </i> <br>
c2440081 49 * set usual HLT dataspec (last slice, first slice, last patch, first patch)_Hexadezimal to specify Huffman code table to be read in
a7ad9794 50 * \li -trailerwords <i> decimal number </i> <br>
c2440081 51 * set number of trailerwords of incoming data (ranging from 1 to 3)
52 *
a7ad9794 53 * <h2>Optional arguments:</h2>
1ac82ce6 54 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
a7ad9794 55 * \li -tablepath <i> path to Huffman code table </i> <br>
c2440081 56 * set path to read Huffman code table from root file, if no path is given, path is set to current path (parameter transient)
57 *
a7ad9794 58 * @ingroup alihlt_comp_components
c2440081 59 */
60class AliHLTCOMPHuffmanAltroComponent : public AliHLTProcessor {
61 public:
62 /**
63 * constructor
64 * @param compression whether to use the compressor or decompressor
65 **/
66 AliHLTCOMPHuffmanAltroComponent(bool compression);
67 /** destructor */
68 virtual ~AliHLTCOMPHuffmanAltroComponent();
69
70 // Public functions to implement AliHLTComponent's interface.
71 // These functions are required for the registration process
72
73 const char* GetComponentID();
74 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
75 AliHLTComponentDataType GetOutputDataType();
76 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
77 AliHLTComponent* Spawn();
78
79
80 protected:
81
82 // Protected functions to implement AliHLTComponent's interface.
83 // These functions provide initialization as well as the actual processing
84 // capabilities of the component.
85
86 int DoInit( int argc, const char** argv );
87 int DoDeinit();
88 int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
89 AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
90 AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
91
92 private:
93 /** copy constructor prohibited */
94 AliHLTCOMPHuffmanAltroComponent(const AliHLTCOMPHuffmanAltroComponent&);
95 /** assignment operator prohibited */
96 AliHLTCOMPHuffmanAltroComponent& operator=(const AliHLTCOMPHuffmanAltroComponent&);
97
98 /** the entropy encoder object */
99 AliHLTCOMPHuffmanAltro* fHuffmanCompressor; // instance of Huffman compressor component
100 /** bool to decide whether to compress (TRUE) or to decompress (FALSE) */
101 Bool_t fCompressionSwitch; // mode choice for compressor instance from input line arguments
c2440081 102 /** bool to decide wheter to calibrate (create a new code table) (TRUE) or to (de)compress data (FALSE) */
103 Bool_t fTrainingMode; // mode choice for training instance from input line arguments
c2440081 104 /** specification of origin of input data to load correct Huffman code table */
105 TString fOrigin; // gets input line argument to specify the origin of the Huffman table
106 /** specification of run number to load correct Huffman code table */
107 AliHLTUInt64_t fRunNumber; // gets input line argument to specify run type of Huffman Table
108 /** data specifications (0xYYXXaabb) to load correct Huffman code table */
109 AliHLTUInt64_t fDataSpec; // gets input line argument to specify the data of the Huffman table
110 /** path to load Huffman code table from (if not explicitly given, table is taken from current path) */
111 TString fTablePath; // gets explicit path for Huffman table from command line
bf7a3243 112 /** number of NRCU trailer words of incoming data */
113 Int_t fNrcuTrailerwords; // number of rcu trailer words
114 /** pointer to Huffman code table for read in */
115 AliHLTCOMPHuffmanData* fHuffmanData; // instance of Huffman Data containing the code table
c2440081 116
117 //AliHLTUInt8_t fSlice; // determine slice number from input event block
118 //AliHLTUInt8_t fPatch; // determine patch number from input event bloc
119
120 ClassDef(AliHLTCOMPHuffmanAltroComponent, 0)
121 };
122#endif