3 #ifndef ALIHLTSAMPLECOMPONENT1_H
4 #define ALIHLTSAMPLECOMPONENT1_H
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 */
10 /** @file AliHLTSampleComponent1.h
11 @author Matthias Richter, Timm Steinbeck
13 @brief A sample processing component for the HLT.
16 #include "AliHLTProcessor.h"
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.
25 * <h2>General properties:</h2>
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>
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
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
44 * an argument without parameters
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
51 * a configuration argument without parameters
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>
58 * \li -TObjString object holding a string with the configuration parameters
61 * <h2>Performance:</h2>
62 * The component does not any event data processing.
64 * <h2>Memory consumption:</h2>
65 * The component does not any event data processing.
67 * <h2>Output size:</h2>
68 * The component has no output data.
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
79 * The component implements the @ref alihltcomponent-low-level-interface.
80 * for data processing.
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.
88 * @ingroup alihlt_tutorial
90 class AliHLTSampleComponent1 : public AliHLTProcessor {
92 AliHLTSampleComponent1();
93 virtual ~AliHLTSampleComponent1();
95 // AliHLTComponent interface functions
96 const char* GetComponentID() { return "Sample-component1";}
97 void GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
98 list.push_back(kAliHLTAnyDataType);
100 AliHLTComponentDataType GetOutputDataType() {return kAliHLTVoidDataType;}
101 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {constBase = 0;inputMultiplier = 0;};
103 // Spawn function, return new class instance
104 AliHLTComponent* Spawn() {return new AliHLTSampleComponent1;};
107 // AliHLTComponent interface functions
108 int DoInit( int argc, const char** argv );
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);
116 using AliHLTProcessor::DoEvent;
120 * Configure the component.
121 * Parse a string for the configuration arguments and set the component
124 * This function illustrates the scanning of an argument string. The string
125 * was presumably fetched from the CDB.
127 int Configure(const char* arguments);
129 ClassDef(AliHLTSampleComponent1, 1)