]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/SampleLib/AliHLTSampleComponent1.h
- added skeleton of of offline clusterizer and tracker components
[u/mrichter/AliRoot.git] / HLT / SampleLib / AliHLTSampleComponent1.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id$
3 #ifndef ALIHLTSAMPLECOMPONENT1_H
4 #define ALIHLTSAMPLECOMPONENT1_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   AliHLTSampleComponent1.h
11     @author Matthias Richter, Timm Steinbeck
12     @date   
13     @brief  A sample processing component for the HLT.
14 */
15
16 #include "AliHLTProcessor.h"
17
18 /**
19  * @class AliHLTSampleComponent1
20  * An HLT sample component.
21  * This component does not any data processing at all. It just
22  * illustrates the existence of several components in ine library and
23  * allows to set up a very simple chain with different components.
24  *
25  * <h2>General properties:</h2>
26  *
27  * Component ID: \b Sample-component1 <br>
28  * Library: \b libAliHLTSample.so     <br>
29  * Input Data Types: @ref kAliHLTAnyDataType <br>
30  * Output Data Types: none <br>
31  *
32  * <h2>Mandatory arguments:</h2>
33  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
34  * \li -mandatory1     <i> teststring   </i> <br>
35  *      an argument with one parameter
36  * \li -mandatory2                           <br>
37  *      an argument without parameters
38  *
39  * <h2>Optional arguments:</h2>
40  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
41  * \li -optional1      <i> teststring   </i> <br>
42  *      an argument with one parameter
43  * \li -optional2                            <br>
44  *      an argument without parameters
45  *
46  * <h2>Configuration:</h2>
47  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
48  * \li -config1      <i> teststring   </i> <br>
49  *      a configuration argument with one parameter
50  * \li -config2                            <br>
51  *      a configuration argument without parameters
52  *
53  * <h2>Default CDB entries:</h2>
54  * The component has just one default CDB entry in 
55  * <tt>HLT/ConfigSample/SampleComponent1</tt>.
56  * It does not load any configuration from the global <tt>ConfigHLT</tt>
57  * folder.
58  * \li -TObjString object holding a string with the configuration parameters
59  *      explained above
60  *
61  * <h2>Performance:</h2>
62  * The component does not any event data processing.
63  *
64  * <h2>Memory consumption:</h2>
65  * The component does not any event data processing.
66  *
67  * <h2>Output size:</h2>
68  * The component has no output data.
69  *
70  * Furthermore it illustrates the component argument scanning and the
71  * component configuration. There are actually two methods to init/
72  * configure a component:
73  * - via command line arguments. The arguments are specified in the HLT
74  *   chain configuration and are passed to the component during
75  *   initialization in @ref DoInit()
76  * - from a CDB entry. The CDB can contain configuration objects for a
77  *   component and the component can implement the handling
78  *
79  * The component implements the @ref alihltcomponent-low-level-interface.
80  * for data processing.
81  *
82  * Using the latter case, a component can also be reconfigured. Special
83  * events are propageted through the chain in order to trigger the re-
84  * configuration. The component needs to implement the function
85  * @ref Reconfigure(). The simplest version of a configuration object is
86  * a string object (TObjString) containing configuration arguments.
87  *
88  * @ingroup alihlt_tutorial
89  */
90 class AliHLTSampleComponent1 : public AliHLTProcessor {
91 public:
92   AliHLTSampleComponent1();
93   virtual ~AliHLTSampleComponent1();
94
95   // AliHLTComponent interface functions
96   const char* GetComponentID() { return "Sample-component1";}
97   void GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
98     list.push_back(kAliHLTAnyDataType);
99   }
100   AliHLTComponentDataType GetOutputDataType() {return kAliHLTVoidDataType;}
101   virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {constBase = 0;inputMultiplier = 0;};
102
103   // Spawn function, return new class instance
104   AliHLTComponent* Spawn() {return new AliHLTSampleComponent1;};
105
106  protected:
107   // AliHLTComponent interface functions
108   int DoInit( int argc, const char** argv );
109   int DoDeinit();
110   int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
111                        AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
112                        AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
113   int Reconfigure(const char* cdbEntry, const char* chainId);
114   int ReadPreprocessorValues(const char* modules);
115
116   using AliHLTProcessor::DoEvent;
117
118 private:
119   /**
120    * Configure the component.
121    * Parse a string for the configuration arguments and set the component
122    * properties.
123    *
124    * This function illustrates the scanning of an argument string. The string
125    * was presumably fetched from the CDB.
126    */
127   int Configure(const char* arguments);
128
129   ClassDef(AliHLTSampleComponent1, 1)
130 };
131 #endif