3 #ifndef ALIHLTITSCLUSTERFINDERCOMPONENT_H
4 #define ALIHLTITSCLUSTERFINDERCOMPONENT_H
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 *
10 /// @file AliHLTITSClusterFinderComponent.cxx
11 /// @author Gaute Ovrebekk <st05886@alf.uib.no>
13 /// @brief Component to run the offline clusterfinder.
16 #include "AliHLTProcessor.h"
17 #include "AliRawReaderMemory.h"
18 #include "AliITSDetTypeRec.h"
19 #include "AliITSgeom.h"
20 #include "AliITSInitGeometry.h"
21 #include "TClonesArray.h"
22 #include "AliHLTDataTypes.h"
24 #include "AliHLTComponentBenchmark.h"
25 #include "AliITSRecPoint.h"
27 class AliHLTITSClusterFinderSPD;
28 class AliHLTITSClusterFinderSSD;
29 class AliHLTITSClusterData;
33 * @class AliHLTITSClusterFinderComponent
34 * HLT Component to run the ITS offline clusterfinders.
36 * <h2>General properties:</h2>
38 * Component ID: \b ITSClusterFinderSPD or ITSClusterFinderSDD or ITSClusterFinderSSD <br>
39 * Library: \b libAliHLTITS.so <br>
40 * Input Data Types: <br>
41 * kAliHLTDataTypeDDLRaw|kAliHLTDataOriginITSSPD or kAliHLTDataTypeDDLRaw|kAliHLTDataOriginITSSDD or kAliHLTDataTypeDDLRaw|kAliHLTDataOriginITSSD <br>
43 * Output Data Types: <br>
44 * kAliHLTDataTypeClusters|kAliHLTDataOriginITSSPD or kAliHLTDataTypeClusters|kAliHLTDataOriginITSSDD or kAliHLTDataTypeClusters|kAliHLTDataOriginITSSSD <br>
46 * <h2>Mandatory arguments:</h2>
47 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
49 * <h2>Optional arguments:</h2>
50 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
52 * <h2>Configuration:</h2>
53 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
54 * \li -config1 <i> teststring </i> <br>
55 * a configuration argument with one parameter
57 * a configuration argument without parameters
59 * <h2>Default CDB entries:</h2>
62 * TRIGGER/SPD/PITConditions
65 * ITS/Calib/DriftSpeedSDD
67 * ITS/Calib/MapsTimeSDD
70 * ITS/Calib/BadChannelsSSD
73 * <h2>Performance:</h2>
76 * <h2>Memory consumption:</h2>
79 * <h2>Output size:</h2>
82 * <h2>Pending issues:</h2>
83 * There is a general problem with the streaming of the digit tree. A description
84 * is in the GetEvent function. For many events the hotfix for that caused bug
85 * https://savannah.cern.ch/bugs/?72815
86 * This has been fixed by accessing the AliLoader in the CF component via the
87 * global AliRunLoader. This breaks the idea of components, however it's used in
88 * simulation inside AliRoot only.
90 * @ingroup alihlt_its_components
92 class AliHLTITSClusterFinderComponent : public AliHLTProcessor
96 * Defines for selecting clusterfinder for SPD, SDD or SSD.
105 * ---------------------------------------------------------------------------------
106 * Constructor / Destructor
107 * ---------------------------------------------------------------------------------
111 * @param mode input type see e.g. @ref kClusterFinderSPD
113 AliHLTITSClusterFinderComponent(int mode);
116 virtual ~AliHLTITSClusterFinderComponent();
119 * ---------------------------------------------------------------------------------
120 * Public functions to implement AliHLTComponent's interface.
121 * These functions are required for the registration process
122 * ---------------------------------------------------------------------------------
125 /** interface function, see @ref AliHLTComponent for description */
126 const char* GetComponentID();
128 /** interface function, see @ref AliHLTComponent for description */
129 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
131 /** interface function, see @ref AliHLTComponent for description */
132 AliHLTComponentDataType GetOutputDataType();
134 /** interface function, see @ref AliHLTComponent for description */
135 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
137 /** interface function, see @ref AliHLTComponent for description */
138 void GetOCDBObjectDescription( TMap* const targetMap);
140 /** interface function, see @ref AliHLTComponent for description */
141 AliHLTComponent* Spawn();
146 * ---------------------------------------------------------------------------------
147 * Protected functions to implement AliHLTComponent's interface.
148 * These functions provide initialization as well as the actual processing
149 * capabilities of the component.
150 * ---------------------------------------------------------------------------------
153 /** Initialization */
154 Int_t DoInit( int argc, const char** argv );
156 /** DeInitialization */
162 const AliHLTComponentEventData& evtData,
163 const AliHLTComponentBlockData* blocks,
164 AliHLTComponentTriggerData& /*trigData*/,
165 AliHLTUInt8_t* outputPtr,
166 AliHLTUInt32_t& size,
167 vector<AliHLTComponentBlockData>& outputBlocks );
169 //Int_t DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/);
171 int Reconfigure(const char* cdbEntry, const char* chainId);
173 using AliHLTProcessor::DoEvent;
175 ///////////////////////////////////////////////////////////////////////////////////
178 /** standard constructor prohibited */
179 AliHLTITSClusterFinderComponent();
180 /** copy constructor prohibited */
181 AliHLTITSClusterFinderComponent(const AliHLTITSClusterFinderComponent&);
182 /** assignment operator prohibited */
183 AliHLTITSClusterFinderComponent& operator=(const AliHLTITSClusterFinderComponent&);
185 * Configure the component.
186 * Parse a string for the configuration arguments and set the component
189 int Configure(const char* arguments);
191 void RecPointToSpacePoint(AliHLTUInt8_t* outputPtr,AliHLTUInt32_t& size);
192 void RecpointToOutput(AliHLTITSClusterData *outputClusters, AliITSRecPoint *recpoint, int &clustIdx);
194 * ---------------------------------------------------------------------------------
196 * ---------------------------------------------------------------------------------
200 * switch to indicated the ClusterFinder
201 * use fModeSwitch = 0 for SPD
202 * use fModeSwitch = 1 for SDD
203 * use fModeSwitch = 2 for SSD
204 * use fModeSwitch = 3 for ClusterFinding on Digits (Full ITS)
206 Int_t fModeSwitch; // !
207 AliHLTComponentDataType fInputDataType; // !
208 AliHLTComponentDataType fOutputDataType; // !
210 Bool_t fUseOfflineFinder; // flag to use the offline clusterfinder
211 Int_t fNModules; // total number of modules
212 Int_t fId; // ddl offset
213 Int_t fNddl; // number of ddl's
215 /** the reader object for data decoding */
217 AliRawReaderMemory* fRawReader; //!transient
218 AliITSDetTypeRec* fDettype; //!transient
219 AliITSgeom* fgeom; //!transient
220 AliITSInitGeometry* fgeomInit; //!transient
222 AliHLTITSClusterFinderSPD *fSPD; //!transient
223 AliHLTITSClusterFinderSSD *fSSD; //!transient
225 TTree *tD; //!transient
226 TTree *tR; //!transient
228 Int_t fSPDNModules; //!transient
229 Int_t fSDDNModules; //!transient
230 Int_t fSSDNModules; //!transient
232 Int_t fFirstModule; //!transient
233 Int_t fLastModule; //!transient
234 Int_t fnClusters; //!transient
236 std::vector<AliITSRecPoint> fclusters; //!transient
238 AliHLTComponentBenchmark fBenchmark;// benchmark
240 unsigned long fOutputSizeOffset; //! const offset for output size estimation
241 // 2011-01-27: the transport of digits via the AliLoaderPublisher is
242 // not working stably at the moment. In particular the size of the
243 // streamed digit tree seems not to be correlated with the content
244 // furthermore the CF implements a hotfix accessing the root file
245 // directly. The variable fInputMultiplierDigits will be used for a
246 // dynamic adaption of the buffer size. The component will then return
247 // -ENOSPC and AliHLTTask carries out the event processing once again
248 // with adjusted buffer size
249 float fInputMultiplierDigits; //! variable input multiplier for CF type digits
250 AliLoader* fpLoader; //! ITS loader for getting digit tree
252 ClassDef(AliHLTITSClusterFinderComponent, 0)