]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCClusterFinderComponent.h
removing deprecated functionality
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCClusterFinderComponent.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIHLTTPCCLUSTERFINDERCOMPONENT_H
5 #define ALIHLTTPCCLUSTERFINDERCOMPONENT_H
6
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                               *
10
11 /// @file   AliHLTTPCClusterFinderComponent.h
12 /// @author Timm Steinbeck, Matthias Richter, Kenneth Aamodt
13 /// @date   
14 /// @brief  The TPC cluster finder component.
15 ///
16
17 #include "AliHLTProcessor.h"
18 #include "AliHLTComponentBenchmark.h"
19
20 class AliHLTTPCClusterFinder;
21 class AliHLTTPCDigitReader;
22 class AliTPCTransform;
23
24 /**
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.
35  *
36  * The clusterfinder is now using the AliTPCTransform instead of the AliHLTTPCTransform for  
37  * transformations from row, pad time -> x,y,z.
38  *
39  * <h2>General properties:</h2>
40  *
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> 
45  *
46  *
47  * Mandatory arguments: <br>
48  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
49  *
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.
56  * \li -timebins <br>  
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. 
62  * \li -sorted <br>  
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.
68  *
69  *
70  * Obsolete arguments: <br>
71  * \li occupancy-limit <br>  
72  * \li rawreadermode   <br>  
73  * \li pp-run          <br>  
74  * \li adc-threshold   <br>  
75  * \li oldrcuformat    <br>  
76  * \li unsorted        <br>  
77  * \li nsigma-threshold <br>  
78  *
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>.      
86  *
87  * TODO: pad by pad gain calibration also has to be added to the clusterfinder
88  *
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>.
105  *
106  * These entries are used by the AliTPCTransform class to correct for T0, drift and ExB.
107  * @ingroup alihlt_tpc_components
108  */
109 class AliHLTTPCClusterFinderComponent : public AliHLTProcessor
110     {
111     public:
112       /**
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
116        * read the data.
117        */
118       enum {
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*/
126         kClusterFinder32Bit
127       };
128
129         /**
130          * constructor 
131          * @param mode    input type see e.g. @ref kClusterFinderUnpacked
132          */
133         AliHLTTPCClusterFinderComponent(int mode);
134         /** destructor */
135         virtual ~AliHLTTPCClusterFinderComponent();
136
137         // Public functions to implement AliHLTComponent's interface.
138         // These functions are required for the registration process
139
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);
154
155     protected:
156         
157         // Protected functions to implement AliHLTComponent's interface.
158         // These functions provide initialization as well as the actual processing
159         // capabilities of the component. 
160
161         int DoInit( int argc, const char** argv );
162         int DoDeinit();
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);
169         
170         using AliHLTProcessor::DoEvent;
171
172     private:
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
183
184         /** flag to deconvolute in time direction */
185         Bool_t fDeconvTime;                                                          //!transient
186         /** the object to set the time stamp */
187         AliTPCTransform *fTS; //!transient
188
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
197         /**
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
203          */
204         Int_t fModeSwitch;                                                            // see above
205       
206         /*
207          * Reads the data the new unsorted way if true
208          *
209          */
210         Int_t fUnsorted;                                                               //!transient
211
212         /*
213          * Patch number to be read, currently given as component argument,
214          * will be changed later.
215          */
216         Int_t fPatch;                                                                  //!transient
217
218         /*
219          * Switch to specify if one ship out a list of active pads (pads conected to a cluster).
220          */
221         Int_t fGetActivePads;                                                          //!transient
222
223         /** First timebin taken into account when reading the data */
224         Int_t fFirstTimeBin;                                                           //!transient
225
226         /** Last timebin taken in to account when reading the data */
227         Int_t fLastTimeBin;                                                            //!transient
228
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
233
234         ClassDef(AliHLTTPCClusterFinderComponent, 0)
235
236 };
237 #endif