#include "AliCDBId.h"
#include "AliCDBMetaData.h"
#include "AliHLTSystem.h"
+#include "AliHLTPluginBase.h"
#include "AliRawReaderFile.h"
#include "AliRawReaderDate.h"
#include "AliRawReaderRoot.h"
AliHLTSimulation::AliHLTSimulation()
:
fOptions(),
- fpSystem(NULL),
+ fpPluginBase(new AliHLTPluginBase),
fpRawReader(NULL)
{
// see header file for class documentation
AliHLTSimulation::~AliHLTSimulation()
{
// see header file for function documentation
- if (fpSystem) {
- delete fpSystem;
- }
- fpSystem=NULL;
+ if (fpPluginBase) delete fpPluginBase;
+ fpPluginBase=NULL;
+
if (fpRawReader) {
delete fpRawReader;
}
fOptions=options;
TString sysOp;
- if (!fpSystem) fpSystem=new AliHLTSystem;
- if (!fpSystem) {
- AliError("can not create AliHLTSystem object");
+ if(!fpPluginBase) {
+ AliError("internal initialization failed");
+ return -EINVAL;
+ }
+
+ AliHLTSystem* pSystem=fpPluginBase->GetInstance();
+ if (!pSystem) {
+ AliError("can not get AliHLTSystem instance");
return -ENOMEM;
}
- if (fpSystem->CheckStatus(AliHLTSystem::kError)) {
+ if (pSystem->CheckStatus(AliHLTSystem::kError)) {
AliError("HLT system in error state");
return -EFAULT;
}
}
// scan options
- if (fpSystem->ScanOptions(sysOp.Data())<0) {
+ if (pSystem->ScanOptions(sysOp.Data())<0) {
AliError("error setting options for HLT system");
return -EINVAL;
}
- if (!fpSystem->CheckStatus(AliHLTSystem::kReady)) {
- if ((fpSystem->Configure(fpRawReader, pRunLoader))<0) {
+ if (!pSystem->CheckStatus(AliHLTSystem::kReady)) {
+ if ((pSystem->Configure(fpRawReader, pRunLoader))<0) {
AliError("error during HLT system configuration");
return -EFAULT;
}
int AliHLTSimulation::Run(AliRunLoader* pRunLoader)
{
// HLT reconstruction for simulated data
+ if(!fpPluginBase) {
+ AliError("internal initialization failed");
+ return -EINVAL;
+ }
+
if(!pRunLoader) {
AliError("Missing RunLoader! 0x0");
return -EINVAL;
int nEvents = pRunLoader->GetNumberOfEvents();
int iResult=0;
- if (fpSystem->CheckStatus(AliHLTSystem::kError)) {
+ AliHLTSystem* pSystem=fpPluginBase->GetInstance();
+ if (!pSystem) {
+ AliError("can not get AliHLTSystem instance");
+ return -ENOMEM;
+ }
+
+ if (pSystem->CheckStatus(AliHLTSystem::kError)) {
AliError("HLT system in error state");
return -EFAULT;
}
// Note: the rawreader is already placed at the first event
- if ((iResult=fpSystem->Reconstruct(1, pRunLoader, fpRawReader))>=0) {
- fpSystem->FillESD(0, pRunLoader, NULL);
+ if ((iResult=pSystem->Reconstruct(1, pRunLoader, fpRawReader))>=0) {
+ pSystem->FillESD(0, pRunLoader, NULL);
for (int i=1; i<nEvents; i++) {
if (fpRawReader && !fpRawReader->NextEvent()) {
AliError("mismatch in event count, rawreader corrupted");
break;
}
- fpSystem->Reconstruct(1, pRunLoader, fpRawReader);
- fpSystem->FillESD(i, pRunLoader, NULL);
+ pSystem->Reconstruct(1, pRunLoader, fpRawReader);
+ pSystem->FillESD(i, pRunLoader, NULL);
}
// send specific 'event' to execute the stop sequence
- fpSystem->Reconstruct(0, NULL, NULL);
+ pSystem->Reconstruct(0, NULL, NULL);
}
return iResult;
}