X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2FSampleLib%2FAliHLTAgentSample.cxx;h=12eddfac543edf792529efbb9829752fd0a44ab0;hb=c1753823081855246c86c2709e1d1977de521fdf;hp=5a8f3d66b71a93120a1a128650b08ce1cfc5d0d3;hpb=d76bc02ae8e04af218822ec6515a4d5965db3b05;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/SampleLib/AliHLTAgentSample.cxx b/HLT/SampleLib/AliHLTAgentSample.cxx index 5a8f3d66b71..12eddfac543 100644 --- a/HLT/SampleLib/AliHLTAgentSample.cxx +++ b/HLT/SampleLib/AliHLTAgentSample.cxx @@ -29,6 +29,15 @@ // header files of library components #include "AliHLTDummyComponent.h" +#include "AliHLTSampleComponent1.h" +#include "AliHLTSampleComponent2.h" +#include "AliHLTSampleMonitoringComponent.h" + +// header file of the module preprocessor +#include "AliHLTSamplePreprocessor.h" + +// raw data handler of HLTOUT data +#include "AliHLTOUTHandlerEquId.h" /** global instance for agent registration */ AliHLTAgentSample gAliHLTAgentSample; @@ -40,6 +49,8 @@ const char* AliHLTAgentSample::fgkAliHLTAgentSampleOut="/tmp/hltout"; ClassImp(AliHLTAgentSample) AliHLTAgentSample::AliHLTAgentSample() + : + AliHLTModuleAgent("Sample") { // see header file for class documentation // or @@ -63,7 +74,7 @@ AliHLTAgentSample::~AliHLTAgentSample() int AliHLTAgentSample::CreateConfigurations(AliHLTConfigurationHandler* handler, AliRawReader* /*rawReader*/, - AliRunLoader* /*runloader*/) const + AliRunLoader* runloader) const { // see header file for class documentation @@ -87,20 +98,25 @@ int AliHLTAgentSample::CreateConfigurations(AliHLTConfigurationHandler* handler, arg="-datafile "; arg+=fgkAliHLTAgentSampleOut; handler->CreateConfiguration("sample-sink1", "FileWriter" , "sample-cp" , arg.Data()); + // specific example for the AliRoot simulation (run loader present) + if (runloader) { // sample offline source handler->CreateConfiguration("sample-offsrc", "AliLoaderPublisher" , NULL , "-loader TPCLoader -tree digits -verbose"); // sample offline sink handler->CreateConfiguration("sample-offsnk", "SampleOfflineDataSink" , "sample-offsrc" , NULL); + } } return 0; } const char* AliHLTAgentSample::GetReconstructionChains(AliRawReader* /*rawReader*/, - AliRunLoader* /*runloader*/) const + AliRunLoader* runloader) const { // see header file for class documentation - return "sample-sink1 sample-offsnk"; + if (runloader) return "sample-sink1 sample-offsnk"; + + return "sample-sink1"; } const char* AliHLTAgentSample::GetRequiredComponentLibraries() const @@ -115,6 +131,49 @@ int AliHLTAgentSample::RegisterComponents(AliHLTComponentHandler* pHandler) cons assert(pHandler); if (!pHandler) return -EINVAL; pHandler->AddComponent(new AliHLTDummyComponent); + pHandler->AddComponent(new AliHLTSampleComponent1); + pHandler->AddComponent(new AliHLTSampleComponent2); + pHandler->AddComponent(new AliHLTSampleMonitoringComponent); + + return 0; +} + +AliHLTModulePreprocessor* AliHLTAgentSample::GetPreprocessor() +{ + // see header file for class documentation + return new AliHLTSamplePreprocessor; +} + +int AliHLTAgentSample::GetHandlerDescription(AliHLTComponentDataType dt, + AliHLTUInt32_t spec, + AliHLTOUTHandlerDesc& desc) const +{ + // see header file for class documentation + if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginSample)) { + desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId()); + HLTInfo("module %s handles data block type %s specification %d (0x%x)", + GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec); + return 1; + } return 0; } +AliHLTOUTHandler* AliHLTAgentSample::GetOutputHandler(AliHLTComponentDataType dt, + AliHLTUInt32_t /*spec*/) +{ + // see header file for class documentation + if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginSample)) { + // use the default handler + return new AliHLTOUTHandlerEquId; + } + return NULL; +} + +int AliHLTAgentSample::DeleteOutputHandler(AliHLTOUTHandler* pInstance) +{ + // see header file for class documentation + if (pInstance==NULL) return -EINVAL; + + delete pInstance; + return 0; +}