enable component substitution
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Aug 2010 11:02:22 +0000 (11:02 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Aug 2010 11:02:22 +0000 (11:02 +0000)
replace a component of the chain configuration by another component and corresponding component arguments
useful to write the input of components to files for subsequent stand-alone studies

HLT/BASE/AliHLTTask.cxx

index cca9496..9fa0adb 100644 (file)
@@ -39,6 +39,7 @@ using namespace std;
 #include <ctime>
 #include "AliHLTTask.h"
 #include "AliHLTConfiguration.h"
+#include "AliHLTConfigurationHandler.h"
 #include "AliHLTComponent.h"
 #include "AliHLTComponentHandler.h"
 #include "TList.h"
@@ -112,10 +113,14 @@ int AliHLTTask::Init(AliHLTConfiguration* pConf, AliHLTComponentHandler* pCH)
   return iResult;
 }
 
-int AliHLTTask::CreateComponent(AliHLTConfiguration* pConf, AliHLTComponentHandler* pCH, AliHLTComponent*& pComponent) const
+int AliHLTTask::CreateComponent(AliHLTConfiguration* pConfiguration, AliHLTComponentHandler* pCH, AliHLTComponent*& pComponent) const
 {
   // see header file for class documentation
   int iResult=0;
+  if (!pConfiguration) return -EINVAL;
+
+  const AliHLTConfiguration* pConf=AliHLTConfigurationHandler::FindSubstitution(*pConfiguration);
+  if (!pConf) pConf=pConfiguration;
   if (pConf) {
     if (pCH) {
       int argc=0;