#include "AliHLTOUTRawReader.h"
#include "AliHLTOUTDigitReader.h"
#include "AliHLTEsdManager.h"
+#include "AliHLTPluginBase.h"
ClassImp(AliHLTReconstructor)
AliHLTReconstructor::AliHLTReconstructor()
:
AliReconstructor(),
- AliHLTReconstructorBase(),
fFctProcessHLTOUT(NULL),
- fpEsdManager(NULL)
+ fpEsdManager(NULL),
+ fpPluginBase(new AliHLTPluginBase)
{
//constructor
}
AliHLTReconstructor::AliHLTReconstructor(const char* options)
:
AliReconstructor(),
- AliHLTReconstructorBase(),
fFctProcessHLTOUT(NULL),
- fpEsdManager(NULL)
+ fpEsdManager(NULL),
+ fpPluginBase(new AliHLTPluginBase)
{
//constructor
if (options) Init(options);
{
//destructor
- AliHLTSystem* pSystem=GetInstance();
+ if (fpPluginBase) {
+ AliHLTSystem* pSystem=fpPluginBase->GetInstance();
if (pSystem) {
- AliDebug(0, Form("delete HLT system: status %#x", pSystem->GetStatusFlags()));
+ AliDebug(0, Form("terminate HLT system: status %#x", pSystem->GetStatusFlags()));
if (pSystem->CheckStatus(AliHLTSystem::kStarted)) {
// send specific 'event' to execute the stop sequence
pSystem->Reconstruct(0, NULL, NULL);
}
}
+ delete fpPluginBase;
+ }
+ fpPluginBase=NULL;
if (fpEsdManager) AliHLTEsdManager::Delete(fpEsdManager);
fpEsdManager=NULL;
void AliHLTReconstructor::Init()
{
// init the reconstructor
- AliHLTSystem* pSystem=GetInstance();
+ if (!fpPluginBase) {
+ AliError("internal memory error: can not get AliHLTSystem instance from plugin");
+ return;
+ }
+
+ AliHLTSystem* pSystem=fpPluginBase->GetInstance();
if (!pSystem) {
AliError("can not create AliHLTSystem object");
return;
return;
}
+ TString esdManagerOptions;
+
// the options scan has been moved to AliHLTSystem, the old code
// here is kept to be able to run an older version of the HLT code
// with newer AliRoot versions.
}
} else if (token.Contains("alilog=off")) {
pSystem->SwitchAliLog(0);
+ } else if (token.Contains("esdmanager=")) {
+ token.ReplaceAll("esdmanager=", "");
+ token.ReplaceAll(","," ");
+ token.ReplaceAll("'","");
+ esdManagerOptions=token;
} else if (token.BeginsWith("lib") && token.EndsWith(".so")) {
libs+=token;
libs+=" ";
}
gSystem->Load("libHLTinterface.so");
- fFctProcessHLTOUT=gSystem->DynFindSymbol("libHLTinterface.so", "AliHLTSystemProcessHLTOUT");
+ fFctProcessHLTOUT=(void (*)())gSystem->DynFindSymbol("libHLTinterface.so", "AliHLTSystemProcessHLTOUT");
fpEsdManager=AliHLTEsdManager::New();
+ fpEsdManager->SetOption(esdManagerOptions.Data());
}
void AliHLTReconstructor::Reconstruct(AliRawReader* rawReader, TTree* /*clustersTree*/) const
// For each event, HLT reconstruction chains can be executed and
// added to the existing HLTOUT data
// The HLTOUT data is finally processed in FillESD
+ if (!fpPluginBase) {
+ AliError("internal memory error: can not get AliHLTSystem instance from plugin");
+ return;
+ }
+
int iResult=0;
- AliHLTSystem* pSystem=GetInstance();
+ AliHLTSystem* pSystem=fpPluginBase->GetInstance();
if (pSystem) {
if (pSystem->CheckStatus(AliHLTSystem::kError)) {
return;
}
- AliHLTSystem* pSystem=GetInstance();
+ if (!fpPluginBase) {
+ AliError("internal memory error: can not get AliHLTSystem instance from plugin");
+ return;
+ }
+
+ AliHLTSystem* pSystem=fpPluginBase->GetInstance();
if (pSystem) {
if (pSystem->CheckStatus(AliHLTSystem::kError)) {
TString option = GetOption();
if (!option.IsNull() &&
(option.Contains("config=") || option.Contains("chains="))) {
- AliWarning(Form("HLT reconstruction of simulated data takes place in AliSimulation\n"
+ AliWarning(Form("HLT reconstruction can be run embedded into Alireconstruction from\n"
+ "raw data (real or simulated)). Reconstruction of of digit data takes\n"
+ "place in AliSimulation, appropriate input conversion is needed.\n"
+ "Consider running embedded into AliSimulation."
" /*** run macro *****************************************/\n"
" AliSimulation sim;\n"
" sim.SetRunHLT(\"%s\");\n"
" sim.Run();\n"
" /*********************************************************/", option.Data()));
}
- AliHLTSystem* pSystem=GetInstance();
+ if (!fpPluginBase) {
+ AliError("internal memory error: can not get AliHLTSystem instance from plugin");
+ return;
+ }
+
+ AliHLTSystem* pSystem=fpPluginBase->GetInstance();
if (pSystem) {
if (pSystem->CheckStatus(AliHLTSystem::kError)) {
AliError("HLT system in error state");
{
// treatment of simulated or real HLTOUT data
if (!pHLTOUT) return;
- AliHLTSystem* pSystem=GetInstance();
+ if (!fpPluginBase) {
+ AliError("internal memory error: can not get AliHLTSystem instance from plugin");
+ return;
+ }
+
+ AliHLTSystem* pSystem=fpPluginBase->GetInstance();
if (!pSystem) {
AliError("error getting HLT system instance");
return;