diff --git a/GPU/GPUTracking/Definitions/GPUSettingsListStandalone.h b/GPU/GPUTracking/Definitions/GPUSettingsListStandalone.h index 21ca208164d42..8e979adbaa0cc 100644 --- a/GPU/GPUTracking/Definitions/GPUSettingsListStandalone.h +++ b/GPU/GPUTracking/Definitions/GPUSettingsListStandalone.h @@ -95,7 +95,7 @@ AddOption(runCompression, int32_t, 1, "", 0, "Enable TPC Compression") AddOption(runTransformation, int32_t, 1, "", 0, "Enable TPC Transformation") AddOption(runRefit, bool, false, "", 0, "Enable final track refit") AddOption(setO2Settings, bool, false, "", 0, "Set O2 defaults for output of shared cluster map, referenceX") -AddOption(recreateTrivialCalibObjects, bool, false, "", 0, "Recreate trivial calibration objects (TPCTransform, dEdxCorrection) from scratch") +AddOption(recreateTrivialCalibObjects, int64_t, 0, "", 0, "Recreate trivial calibration objects (TPCTransform, dEdxCorrection, ...) from scratch, O2 build: CCDB objects (material LUT) for the current time, or for this timestamp (ms) if != 1", def(1)) AddHelp("help", 'h') AddHelpAll("helpall", 'H') AddSubConfig(GPUSettingsRec, rec) diff --git a/GPU/GPUTracking/Standalone/Benchmark/CMakeLists.txt b/GPU/GPUTracking/Standalone/Benchmark/CMakeLists.txt index c2cdfd08ee7a0..d3bef7c0be1f6 100644 --- a/GPU/GPUTracking/Standalone/Benchmark/CMakeLists.txt +++ b/GPU/GPUTracking/Standalone/Benchmark/CMakeLists.txt @@ -20,7 +20,7 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2") o2_add_executable(standalone-benchmark COMPONENT_NAME gpu TARGETVARNAME targetName - PUBLIC_LINK_LIBRARIES O2::GPUO2Interface O2::GPUTracking O2::TPCReconstruction + PUBLIC_LINK_LIBRARIES O2::GPUO2Interface O2::GPUTracking O2::TPCReconstruction O2::CCDB O2::DetectorsBase SOURCES ${SRCS}) endif() diff --git a/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx b/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx index 9518c52d9d140..e831163ac7204 100644 --- a/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx +++ b/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx @@ -12,6 +12,13 @@ /// \file standalone.cxx /// \author David Rohr +#ifndef GPUCA_STANDALONE +#include "GPUO2ExternalUser.h" // Compiled like O2 code using the GPU interface: full O2 headers (e.g. MatLayerCylSet::rectifyPtrFromFile), ROOT before the GPU headers +#include "CCDB/BasicCCDBManager.h" +#include "DetectorsBase/MatLayerCylSet.h" +#include "TPCBase/Mapper.h" +#endif + #include "utils/qconfig.h" #include "GPUReconstruction.h" #include "GPUReconstructionTimeframe.h" @@ -302,7 +309,7 @@ int32_t ReadConfiguration(int argc, char** argv) return (0); } -void CreateTrivialCalibObjects() +void CreateTrivialCalibObjects([[maybe_unused]] int64_t timestamp) // Timestamp of the CCDB objects (O2 build), 1: now { GPUCalibObjectsConst calib; @@ -319,8 +326,20 @@ void CreateTrivialCalibObjects() calib.dEdxCalibContainer = tmpdEdxCalibContainer.get(); auto tmpTPCPadGainCalib = std::make_unique(); calib.tpcPadGain = tmpTPCPadGainCalib.get(); - auto tmpTPCZSLinkMapping = std::make_unique(); +#ifndef GPUCA_STANDALONE + auto tmpTPCZSLinkMapping = std::make_unique(o2::tpc::Mapper::instance()); calib.tpcZSLinkMapping = tmpTPCZSLinkMapping.get(); + auto& ccdb = o2::ccdb::BasicCCDBManager::instance(); // Default CCDB server (NameConf), objects owned by the manager + ccdb.setFatalWhenNull(false); // Without CCDB access, write the other objects + if (timestamp != 1) { + ccdb.setTimestamp(timestamp); + } + if (auto* matLUT = ccdb.get("GLO/Param/MatLUT")) { + calib.matLUT = o2::base::MatLayerCylSet::rectifyPtrFromFile(matLUT); + } else { + printf("Could not fetch the material LUT from the CCDB, not written\n"); + } +#endif chainTracking->SetCalibObjects(calib); rec->DumpSettings("./"); @@ -806,7 +825,7 @@ int32_t main(int argc, char** argv) } if (configStandalone.recreateTrivialCalibObjects) { - CreateTrivialCalibObjects(); + CreateTrivialCalibObjects(configStandalone.recreateTrivialCalibObjects); return 0; }