4 #ifndef ALIHLTTPCCLUSTERFINDERCOMPONENT_H
5 #define ALIHLTTPCCLUSTERFINDERCOMPONENT_H
7 //* This file is property of and copyright by the ALICE HLT Project *
8 //* ALICE Experiment at CERN, All rights reserved. *
9 //* See cxx source for full Copyright notice *
11 /// @file AliHLTTPCClusterFinderComponent.h
12 /// @author Timm Steinbeck, Matthias Richter, Kenneth Aamodt
14 /// @brief The TPC cluster finder component.
17 #include "AliHLTProcessor.h"
18 #include "AliHLTComponentBenchmark.h"
20 class AliHLTTPCClusterFinder;
21 class AliHLTTPCDigitReader;
22 class AliTPCTransform;
25 * @class AliHLTTPCClusterFinderComponent
26 * Implementation of the cluster finder component.
27 * The component implements the interface methods of the @ref AliHLTProcessor.
28 * The actual cluster finding algorithm is implemented in @ref AliHLTTPCClusterFinder.
29 * Two components are registered, TPCClusterFinderUnpacked is for reading the HLT
30 * internal digit data format used in the simulation. TPCClusterFinder32Bit uses
31 * the AliHLTTPCDigitReader for raw data. After a phase of different decoder/raw stream
32 * implementations the CF for raw data is using the default offline raw stream for
33 * the 32bit RCU format AliAltroRawStreamV3, which also has a fall back to the 40bit
34 * AliAltroRawStream if the old RCU format is detected.
36 * The clusterfinder is now using the AliTPCTransform instead of the AliHLTTPCTransform for
37 * transformations from row, pad time -> x,y,z.
39 * <h2>General properties:</h2>
41 * Component ID: \b TPCClusterFinderUnpacked and TPCClusterFinder32Bit <br>
42 * Library: \b libAliHLTTPC
43 * Input Data Types: @ref kAliHLTDataTypeDDLRaw <br>
44 * Output Data Types: @ref AliHLTTPCDefinitions::fgkClustersDataType and/or kAliHLTDataTypeHwAddr16 <br>
47 * Mandatory arguments: <br>
48 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
50 * Optional arguments: <br>
51 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
52 * \li -deconvolute-time <br>
53 * Turns on deconvolution in the time direction.
54 * \li -deconvolute-pad <br>
55 * Turns on deconvolution in the pad direction.
57 * Sets the number of timebins (446 for simulated data, and 1024 for real data) Default:1024
58 * \li -first-timebin <br>
59 * First timebin taken into consideration when reading the data.
60 * \li -last-timebin <br>
61 * Last timebin taken into consideration when reading the data.
63 * Switch off unsorted reading of data. Equivalent to the old argument unsorted 0.
64 * \li -active-pads <br>
65 * Switch off unsorted reading of data. Equivalent to the old argument unsorted 0.
66 * \li -occupancy-limit <br>
67 * Set the occupancy limit for the sorted clusterfinding.
70 * Obsolete arguments: <br>
71 * \li occupancy-limit <br>
72 * \li rawreadermode <br>
74 * \li adc-threshold <br>
75 * \li oldrcuformat <br>
77 * \li nsigma-threshold <br>
79 * <h2>Default CDB entries:</h2>
80 * The component has these default CDB entries
81 * \li <tt>GRP/GRP/Data</tt>.
82 * \li <tt>TPC/Calib/PadTime0</tt>.
83 * \li <tt>TPC/Calib/Parameters</tt>.
84 * \li <tt>TPC/Calib/TimeDrift</tt>.
85 * \li <tt>TPC/Calib/Temperature</tt>.
87 * TODO: pad by pad gain calibration also has to be added to the clusterfinder
89 * And it also needs these below to avoid warnings during initialization and update of calibDB
90 * \li <tt>TPC/Calib/PadGainFactor</tt>.
91 * \li <tt>TPC/Calib/TimeGain</tt>.
92 * \li <tt>TPC/Calib/GainFactorDedx</tt>.
93 * \li <tt>TPC/Calib/PadNoise</tt>.
94 * \li <tt>TPC/Calib/Pedestals</tt>.
95 * \li <tt>TPC/Calib/ClusterParam</tt>.
96 * \li <tt>TPC/Calib/AltroConfig</tt>.
97 * \li <tt>TPC/Calib/Pulser</tt>.
98 * \li <tt>TPC/Calib/CE</tt>.
99 * \li <tt>TPC/Calib/Raw</tt>.
100 * \li <tt>TPC/Calib/QA</tt>.
101 * \li <tt>TPC/Calib/Mapping</tt>.
102 * \li <tt>TPC/Calib/Goofie</tt>.
103 * \li <tt>TPC/Calib/HighVoltage</tt>.
104 * \li <tt>TPC/Calib/Ref</tt>.
106 * These entries are used by the AliTPCTransform class to correct for T0, drift and ExB.
107 * @ingroup alihlt_tpc_components
109 class AliHLTTPCClusterFinderComponent : public AliHLTProcessor
113 * Defines for the cluster finder type.
114 * The cluster finders can work on different formats of input data,
115 * the AliHLTTPCDigitReader interface provides a transparent way to
119 // deprecated option for offline AliAltroRawStream
120 kClusterFinderPacked,
121 // Unpacked data of format AliHLTTPCUnpackedRawData */
122 kClusterFinderUnpacked,
123 // deprecated option for AliAltroDecoder
124 kClusterFinderDecoder,
125 // real data, offline altro decoder 32 bit format*/
131 * @param mode input type see e.g. @ref kClusterFinderUnpacked
133 AliHLTTPCClusterFinderComponent(int mode);
135 virtual ~AliHLTTPCClusterFinderComponent();
137 // Public functions to implement AliHLTComponent's interface.
138 // These functions are required for the registration process
140 /** interface function, see AliHLTComponent for description */
141 const char* GetComponentID();
142 /** interface function, see AliHLTComponent for description */
143 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
144 /** interface function, see AliHLTComponent for description */
145 AliHLTComponentDataType GetOutputDataType();
146 /** interface function, see AliHLTComponent for description */
147 int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
148 /** interface function, see AliHLTComponent for description */
149 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
150 /** interface function, see AliHLTComponent for description */
151 AliHLTComponent* Spawn();
152 /** interface function, see @ref AliHLTComponent for description */
153 void GetOCDBObjectDescription( TMap* const targetMap);
157 // Protected functions to implement AliHLTComponent's interface.
158 // These functions provide initialization as well as the actual processing
159 // capabilities of the component.
161 int DoInit( int argc, const char** argv );
163 int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
164 AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
165 AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
166 int Configure(const char* arguments);
167 int ScanConfigurationArgument(int argc, const char** argv);
168 int Reconfigure(const char* cdbEntry, const char* chainId);
170 using AliHLTProcessor::DoEvent;
173 /** standard constructor prohibited */
174 AliHLTTPCClusterFinderComponent();
175 /** copy constructor prohibited */
176 AliHLTTPCClusterFinderComponent(const AliHLTTPCClusterFinderComponent&);
177 /** assignment operator prohibited */
178 AliHLTTPCClusterFinderComponent& operator=(const AliHLTTPCClusterFinderComponent&);
179 /** the cluster finder object */
180 AliHLTTPCClusterFinder* fClusterFinder; //!transient
181 /** the reader object for data decoding */
182 AliHLTTPCDigitReader* fReader; //!transient
184 /** flag to deconvolute in time direction */
185 Bool_t fDeconvTime; //!transient
186 /** the object to set the time stamp */
187 AliTPCTransform *fTS; //!transient
189 /** flag to deconvolute in pad direction */
190 Bool_t fDeconvPad; //!transient
191 /** flag to switch on/off deconvolution in pad and time directions (used by sorted clusterfinding method) */
192 bool fClusterDeconv; //!transient
193 /** Error in xy of cluster */
194 float fXYClusterError; //!transient
195 /** Error in Z direction of cluster */
196 float fZClusterError; //!transient
198 * switch to indicated the reader
199 * use fModeSwitch = 0 for packed inputtype "gkDDLPackedRawDataType"
200 * use fModeSwitch = 1 for unpacked inputtype "gkUnpackedRawDataType"
201 * use fModeSwitch = 2 for packed inputtype "gkDDLPackedRawDataType" with new digit reader
202 * use fModeSwitch = 3 for packed inputtype "gkDDLPackedRawDataType" with 32bit digit reader
204 Int_t fModeSwitch; // see above
207 * Reads the data the new unsorted way if true
210 Int_t fUnsorted; //!transient
213 * Patch number to be read, currently given as component argument,
214 * will be changed later.
216 Int_t fPatch; //!transient
219 * Switch to specify if one ship out a list of active pads (pads conected to a cluster).
221 Int_t fGetActivePads; //!transient
223 /** First timebin taken into account when reading the data */
224 Int_t fFirstTimeBin; //!transient
226 /** Last timebin taken in to account when reading the data */
227 Int_t fLastTimeBin; //!transient
229 Bool_t fDoMC; // flag to provide MC labels
230 Bool_t fReleaseMemory; // flag to release the memory after each event
231 Bool_t fPublishRawClusters; // publish raw clusters in addition
232 AliHLTComponentBenchmark fBenchmark; // benchmark
234 ClassDef(AliHLTTPCClusterFinderComponent, 0)