3 /** @file AliHLTAgentSample.cxx
4 @author Matthias Richter
6 @brief Agent of the libAliHLTSample library
9 #include "AliHLTAgentSample.h"
10 #include "AliHLTConfiguration.h"
13 /** global instance for agent registration */
14 AliHLTAgentSample gAliHLTAgentSample;
16 const char* AliHLTAgentSample::fgkAliHLTAgentSampleData="/tmp/testdata";
17 const char* AliHLTAgentSample::fgkAliHLTAgentSampleOut="/tmp/hltout";
19 /** ROOT macro for the implementation of ROOT specific class methods */
20 ClassImp(AliHLTAgentSample)
22 AliHLTAgentSample::AliHLTAgentSample()
24 // see header file for class documentation
26 // refer to README to build package
28 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
31 AliHLTAgentSample::~AliHLTAgentSample()
33 // see header file for class documentation
35 // delete the test data
36 ofstream dump(fgkAliHLTAgentSampleData, ios::in);
38 TString arg("rm -f ");
39 arg+=fgkAliHLTAgentSampleData;
40 gSystem->Exec(arg.Data());
44 int AliHLTAgentSample::CreateConfigurations(AliHLTConfigurationHandler* handler,
45 AliRunLoader* runloader) const
47 // see header file for class documentation
49 // create some test data
50 ofstream dump(fgkAliHLTAgentSampleData, (ios::openmode)0);
51 dump << "This is just some test data for the ALICE HLT analysis example";
52 dump << "---- not copied" << endl;
56 // the publisher configuration for the test data
57 TString arg("-datafile ");
58 arg+=fgkAliHLTAgentSampleData;
60 handler->CreateConfiguration("sample-fp1" , "FilePublisher", NULL , arg.Data());
62 // the configuration for the dummy component
63 handler->CreateConfiguration("sample-cp" , "Dummy" , "sample-fp1", "output_percentage 80");
65 // the writer configuration
66 arg="-datafile "; arg+=fgkAliHLTAgentSampleOut;
67 handler->CreateConfiguration("sample-sink1", "FileWriter" , "sample-cp" , arg.Data());
69 // sample offline source
70 handler->CreateConfiguration("sample-offsrc", "AliLoaderPublisher" , NULL , "-loader TPCLoader -tree digits -verbose");
72 // sample offline sink
73 handler->CreateConfiguration("sample-offsnk", "SampleOfflineDataSink" , "sample-offsrc" , NULL);
78 const char* AliHLTAgentSample::GetLocalRecConfigurations(AliRunLoader* runloader) const
80 // see header file for class documentation
81 return "sample-sink1 sample-offsnk";
84 const char* AliHLTAgentSample::GetRequiredComponentLibraries() const
86 // see header file for class documentation
87 return "libAliHLTUtil.so libAliHLTSample.so";