From bdd72b4e93e130f4cb6dc6c76c80a7cac682be76 Mon Sep 17 00:00:00 2001 From: aszostak Date: Sat, 12 Mar 2011 12:59:23 +0000 Subject: [PATCH] Use minimal initialisation for generating LUTs. --- ...liHLTMUONTriggerReconstructorComponent.cxx | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/HLT/MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructorComponent.cxx b/HLT/MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructorComponent.cxx index 9c9db9c8f49..795db0480e3 100644 --- a/HLT/MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructorComponent.cxx +++ b/HLT/MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructorComponent.cxx @@ -1116,31 +1116,28 @@ bool AliHLTMUONTriggerReconstructorComponent::GenerateLookupTable( /// @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) { @@ -1159,7 +1156,5 @@ bool AliHLTMUONTriggerReconstructorComponent::GenerateLookupTable( } file.close(); - comp.DoDeinit(); - return true; } -- 2.43.0