+//_____________________________________________________________________________
+Bool_t AliSimulation::CreateHLT()
+{
+ // Init the HLT simulation.
+ // The function loads the library and creates the instance of AliHLTSimulation.
+ // the main reason for the decoupled creation is to set the transient OCDB
+ // objects before the OCDB is locked
+
+ // load the library dynamically
+ gSystem->Load(ALIHLTSIMULATION_LIBRARY);
+
+ // check for the library version
+ AliHLTSimulationGetLibraryVersion_t fctVersion=(AliHLTSimulationGetLibraryVersion_t)(gSystem->DynFindSymbol(ALIHLTSIMULATION_LIBRARY, ALIHLTSIMULATION_GET_LIBRARY_VERSION));
+ if (!fctVersion) {
+ AliError(Form("can not load library %s", ALIHLTSIMULATION_LIBRARY));
+ return kFALSE;
+ }
+ if (fctVersion()!= ALIHLTSIMULATION_LIBRARY_VERSION) {
+ AliWarning(Form("%s version does not match: compiled for version %d, loaded %d", ALIHLTSIMULATION_LIBRARY, ALIHLTSIMULATION_LIBRARY_VERSION, fctVersion()));
+ }
+
+ // print compile info
+ typedef void (*CompileInfo)( const char*& date, const char*& time);
+ CompileInfo fctInfo=(CompileInfo)gSystem->DynFindSymbol(ALIHLTSIMULATION_LIBRARY, "CompileInfo");
+ if (fctInfo) {
+ const char* date="";
+ const char* time="";
+ (*fctInfo)(date, time);
+ if (!date) date="unknown";
+ if (!time) time="unknown";
+ AliInfo(Form("%s build on %s (%s)", ALIHLTSIMULATION_LIBRARY, date, time));
+ } else {
+ AliInfo(Form("no build info available for %s", ALIHLTSIMULATION_LIBRARY));
+ }
+
+ // create instance of the HLT simulation
+ AliHLTSimulationCreateInstance_t fctCreate=(AliHLTSimulationCreateInstance_t)(gSystem->DynFindSymbol(ALIHLTSIMULATION_LIBRARY, ALIHLTSIMULATION_CREATE_INSTANCE));
+ if (fctCreate==NULL || (fpHLT=(fctCreate()))==NULL) {
+ AliError(Form("can not create instance of HLT simulation (creator %p)", fctCreate));
+ return kFALSE;
+ }
+
+ TString specObjects;
+ for (Int_t i = 0; i < fSpecCDBUri.GetEntriesFast(); i++) {
+ if (specObjects.Length()>0) specObjects+=" ";
+ specObjects+=fSpecCDBUri[i]->GetName();
+ }
+
+ AliHLTSimulationSetup_t fctSetup=(AliHLTSimulationSetup_t)(gSystem->DynFindSymbol(ALIHLTSIMULATION_LIBRARY, ALIHLTSIMULATION_SETUP));
+ if (fctSetup==NULL || fctSetup(fpHLT, this, specObjects.Data())<0) {
+ AliWarning(Form("failed to setup HLT simulation (function %p)", fctSetup));
+ }
+
+ return kTRUE;
+}
+