3 #ifndef ALIHLTAGENTSAMPLE_H
4 #define ALIHLTAGENTSAMPLE_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
8 /** @file AliHLTAgentSample.h
9 @author Matthias Richter
11 @brief Agent of the libAliHLTSample library
14 #include "AliHLTModuleAgent.h"
17 * @class AliHLTAgentSample
18 * This is the agent for the AliHLTSample library.<br>
19 * The AliHLTSample library illustrates usage of the HLT framework. The
20 * agent provides information on the features of the sample components
21 * and the configuration which should be run during AliRoot reconstruction.
23 * The sample agent implements all interface function provided by @ref
25 * - CreateConfigurations() <br>
26 * The method gets an instance of the AliHLTConfigurationHanler to add
27 * configurations, e.g.
29 * handler->CreateConfiguration("my-puplisher" , "FilePublisher", NULL , "data.bin");
31 * handler->CreateConfiguration("my-analysis-chain" , "FileWriter", "my-processor" , "my arguments");
33 * - GetReconstructionChains() <br>
34 * returns a string of blank separated configurations to be run during
35 * local event reconstruction.
37 * return "my-data-sink my-analysis-chain";
39 * - GetRequiredComponentLibraries() <br>
40 * returns a string of blank separated libraries which have to be loaded
41 * in addition in order to load all required components. <br>
42 * @note Not the right place for library dependencies.
44 * return "libAliHLTUtil.so";
46 * - RegisterComponents() <br>
47 * registers the components: AliHLTDummyComponent, AliHLTSampleComponent1,
48 * AliHLTSampleComponent2, and AliHLTSampleMonitoringComponent<br>
49 * - GetHandlerDescription() <br>
50 * Handles HLTOUT data blocks of type {DDL_RAW,SMPL}
52 * if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginSample)) {
53 * desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId());
57 * - GetOutputHandler() <br>
58 * Returns handler AliHLTOUTHandlerEquId for HLTOUT data blocks of
61 * if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginSample)) {
62 * return new AliHLTOUTHandlerEquId;
65 * - DeleteOutputHandler() <br>
66 * Deletes the output handler. In this case there is no special handling
69 * In order to hook the sample library up to the HLT system on global object
70 * @ref gAliHLTAgentSample of the agent is defined in the source code.
72 * @ingroup alihlt_system
74 class AliHLTAgentSample : public AliHLTModuleAgent {
77 * standard constructor. The agent is automatically registered in the
78 * global agent manager
82 virtual ~AliHLTAgentSample();
85 * Register all configurations belonging to the sample library with the
86 * AliHLTConfigurationHandler. The agent can adapt the configurations
87 * to be registered to the current AliRoot setup by checking the
89 * @param handler [in] the configuration handler
90 * @param rawReader [in] AliRoot RawReader instance
91 * @param runloader [in] AliRoot runloader
92 * @return neg. error code if failed
94 int CreateConfigurations(AliHLTConfigurationHandler* handler,
95 AliRawReader* rawReader=NULL,
96 AliRunLoader* runloader=NULL) const;
99 * Get the top configurations for local event reconstruction.
100 * A top configuration describes a processing chain. It can simply be
101 * described by the last configuration(s) in the chain.
102 * The agent can adapt the configurations to be registered to the current
103 * AliRoot setup by checking the runloader.
104 * @param rawReader [in] AliRoot RawReader instance
105 * @param runloader [in] AliRoot runloader
106 * @return string containing the top configurations separated by blanks
108 const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
109 AliRunLoader* runloader=NULL) const;
112 * Component libraries which the configurations of this agent depend on.
113 * @return list of component libraries as a blank-separated string.
115 const char* GetRequiredComponentLibraries() const;
118 * Register components for the AliHLTSample library.
119 * @param pHandler [in] instance of the component handler
121 int RegisterComponents(AliHLTComponentHandler* pHandler) const;
123 int GetHandlerDescription(AliHLTComponentDataType dt,
125 AliHLTOUTHandlerDesc& desc) const;
126 AliHLTOUTHandler* GetOutputHandler(AliHLTComponentDataType dt,
127 AliHLTUInt32_t spec);
128 int DeleteOutputHandler(AliHLTOUTHandler* pInstance);
130 AliHLTModulePreprocessor* GetPreprocessor();
134 /** file name of the generated test data*/
135 static const char* fgkAliHLTAgentSampleData; //!transient
137 /** file name of the output file */
138 static const char* fgkAliHLTAgentSampleOut; //!transient
140 /** ROOT specific member definition */
141 ClassDef(AliHLTAgentSample, 1);