From 324ca3b45e196ae230b6d3c246f785fa1e114980 Mon Sep 17 00:00:00 2001 From: richterm Date: Sun, 16 Aug 2009 04:30:11 +0000 Subject: [PATCH] adding support for EventDoneData to AliHLTSystem --- HLT/BASE/AliHLTSystem.cxx | 16 ++++++++++++++++ HLT/BASE/AliHLTSystem.h | 6 ++++++ HLT/BASE/AliHLTTask.cxx | 7 +++++++ 3 files changed, 29 insertions(+) diff --git a/HLT/BASE/AliHLTSystem.cxx b/HLT/BASE/AliHLTSystem.cxx index 14d0b3edb92..100d6a2ff20 100644 --- a/HLT/BASE/AliHLTSystem.cxx +++ b/HLT/BASE/AliHLTSystem.cxx @@ -104,6 +104,7 @@ AliHLTSystem::AliHLTSystem(AliHLTComponentLogSeverity loglevel, const char* name memset(&env, 0, sizeof(AliHLTAnalysisEnvironment)); env.fStructSize=sizeof(AliHLTAnalysisEnvironment); env.fAllocMemoryFunc=AliHLTSystem::AllocMemory; + env.fGetEventDoneDataFunc=AliHLTSystem::AllocEventDoneData; env.fLoggingFunc=NULL; fpComponentHandler->SetEnvironment(&env); InitAliLogFunc(fpComponentHandler); @@ -788,6 +789,21 @@ void* AliHLTSystem::AllocMemory( void* /*param*/, unsigned long size ) return p; } +int AliHLTSystem::AllocEventDoneData( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd ) +{ + // see header file for class documentation + unsigned long blocksize=sizeof(AliHLTComponentEventDoneData)+size; + void* block=AllocMemory(NULL, blocksize); + if (!block) return -ENOMEM; + memset(block, 0, blocksize); + *edd=reinterpret_cast(block); + (*edd)->fStructSize=sizeof(AliHLTComponentEventDoneData); + (*edd)->fDataSize=size; + (*edd)->fData=reinterpret_cast(block)+sizeof(AliHLTComponentEventDoneData); + + return 0; +} + int AliHLTSystem::Reconstruct(int nofEvents, AliRunLoader* runLoader, AliRawReader* rawReader) { diff --git a/HLT/BASE/AliHLTSystem.h b/HLT/BASE/AliHLTSystem.h index 1cddc0d0102..72d76bd9535 100644 --- a/HLT/BASE/AliHLTSystem.h +++ b/HLT/BASE/AliHLTSystem.h @@ -301,6 +301,12 @@ class AliHLTSystem : public AliHLTLogging { */ static void* AllocMemory( void* param, unsigned long size ); + /** + * The allocation function for component EventDoneData. + * This function is part of the running environment of the components. + */ + static int AllocEventDoneData( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd ); + /** * AliRoot embedded reconstruction. * Main entry point to execute the HLT reconstruction from AliRoot. Called diff --git a/HLT/BASE/AliHLTTask.cxx b/HLT/BASE/AliHLTTask.cxx index cdf8ab8d5f8..bd9bd9d4eb6 100644 --- a/HLT/BASE/AliHLTTask.cxx +++ b/HLT/BASE/AliHLTTask.cxx @@ -584,6 +584,13 @@ int AliHLTTask::ProcessTask(Int_t eventNo, AliHLTUInt32_t eventType) iResult=pComponent->ProcessEvent(evtData, &fBlockDataArray[0], trigData, pTgtBuffer, size, outputBlockCnt, outputBlocks, edd); HLTDebug("component %s ProcessEvent finnished (%d): size=%d blocks=%d", pComponent->GetComponentID(), iResult, size, outputBlockCnt); + // EventDoneData is for the moment ignored in AliHLTSystem + if (edd) { + HLTDebug("got EventDoneData size %d", edd->fDataSize); + delete [] reinterpret_cast(edd); + edd=NULL; + } + // remove event data block fBlockDataArray.pop_back(); -- 2.43.5