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