]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/SampleLib/AliHLTSampleComponent1.h
1e99bc35aee0b98bc368094eefdff536ff812690
[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  * Component illustrates the basic functionality and component initialization.
25  * See @ref sample-component1.C
26  *
27  * <h2>General properties:</h2>
28  *
29  * Component ID: \b Sample-component1 <br>
30  * Library: \b libAliHLTSample.so     <br>
31  * Input Data Types: @ref kAliHLTAnyDataType <br>
32  * Output Data Types: none <br>
33  *
34  * <h2>Mandatory arguments:</h2>
35  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
36  * \li -mandatory1     <i> teststring   </i> <br>
37  *      an argument with one parameter
38  * \li -mandatory2                           <br>
39  *      an argument without parameters
40  *
41  * <h2>Optional configuration arguments:</h2>
42  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
43  * \li -config1      <i> teststring   </i> <br>
44  *      a configuration argument with one parameter
45  * \li -config2                            <br>
46  *      a configuration argument without parameters
47  *
48  * <h2>Default CDB entries:</h2>
49  * The component has just one default CDB entry in 
50  * <tt>HLT/ConfigSample/SampleComponent1</tt>.
51  * It does not load any configuration from the global <tt>ConfigHLT</tt>
52  * folder.
53  * \li -TObjString object holding a string with the configuration parameters
54  *      explained above
55  *
56  * <h2>Performance:</h2>
57  * The component does not any event data processing.
58  *
59  * <h2>Memory consumption:</h2>
60  * The component does not any event data processing.
61  *
62  * <h2>Output size:</h2>
63  * The component has no output data.
64  *
65  * Furthermore it illustrates the component argument scanning and the
66  * component configuration. There are actually two methods to init/
67  * configure a component:
68  * - via command line arguments. The arguments are specified in the HLT
69  *   chain configuration and are passed to the component during
70  *   initialization in @ref DoInit()
71  * - from a CDB entry. The CDB can contain configuration objects for a
72  *   component and the component can implement the handling
73  *
74  * The component implements the @ref alihltcomponent-low-level-interface.
75  * for data processing.
76  *
77  * Using the latter case, a component can also be reconfigured. Special
78  * events are propageted through the chain in order to trigger the re-
79  * configuration. The component needs to implement the function
80  * @ref Reconfigure(). The simplest version of a configuration object is
81  * a string object (TObjString) containing configuration arguments.
82  *
83  * @ingroup alihlt_tutorial
84  */
85 class AliHLTSampleComponent1 : public AliHLTProcessor {
86 public:
87   AliHLTSampleComponent1();
88   virtual ~AliHLTSampleComponent1();
89
90   // AliHLTComponent interface functions
91   const char* GetComponentID();
92   void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
93   AliHLTComponentDataType GetOutputDataType();
94   virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
95   void GetOCDBObjectDescription( TMap* const targetArray);
96
97   // Spawn function, return new class instance
98   AliHLTComponent* Spawn();
99
100  protected:
101   // AliHLTComponent interface functions
102   int DoInit( int argc, const char** argv );
103   int DoDeinit();
104   int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
105                        AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
106                        AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
107   int ScanConfigurationArgument(int argc, const char** argv);
108   int Reconfigure(const char* cdbEntry, const char* chainId);
109   int ReadPreprocessorValues(const char* modules);
110
111   using AliHLTProcessor::DoEvent;
112
113 private:
114
115   int fArgument1; //!transient
116   int fArgument2; //!transient
117
118   // version no 0 -> no streamer for member variables
119   ClassDef(AliHLTSampleComponent1, 0)
120 };
121 #endif