#include "AliHLTComponent.h"
#include "AliHLTConfiguration.h"
#include "AliHLTConfigurationHandler.h"
+#include "AliHLTOnlineConfiguration.h"
#include "AliHLTTask.h"
#include "AliHLTModuleAgent.h"
#include "AliHLTOfflineInterface.h"
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTSystem)
-AliHLTSystem::AliHLTSystem(AliHLTComponentLogSeverity loglevel, const char* name)
- :
- fpComponentHandler(AliHLTComponentHandler::CreateHandler()),
- fpConfigurationHandler(AliHLTConfigurationHandler::CreateHandler()),
+AliHLTSystem::AliHLTSystem(AliHLTComponentLogSeverity loglevel, const char* name,
+ AliHLTComponentHandler* pCompHandler,
+ AliHLTConfigurationHandler* pConfHandler
+ )
+ : fpComponentHandler(pCompHandler==NULL?AliHLTComponentHandler::CreateHandler():pCompHandler)
+ , fpConfigurationHandler(pConfHandler==NULL?AliHLTConfigurationHandler::CreateHandler():pConfHandler),
fTaskList(),
fState(0),
fChains(),
fpControlTask(NULL),
fName(name)
, fECSParams()
+ , fUseHLTOUTComponentTypeGlobal(true)
{
// see header file for class documentation
// or
} else if (token.Contains("config=")) {
TString param=token.ReplaceAll("config=", "");
Int_t error=0;
- gROOT->Macro(param.Data(), &error);
- if (error==0) {
- SetStatusFlags(kConfigurationLoaded);
+ if (token.EndsWith(".xml", TString::kIgnoreCase)) {
+ Int_t filesize = 0;
+ AliHLTOnlineConfiguration conf;
+ filesize = conf.LoadConfiguration(param.Data());
+ if (filesize <= 0) {
+ HLTError("can not load config \'%s\'", param.Data());
+ iResult=-EBADF;
+ } else {
+ error = conf.Parse();
+ if (error==0) {
+ fChains = conf.GetDefaultChains();
+ libs = conf.GetComponentLibraries();
+ libs += " ";
+ SetStatusFlags(kConfigurationLoaded);
+ } else {
+ HLTError("can not parse config \'%s\'", param.Data());
+ iResult=-EBADF;
+ }
+ }
} else {
- HLTError("can not execute macro \'%s\'", param.Data());
- iResult=-EBADF;
- }
+ gROOT->Macro(param.Data(), &error);
+ if (error==0) {
+ SetStatusFlags(kConfigurationLoaded);
+ } else {
+ HLTError("can not execute macro \'%s\'", param.Data());
+ iResult=-EBADF;
+ }
+ }
} else if (token.Contains("chains=")) {
TString param=token.ReplaceAll("chains=", "");
fChains=param.ReplaceAll(",", " ");
}
} else if (token.BeginsWith("ECS=")) {
fECSParams=token.ReplaceAll("ECS=", "");
+ } else if (token.BeginsWith("hltout-mode=")) {
+ // The actual parameter for argument 'hltout-mode' is treated in AliSimulation.
+ // For AliHLTSystem the occurrence with parameter 'split' signals the use of the
+ // separated HLTOUTComponents for digit and raw data. All others indicate
+ // HLTOUTComponent type 'global' where the data generation is steered from global
+ // flags
+ fUseHLTOUTComponentTypeGlobal=token.CompareTo("hltout-mode=split")==1;
} else if (token.BeginsWith("lib") && token.EndsWith(".so")) {
libs+=token;
libs+=" ";
// add the HLTOUT component
if (fpComponentHandler->FindComponentIndex("HLTOUT")>=0 ||
fpComponentHandler->LoadLibrary("libHLTsim.so")>=0) {
- AliHLTConfiguration globalout("_globalout_", "HLTOUT", chains.Data(), NULL);
+ // for the default HLTOUTComponent type 'global' the data generation is steered
+ // by global flags from AliSimulation. This allows for emulation of the old
+ // AliHLTSimulation behavior where only one chain is run on either digits or
+ // simulated raw data and the HLT digits and raw files have been generated
+ // depending on the configuration
+ const char* HLTOUTComponentId="HLTOUT";
+ if (!fUseHLTOUTComponentTypeGlobal) {
+ // choose the type of output depending on the availability of
+ // the raw reader
+ if (rawReader) HLTOUTComponentId="HLTOUTraw";
+ else HLTOUTComponentId="HLTOUTdigits";
+ }
+ AliHLTConfiguration globalout("_globalout_", HLTOUTComponentId, chains.Data(), NULL);
iResult=BuildTaskList("_globalout_");
} else {
HLTError("can not load libHLTsim.so and HLTOUT component");