#include "TObjArray.h"
#include "TObjString.h"
#include "AliHLTSimulation.h"
+#include "AliSimulation.h"
#include "AliLog.h"
#include "AliRun.h"
#include "AliRunLoader.h"
return LIBHLTSIM_VERSION;
}
-int AliHLTSimulationInitOCDB(AliHLTSimulation* /*pSim*/)
+int AliHLTSimulationSetup(AliHLTSimulation* /*pHLTSim*/, AliSimulation* pSim, const char* specificObjects)
{
// see header file for function documentation
// all the jobs want to put entries into the OCDB. The solution is to
// make them temporary, since they are only used to propagate information
// from the simulation to the reconstruction.
- AliCDBManager* man = AliCDBManager::Instance();
- if (man && man->IsDefaultStorageSet())
- {
- man->SetSpecificStorage("HLT/ConfigHLT/SolenoidBz", Form("local://%s",gSystem->pwd()));
- man->SetSpecificStorage("HLT/ConfigHLT/esdLayout", Form("local://%s",gSystem->pwd()));
+
+ if (!pSim) return -EINVAL;
+ const char* entries[]={
+ "HLT/ConfigHLT/SolenoidBz",
+ "HLT/ConfigHLT/esdLayout",
+ NULL
+ };
+
+ TString specificStorage;
+ specificStorage.Form("local://%s",gSystem->pwd());
+ for (const char** pEntry=entries; *pEntry!=NULL; pEntry++) {
+ const char* pObject=specificObjects?strstr(specificObjects, *pEntry):NULL;
+ if (pObject) {
+ // skip this entry if it is found in the list and either
+ // last one or separated by a blank
+ pObject+=strlen(*pEntry);
+ if (*pObject==0 || *pObject==' ') continue;
+ }
+ pSim->SetSpecificStorage(*pEntry, specificStorage.Data());
}
return 0;
}
-extern "C" void AliHLTSimulationCompileInfo(const char*& date, const char*& time)
+#ifndef HAVE_COMPILEINFO
+extern "C" void CompileInfo(const char*& date, const char*& time)
{
// the fall back compile info of the HLTsim library
// this is not up-to-date if other files have been changed and recompiled
date=__DATE__; time=__TIME__;
return;
}
+#endif
class AliRunLoader;
class AliHLTPluginBase;
class AliRawReader;
+class AliSimulation;
/**
* @class AliHLTSimulation
#define ALIHLTSIMULATION_LIBRARY_VERSION 0
#define ALIHLTSIMULATION_CREATE_INSTANCE "AliHLTSimulationCreateInstance"
#define ALIHLTSIMULATION_DELETE_INSTANCE "AliHLTSimulationDeleteInstance"
+#define ALIHLTSIMULATION_SETUP "AliHLTSimulationSetup"
#define ALIHLTSIMULATION_INIT "AliHLTSimulationInit"
#define ALIHLTSIMULATION_RUN "AliHLTSimulationRun"
#define ALIHLTSIMULATION_GET_LIBRARY_VERSION "AliHLTSimulationGetLibraryVersion"
#endif
typedef AliHLTSimulation* (*AliHLTSimulationCreateInstance_t)();
typedef int (*AliHLTSimulationDeleteInstance_t)(AliHLTSimulation* pSim);
+ typedef int (*AliHLTSimulationSetup_t)(AliHLTSimulation* pHLTSim, AliSimulation* pSim, const char* options);
typedef int (*AliHLTSimulationInit_t)(AliHLTSimulation* pSim, AliRunLoader* pRunLoader, const char* options);
typedef int (*AliHLTSimulationRun_t)(AliHLTSimulation* pSim, AliRunLoader* pRunLoader);
typedef int (*AliHLTSimulationGetLibraryVersion_t)();
*/
int AliHLTSimulationDeleteInstance(AliHLTSimulation* pSim);
/**
- * Set options for an instance
+ * Setup the HLT simulation.
+ * Setup is done right after the creation. To be called before
+ * the actual AliSimulation starts when the OCDB is not yet locked.
+ */
+ int AliHLTSimulationSetup(AliHLTSimulation* pHLTSim, AliSimulation* pSim, const char* options);
+ /**
+ * Set options for an instance.
+ * Init is invoked right before running HLT simulation, i.e. after all
+ * the other AliSimulation was done
*/
int AliHLTSimulationInit(AliHLTSimulation* pSim, AliRunLoader* pRunLoader, const char* options);
/**
* Get version no of the library/class interface
*/
int AliHLTSimulationGetLibraryVersion();
- /**
- * Init the OCDB for HLT simulation
- */
- int AliHLTSimulationInitOCDB(AliHLTSimulation* pSim);
#ifdef __cplusplus
}
#endif