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