]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/comp/AliHLTTPCDataCompressionComponent.h
remove transformed clusters from TPCDataCompressor input; added configuration object...
[u/mrichter/AliRoot.git] / HLT / TPCLib / comp / AliHLTTPCDataCompressionComponent.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 #ifndef ALIHLTTPCDATACOMPRESSIONCOMPONENT_H
4 #define ALIHLTTPCDATACOMPRESSIONCOMPONENT_H
5 //* This file is property of and copyright by the ALICE HLT Project        * 
6 //* ALICE Experiment at CERN, All rights reserved.                         *
7 //* See cxx source for full Copyright notice                               *
8
9 /// @file   AliHLTTPCDataCompressionComponent.h
10 /// @author Matthias Richter
11 /// @date   2011-08-08
12 /// @brief  TPC component for data compression
13 ///
14
15 #include "AliHLTProcessor.h"
16 #include "TString.h"
17
18 class AliHLTComponentBenchmark;
19 class AliHLTSpacePointContainer;
20 class AliHLTDataDeflater;
21 class TH1F;
22
23 /**
24  * @class AliHLTTPCDataCompressionComponent
25  * One single component to carry out different types and levels of compression
26  * of TPC data.
27  *
28  * <h2>General properties:</h2>
29  *
30  * Component ID: \b TPCDataCompressor      <br>
31  * Library: \b libAliHLTTPC.so     <br>
32  * Input Data Types:  <br>
33  *  -  AliHLTTPCDefinitions::fgkHWClustersDataType
34  *  -  AliHLTTPCDefinitions::fgkClustersDataType
35  *  -  kAliHLTDataTypeTrack|kAliHLTDataOriginTPC
36  * Output Data Types: none <br>
37  *
38  * <h2>Mandatory arguments:</h2>
39  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
40  *
41  * <h2>Optional arguments:</h2>
42  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
43  * \li -mode     <i> number  </i> <br>
44  *      compression mode
45  * \li -deflater-mode     <i> number  </i> <br>
46  *      data deflater mode
47  * \li -histogram-file     <i> file  </i> <br>
48  *      file to store internal histograms at the end
49  *
50  * <h2>Configuration:</h2>
51  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
52  *
53  * <h2>Default CDB entries:</h2>
54  *
55  * <h2>Performance:</h2>
56  *
57  * <h2>Memory consumption:</h2>
58  *
59  * <h2>Output size:</h2>
60  *
61  *
62  * @ingroup alihlt_tpc
63  */
64 class AliHLTTPCDataCompressionComponent : public AliHLTProcessor {
65 public:
66   /// standard constructor
67   AliHLTTPCDataCompressionComponent();
68   /// destructor
69   ~AliHLTTPCDataCompressionComponent();
70
71   /// inherited from AliHLTComponent: id of the component
72   virtual const char* GetComponentID();
73
74   /// inherited from AliHLTComponent: list of data types in the vector reference
75   void GetInputDataTypes( AliHLTComponentDataTypeList& );
76
77   /// inherited from AliHLTComponent: output data type of the component.
78   AliHLTComponentDataType GetOutputDataType();
79
80   /// inherited from AliHLTComponent: multiple output data types of the component.
81   int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
82
83   /// inherited from AliHLTComponent: output data size estimator
84   void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
85
86   /// inherited from AliHLTComponent: spawn function.
87   virtual AliHLTComponent* Spawn();
88
89   enum ParameterId_t {
90     kPadRow = 0,
91     kPad,
92     kTime,
93     kSigmaY2,
94     kSigmaZ2,
95     kCharge,
96     kQMax,
97     kLast
98   };
99
100 protected:
101   /// inherited from AliHLTProcessor: data processing
102   int DoEvent( const AliHLTComponentEventData& evtData, 
103                const AliHLTComponentBlockData* blocks, 
104                AliHLTComponentTriggerData& trigData,
105                AliHLTUInt8_t* outputPtr, 
106                AliHLTUInt32_t& size,
107                AliHLTComponentBlockDataList& outputBlocks );
108   using AliHLTProcessor::DoEvent;
109
110   /// inherited from AliHLTComponent: component initialisation and argument scan.
111   int DoInit( int argc, const char** argv );
112
113   /// inherited from AliHLTComponent: component cleanup
114   int DoDeinit();
115
116   /// inherited from AliHLTComponent: argument scan
117   int ScanConfigurationArgument(int argc, const char** argv);
118
119 private:
120   AliHLTTPCDataCompressionComponent(const AliHLTTPCDataCompressionComponent&);
121   AliHLTTPCDataCompressionComponent& operator=(const AliHLTTPCDataCompressionComponent&);
122
123   int InitDeflater(int mode);
124
125   AliHLTComponentBenchmark* GetBenchmarkInstance() const {return fpBenchmark;}
126
127   int fMode; //! mode
128   int fDeflaterMode; //! deflater mode
129
130   /// input raw cluster handler
131   AliHLTSpacePointContainer* fRawInputClusters; //! input raw cluster handler
132   /// input cluster handler
133   AliHLTSpacePointContainer* fInputClusters; //! input cluster handler
134
135   /// deflater
136   AliHLTDataDeflater* fpDataDeflater; //! deflater for raw clusters
137
138   /// compression factor histogram
139   TH1F* fHistoCompFactor; //! histogram of compression factor
140   TString fHistogramFile; //! file to save histogram
141
142   /// benchmark
143   AliHLTComponentBenchmark* fpBenchmark; //! benchmark instance
144
145   ClassDef(AliHLTTPCDataCompressionComponent, 0)
146 };
147
148 #endif //ALIHLTTPCDATACOMPRESSIONCOMPONENT_H