]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/ITS/AliHLTITSClusterFinderComponent.h
extra benchmarks are added
[u/mrichter/AliRoot.git] / HLT / ITS / AliHLTITSClusterFinderComponent.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 #ifndef ALIHLTITSCLUSTERFINDERCOMPONENT_H
4 #define ALIHLTITSCLUSTERFINDERCOMPONENT_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   AliHLTITSClusterFinderComponent.cxx
11     @author Gaute Ã˜vrebekk <st05886@alf.uib.no>
12     @date   
13     @brief  Component to run the offline clusterfinder.
14 */
15
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"
23 #include "TTree.h"
24 #include "AliHLTComponentBenchmark.h"
25
26 class AliHLTITSClusterFinderSPD;
27 class AliHLTITSClusterFinderSSD;
28
29
30 /**
31  * @class AliHLTITSClusterFinderComponent
32  * HLT Component to run the ITS offline clusterfinders.
33  *
34  * <h2>General properties:</h2>
35  *
36  * Component ID: \b ITSClusterFinderSPD or ITSClusterFinderSDD or ITSClusterFinderSSD <br>
37  * Library: \b libAliHLTITS.so                              <br>
38  * Input Data Types:                                        <br> 
39  *    kAliHLTDataTypeDDLRaw|kAliHLTDataOriginITSSPD or kAliHLTDataTypeDDLRaw|kAliHLTDataOriginITSSDD or kAliHLTDataTypeDDLRaw|kAliHLTDataOriginITSSD <br>
40  *      
41  * Output Data Types:                                       <br>
42  *    kAliHLTDataTypeClusters|kAliHLTDataOriginITSSPD or kAliHLTDataTypeClusters|kAliHLTDataOriginITSSDD or kAliHLTDataTypeClusters|kAliHLTDataOriginITSSSD <br>
43  *
44  * <h2>Mandatory arguments:</h2>
45  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
46  *
47  * <h2>Optional arguments:</h2>
48  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
49  *
50  * <h2>Configuration:</h2>
51  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
52  * \li -config1      <i> teststring   </i> <br>
53  *      a configuration argument with one parameter
54  * \li -config2                            <br>
55  *      a configuration argument without parameters
56  *
57  * <h2>Default CDB entries:</h2>
58  * ITS/Calib/SPDNoisy
59  * ITS/Calib/SPDDead
60  * TRIGGER/SPD/PITConditions
61  * ITS/Calib/CalibSDD
62  * ITS/Calib/RespSDD
63  * ITS/Calib/DriftSpeedSDD
64  * ITS/Calib/DDLMapSDD
65  * ITS/Calib/MapsTimeSDD
66  * ITS/Calib/NoiseSSD
67  * ITS/Calib/GainSSD
68  * ITS/Calib/BadChannelsSSD
69  * GRP/CTP/Scalers
70  *
71  * <h2>Performance:</h2>
72  * TODO
73  *
74  * <h2>Memory consumption:</h2>
75  * TODO
76  *
77  * <h2>Output size:</h2>
78  * TODO
79  *
80  * @ingroup alihlt_its_components
81  */
82 class AliHLTITSClusterFinderComponent : public AliHLTProcessor
83 {
84  public:
85   /**
86    * Defines for selecting clusterfinder for SPD, SDD or SSD.
87    */
88   enum {
89     kClusterFinderSPD,
90     kClusterFinderSDD,
91     kClusterFinderSSD,
92     kClusterFinderDigits    
93   };
94   /*
95    * ---------------------------------------------------------------------------------
96    *                            Constructor / Destructor
97    * ---------------------------------------------------------------------------------
98    */
99   
100   /** constructor
101    *  @param mode    input type see e.g. @ref kClusterFinderSPD
102    */
103   AliHLTITSClusterFinderComponent(int mode);
104
105   /** destructor */
106   virtual ~AliHLTITSClusterFinderComponent();
107
108   /*
109    * ---------------------------------------------------------------------------------
110    * Public functions to implement AliHLTComponent's interface.
111    * These functions are required for the registration process
112    * ---------------------------------------------------------------------------------
113    */
114
115   /** interface function, see @ref AliHLTComponent for description */
116   const char* GetComponentID();
117
118   /** interface function, see @ref AliHLTComponent for description */
119    void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
120
121   /** interface function, see @ref AliHLTComponent for description */
122   AliHLTComponentDataType GetOutputDataType();
123
124   /** interface function, see @ref AliHLTComponent for description */
125   virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
126
127   /** interface function, see @ref AliHLTComponent for description */
128   AliHLTComponent* Spawn();
129
130  protected:
131         
132   /*
133    * ---------------------------------------------------------------------------------
134    * Protected functions to implement AliHLTComponent's interface.
135    * These functions provide initialization as well as the actual processing
136    * capabilities of the component. 
137    * ---------------------------------------------------------------------------------
138    */
139         
140   /** Initialization */
141   Int_t DoInit( int argc, const char** argv );
142
143   /** DeInitialization */
144   Int_t DoDeinit();
145   
146   /** EventLoop */
147  
148   Int_t DoEvent(
149                 const AliHLTComponentEventData& evtData,
150                 const AliHLTComponentBlockData* blocks,
151                 AliHLTComponentTriggerData& /*trigData*/,
152                 AliHLTUInt8_t* outputPtr,
153                 AliHLTUInt32_t& size,
154                 vector<AliHLTComponentBlockData>& outputBlocks );
155
156   //Int_t DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/);
157
158   int Reconfigure(const char* cdbEntry, const char* chainId);
159                 
160   using AliHLTProcessor::DoEvent;
161  
162   ///////////////////////////////////////////////////////////////////////////////////
163     
164  private:
165   /** standard constructor prohibited */
166   AliHLTITSClusterFinderComponent();
167   /** copy constructor prohibited */
168   AliHLTITSClusterFinderComponent(const AliHLTITSClusterFinderComponent&);
169   /** assignment operator prohibited */
170   AliHLTITSClusterFinderComponent& operator=(const AliHLTITSClusterFinderComponent&);
171   /**
172    * Configure the component.
173    * Parse a string for the configuration arguments and set the component
174    * properties.
175    */
176   int Configure(const char* arguments);
177
178   void RecPointToSpacePoint(AliHLTUInt8_t* outputPtr,AliHLTUInt32_t& size);
179   /*
180    * ---------------------------------------------------------------------------------
181    *                             Members - private
182    * ---------------------------------------------------------------------------------
183    */
184
185   /**
186    * switch to indicated the ClusterFinder
187    * use fModeSwitch = 0 for SPD
188    * use fModeSwitch = 1 for SDD
189    * use fModeSwitch = 2 for SSD
190    * use fModeSwitch = 3 for ClusterFinding on Digits (Full ITS)
191    */
192   Int_t fModeSwitch;      // !
193   AliHLTComponentDataType fInputDataType; // !
194   AliHLTComponentDataType fOutputDataType; // !
195   
196   Bool_t fUseOfflineFinder; // flag to use the offline clusterfinder
197   Int_t fNModules;             // total number of modules
198   Int_t fId;                   // ddl offset
199   Int_t fNddl;                 // number of ddl's
200   
201    TClonesArray** fClusters;                                  //!transient
202   
203   /** the reader object for data decoding */
204
205   AliRawReaderMemory* fRawReader;                             //!transient
206   AliITSDetTypeRec* fDettype;                                 //!transient
207   AliITSgeom* fgeom;                                          //!transient
208   AliITSInitGeometry* fgeomInit;                              //!transient
209  
210   AliHLTITSClusterFinderSPD *fSPD;                            //!transient
211   AliHLTITSClusterFinderSSD *fSSD;                            //!transient
212
213   TTree *tD;                                                  //!transient
214   TTree *tR;                                                  //!transient
215
216   std::vector<AliITSRecPoint> fclusters;                      //!transient
217
218   AliHLTComponentBenchmark fBenchmark;// benchmark
219
220   ClassDef(AliHLTITSClusterFinderComponent, 0)
221     
222 };
223 #endif