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