]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/comp/AliHLTTPCDataCompressionComponent.h
write optional array of cluster ids for mapping and verification of compressed data
[u/mrichter/AliRoot.git] / HLT / TPCLib / comp / AliHLTTPCDataCompressionComponent.h
CommitLineData
7ab8209c 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"
8b1d554b 16#include "TString.h"
0fa10601 17#include "AliHLTTrackGeometry.h"
18#include "AliHLTSpacePointContainer.h"
7ab8209c 19
0fa10601 20class AliHLTGlobalBarrelTrack;
7ab8209c 21class AliHLTComponentBenchmark;
22class AliHLTSpacePointContainer;
8b1d554b 23class AliHLTDataDeflater;
24class TH1F;
7ab8209c 25
26/**
27 * @class AliHLTTPCDataCompressionComponent
28 * One single component to carry out different types and levels of compression
29 * of TPC data.
30 *
31 * <h2>General properties:</h2>
32 *
33 * Component ID: \b TPCDataCompressor <br>
34 * Library: \b libAliHLTTPC.so <br>
35 * Input Data Types: <br>
36 * - AliHLTTPCDefinitions::fgkHWClustersDataType
37 * - AliHLTTPCDefinitions::fgkClustersDataType
38 * - kAliHLTDataTypeTrack|kAliHLTDataOriginTPC
39 * Output Data Types: none <br>
40 *
41 * <h2>Mandatory arguments:</h2>
42 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
43 *
44 * <h2>Optional arguments:</h2>
45 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
8b1d554b 46 * \li -mode <i> number </i> <br>
47 * compression mode
48 * \li -deflater-mode <i> number </i> <br>
49 * data deflater mode
50 * \li -histogram-file <i> file </i> <br>
51 * file to store internal histograms at the end
7ab8209c 52 *
53 * <h2>Configuration:</h2>
54 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
55 *
56 * <h2>Default CDB entries:</h2>
57 *
58 * <h2>Performance:</h2>
59 *
60 * <h2>Memory consumption:</h2>
61 *
62 * <h2>Output size:</h2>
63 *
64 *
65 * @ingroup alihlt_tpc
66 */
67class AliHLTTPCDataCompressionComponent : public AliHLTProcessor {
68public:
69 /// standard constructor
70 AliHLTTPCDataCompressionComponent();
71 /// destructor
72 ~AliHLTTPCDataCompressionComponent();
73
74 /// inherited from AliHLTComponent: id of the component
75 virtual const char* GetComponentID();
76
77 /// inherited from AliHLTComponent: list of data types in the vector reference
78 void GetInputDataTypes( AliHLTComponentDataTypeList& );
79
80 /// inherited from AliHLTComponent: output data type of the component.
81 AliHLTComponentDataType GetOutputDataType();
82
83 /// inherited from AliHLTComponent: multiple output data types of the component.
84 int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
85
86 /// inherited from AliHLTComponent: output data size estimator
87 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
88
89 /// inherited from AliHLTComponent: spawn function.
90 virtual AliHLTComponent* Spawn();
91
92protected:
93 /// inherited from AliHLTProcessor: data processing
94 int DoEvent( const AliHLTComponentEventData& evtData,
95 const AliHLTComponentBlockData* blocks,
96 AliHLTComponentTriggerData& trigData,
97 AliHLTUInt8_t* outputPtr,
98 AliHLTUInt32_t& size,
99 AliHLTComponentBlockDataList& outputBlocks );
100 using AliHLTProcessor::DoEvent;
101
102 /// inherited from AliHLTComponent: component initialisation and argument scan.
103 int DoInit( int argc, const char** argv );
104
105 /// inherited from AliHLTComponent: component cleanup
106 int DoDeinit();
107
108 /// inherited from AliHLTComponent: argument scan
109 int ScanConfigurationArgument(int argc, const char** argv);
110
0fa10601 111 int ForwardMCLabels(const AliHLTComponentBlockData& pDesc,
112 AliHLTSpacePointContainer::AliHLTSpacePointPropertyGrid* pIndex,
113 AliHLTUInt8_t* outputPtr, AliHLTUInt32_t size, AliHLTUInt32_t offset,
114 vector<AliHLTComponentBlockData>& outputBlocks) const;
115
4f573ca4 116 int ProcessTrackClusters(AliHLTGlobalBarrelTrack* pTracks, unsigned nofTracks,
117 AliHLTTrackGeometry::AliHLTTrackGrid* pTrackIndex,
118 AliHLTSpacePointContainer::AliHLTSpacePointPropertyGrid* pClusterIndex,
119 AliHLTSpacePointContainer* pClusters,
120 int slice, int partition) const;
121
122 int ProcessRemainingClusters(AliHLTGlobalBarrelTrack* pTracks, unsigned nofTracks,
123 AliHLTTrackGeometry::AliHLTTrackGrid* pTrackIndex,
124 AliHLTSpacePointContainer::AliHLTSpacePointPropertyGrid* pClusterIndex,
125 AliHLTSpacePointContainer* pClusters,
126 int slice, int partition) const;
127
128 int FindCellClusters(int trackId, int padrow, float pad, float time,
129 AliHLTSpacePointContainer::AliHLTSpacePointPropertyGrid* pClusterIndex,
130 AliHLTSpacePointContainer* pClusters,
131 AliHLTTrackGeometry::AliHLTTrackPoint* pTrackPoint) const;
132
133 int WriteTrackClusters(const vector<AliHLTGlobalBarrelTrack>& tracks,
134 AliHLTSpacePointContainer* pSpacePoints,
135 AliHLTDataDeflater* pDeflater,
136 AliHLTUInt8_t* outputPtr,
137 AliHLTUInt32_t capacity) const;
138
7ab8209c 139private:
140 AliHLTTPCDataCompressionComponent(const AliHLTTPCDataCompressionComponent&);
141 AliHLTTPCDataCompressionComponent& operator=(const AliHLTTPCDataCompressionComponent&);
142
8b1d554b 143 int InitDeflater(int mode);
144
7ab8209c 145 AliHLTComponentBenchmark* GetBenchmarkInstance() const {return fpBenchmark;}
146
147 int fMode; //! mode
8b1d554b 148 int fDeflaterMode; //! deflater mode
7ab8209c 149
0fa10601 150 float fMaxDeltaPad; //! maximum deviation in pad
151 float fMaxDeltaTime; //! maximum deviation in time
152
7ab8209c 153 /// input raw cluster handler
154 AliHLTSpacePointContainer* fRawInputClusters; //! input raw cluster handler
155 /// input cluster handler
156 AliHLTSpacePointContainer* fInputClusters; //! input cluster handler
157
0fa10601 158 /// index grid for tracks store track id for padrow crossings
159 AliHLTTrackGeometry::AliHLTTrackGrid* fTrackGrid; //! index grid for tracks
160
161 /// index grid for clusters
162 AliHLTSpacePointContainer::AliHLTSpacePointPropertyGrid* fSpacePointGrid; //! index grid for clusters
163
8b1d554b 164 /// deflater
165 AliHLTDataDeflater* fpDataDeflater; //! deflater for raw clusters
166
167 /// compression factor histogram
168 TH1F* fHistoCompFactor; //! histogram of compression factor
4f573ca4 169 TH1F* fHistoResidualPad; //! histogram for pad residual
170 TH1F* fHistoResidualTime; //! histogram for time residual
171 TH1F* fHistoClustersOnTracks; //! clusters on tracks for track model compression
172 TH1F* fHistoClusterRatio; //! fraction of clusters assigned to the track model compression
173 TH1F* fHistoTrackClusterRatio; //! fraction of track clusters assigned to the track model compression
8b1d554b 174 TString fHistogramFile; //! file to save histogram
80ae4557 175 TString fTrainingTableOutput; //! output file for huffman tables in training mode
8b1d554b 176
7ab8209c 177 /// benchmark
178 AliHLTComponentBenchmark* fpBenchmark; //! benchmark instance
179
4f573ca4 180 /// verbosity
181 int fVerbosity; // verbosity for debug printout
182
7ab8209c 183 ClassDef(AliHLTTPCDataCompressionComponent, 0)
184};
185
186#endif //ALIHLTTPCDATACOMPRESSIONCOMPONENT_H