From 2894a0c933f304a64c12524138f980a805323c0f Mon Sep 17 00:00:00 2001 From: aszostak Date: Tue, 21 Sep 2010 16:21:25 +0000 Subject: [PATCH] Adding the posibility to set the participating detectors when running in AliHLTSystem. --- HLT/BASE/AliHLTSystem.cxx | 11 +++++++---- HLT/BASE/AliHLTSystem.h | 9 +++++++-- HLT/BASE/AliHLTTask.cxx | 7 +++++-- HLT/BASE/AliHLTTask.h | 5 +++-- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/HLT/BASE/AliHLTSystem.cxx b/HLT/BASE/AliHLTSystem.cxx index 3a9b5d467e8..fc7eec8367c 100644 --- a/HLT/BASE/AliHLTSystem.cxx +++ b/HLT/BASE/AliHLTSystem.cxx @@ -340,7 +340,8 @@ void AliHLTSystem::PrintTaskList() } int AliHLTSystem::Run(Int_t iNofEvents, int bStop, AliHLTUInt64_t trgMask, - AliHLTUInt32_t timestamp, AliHLTUInt32_t eventtype) + AliHLTUInt32_t timestamp, AliHLTUInt32_t eventtype, + AliHLTUInt32_t participatingDetectors) { // see header file for class documentation int iResult=0; @@ -366,8 +367,9 @@ int AliHLTSystem::Run(Int_t iNofEvents, int bStop, AliHLTUInt64_t trgMask, } if (eventtype == 0) { eventtype = gkAliEventTypeData; + participatingDetectors = 0x0; } - if ((iResult=ProcessTasks(i, trgMask, timestamp, eventtype))>=0) { + if ((iResult=ProcessTasks(i, trgMask, timestamp, eventtype, participatingDetectors))>=0) { fGoodEvents++; iCount++; } else { @@ -580,7 +582,8 @@ int AliHLTSystem::StartTasks() } int AliHLTSystem::ProcessTasks(Int_t eventNo, AliHLTUInt64_t trgMask, - AliHLTUInt32_t timestamp, AliHLTUInt32_t eventtype) + AliHLTUInt32_t timestamp, AliHLTUInt32_t eventtype, + AliHLTUInt32_t participatingDetectors) { // see header file for class documentation int iResult=0; @@ -590,7 +593,7 @@ int AliHLTSystem::ProcessTasks(Int_t eventNo, AliHLTUInt64_t trgMask, TObject* obj=lnk->GetObject(); if (obj) { AliHLTTask* pTask=(AliHLTTask*)obj; - iResult=pTask->ProcessTask(eventNo, eventtype, trgMask, timestamp); + iResult=pTask->ProcessTask(eventNo, eventtype, trgMask, timestamp, participatingDetectors); // ProcInfo_t ProcInfo; // gSystem->GetProcInfo(&ProcInfo); // HLTInfo("task %s processed (%d), current memory usage %d %d", pTask->GetName(), iResult, ProcInfo.fMemResident, ProcInfo.fMemVirtual); diff --git a/HLT/BASE/AliHLTSystem.h b/HLT/BASE/AliHLTSystem.h index cb840ff77ed..3c649407284 100644 --- a/HLT/BASE/AliHLTSystem.h +++ b/HLT/BASE/AliHLTSystem.h @@ -206,10 +206,14 @@ class AliHLTSystem : public AliHLTLogging { * @param trgMask ctp trigger mask from the rawreader * @param timestamp timestamp of the event, read from the rawreader * @param eventtype event type, read from the rawreader + * @param participatingDetectors the bit flags of the participating detectors + * as will we inserted into the Common Data Header. This should only + * be used for software event types. * @return number of reconstructed events, neg error code if failed */ int Run(Int_t iNofEvents, int bStop, AliHLTUInt64_t trgMask, - AliHLTUInt32_t timestamp, AliHLTUInt32_t eventtype); + AliHLTUInt32_t timestamp, AliHLTUInt32_t eventtype, + AliHLTUInt32_t participatingDetectors = 0); /** * Run the tasklist @@ -274,7 +278,8 @@ class AliHLTSystem : public AliHLTLogging { * @return neg error code if failed */ int ProcessTasks(Int_t eventNo, AliHLTUInt64_t trgMask, - AliHLTUInt32_t timestamp, AliHLTUInt32_t eventtype); + AliHLTUInt32_t timestamp, AliHLTUInt32_t eventtype, + AliHLTUInt32_t participatingDetectors = 0); /** * Stop task list. diff --git a/HLT/BASE/AliHLTTask.cxx b/HLT/BASE/AliHLTTask.cxx index 9bb842d6f20..ad50928fa1c 100644 --- a/HLT/BASE/AliHLTTask.cxx +++ b/HLT/BASE/AliHLTTask.cxx @@ -450,7 +450,8 @@ int AliHLTTask::EndRun() return iResult; } -int AliHLTTask::ProcessTask(Int_t eventNo, AliHLTUInt32_t eventType, AliHLTUInt64_t trgMask, AliHLTUInt32_t timestamp) +int AliHLTTask::ProcessTask(Int_t eventNo, AliHLTUInt32_t eventType, AliHLTUInt64_t trgMask, + AliHLTUInt32_t timestamp, AliHLTUInt32_t participatingDetectors) { // see header file for function documentation int iResult=0; @@ -580,7 +581,8 @@ int AliHLTTask::ProcessTask(Int_t eventNo, AliHLTUInt32_t eventType, AliHLTUInt6 trigData.fStructSize=sizeof(trigData); trigData.fDataSize=sizeof(AliHLTEventTriggerData); memset(&evtTrigData, 0, trigData.fDataSize); - // Setup the CDH in the trigger data, based on the event type and CTP trigger. + // Setup the CDH in the trigger data, based on the event type, CTP trigger + // mask and participating detectors. evtTrigData.fCommonHeaderWordCnt=gkAliHLTCommonHeaderCount; AliHLTUInt8_t l1msg = 0x0; switch (eventType) @@ -593,6 +595,7 @@ int AliHLTTask::ProcessTask(Int_t eventNo, AliHLTUInt32_t eventType, AliHLTUInt6 case gkAliEventTypeSoftware: l1msg = 0x01; break; } evtTrigData.fCommonHeader[1] = AliHLTUInt32_t(l1msg) << 14; + evtTrigData.fCommonHeader[3] = ((l1msg & 0x1) == 0x1) ? (participatingDetectors & 0xFFFFFF) : 0x0; evtTrigData.fCommonHeader[5]=trgMask&0xffffffff; trgMask>>=32; evtTrigData.fCommonHeader[6]=trgMask&0x3ffff; diff --git a/HLT/BASE/AliHLTTask.h b/HLT/BASE/AliHLTTask.h index 26cd21d77fb..01a72dec49d 100644 --- a/HLT/BASE/AliHLTTask.h +++ b/HLT/BASE/AliHLTTask.h @@ -207,7 +207,8 @@ class AliHLTTask : public TObject, public AliHLTLogging { * The @ref StartRun method must be called before. */ int ProcessTask(Int_t eventNo, AliHLTUInt32_t eventType, - AliHLTUInt64_t trgMask, AliHLTUInt32_t timestamp); + AliHLTUInt64_t trgMask, AliHLTUInt32_t timestamp, + AliHLTUInt32_t participatingDetectors = 0); /** * Determine the number of matching data block between the component and the @@ -329,7 +330,7 @@ class AliHLTTask : public TObject, public AliHLTLogging { */ vector fBlockDataArray; //! transient - ClassDef(AliHLTTask, 2); + ClassDef(AliHLTTask, 0); }; #endif -- 2.43.0