/// @return True if the generation of the LUT file succeeded.
AliHLTMUONTriggerReconstructorComponent comp;
-
- if (ddl < 20 or 21 < ddl)
+ try
{
- std::cerr << "ERROR: the DDL number must be in the range [20..21]." << std::endl;
- return false;
+ // Perform minimal initialisation to be able to fill the LUT buffer.
+ comp.fTrigRec = new AliHLTMUONTriggerReconstructor();
}
-
- char ddlNum[32];
- char runNum[32];
- sprintf(ddlNum, "%d", ddl+1);
- sprintf(runNum, "%d", run);
- int argc = 7;
- const char* argv[8] = {"-ddl", ddlNum, "-cdbpath", cdbPath, "-run", runNum, "-dont_use_crateid", NULL};
- if (useCrateId)
+ catch (const std::bad_alloc&)
{
- argv[6] = NULL;
- argc--;
+ std::cerr << "ERROR: Could not allocate more memory for the trigger reconstructor component." << std::endl;
+ return false;
}
- int result = comp.DoInit(argc, argv);
- if (result != 0)
+
+ if (ddl < 20 or 21 < ddl)
{
- // Error message already generated in DoInit.
+ std::cerr << "ERROR: the DDL number must be in the range [20..21]." << std::endl;
return false;
}
+ comp.fDDL = ddl;
+ comp.fUseCrateId = useCrateId;
+ if (comp.SetCDBPathAndRunNo(cdbPath, run) != 0) return false;
+ if (comp.ReadLutFromCDB() != 0) return false;
+
std::fstream file(filename, std::ios::out);
if (not file)
{
}
file.close();
- comp.DoDeinit();
-
return true;
}