From ded149fd465c86f0273065af1c23acadca1e4da8 Mon Sep 17 00:00:00 2001 From: shahoian Date: Tue, 10 Mar 2026 22:29:56 +0100 Subject: [PATCH] Fix GPU b-field initialization The 12kA L3 field should be scaled wrt its own nominal rather than 30kA nominal Bz. Keep the old scaling for backward compatibility --- GPU/GPUTracking/Interface/GPUO2InterfaceUtils.cxx | 6 ++++++ GPU/GPUTracking/Interface/GPUO2InterfaceUtils.h | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/GPU/GPUTracking/Interface/GPUO2InterfaceUtils.cxx b/GPU/GPUTracking/Interface/GPUO2InterfaceUtils.cxx index 43b8dc21eaf15..fe446e36cfd0b 100644 --- a/GPU/GPUTracking/Interface/GPUO2InterfaceUtils.cxx +++ b/GPU/GPUTracking/Interface/GPUO2InterfaceUtils.cxx @@ -142,3 +142,9 @@ uint32_t GPUO2InterfaceUtils::getTpcMaxTimeBinFromNHbf(uint32_t nHbf) { return (nHbf * o2::constants::lhc::LHCMaxBunches + 2 * o2::tpc::constants::LHCBCPERTIMEBIN - 2) / o2::tpc::constants::LHCBCPERTIMEBIN; } + +float GPUO2InterfaceUtils::getNominalGPUBzFromCurrent(float l3curr) +{ + float al3curr = CAMath::Abs(l3curr); + return (CAMath::Abs(al3curr - 12000) < CAMath::Abs(al3curr - 30000) ? (2.04487f / 12000.f) : (5.00668f / 30000.f)) * l3curr; +} diff --git a/GPU/GPUTracking/Interface/GPUO2InterfaceUtils.h b/GPU/GPUTracking/Interface/GPUO2InterfaceUtils.h index 0b5d2b5aa3f7a..102c09c8903e5 100644 --- a/GPU/GPUTracking/Interface/GPUO2InterfaceUtils.h +++ b/GPU/GPUTracking/Interface/GPUO2InterfaceUtils.h @@ -51,10 +51,16 @@ class GPUO2InterfaceUtils template static void RunZSEncoder(const S& in, std::unique_ptr* outBuffer, uint32_t* outSizes, o2::raw::RawFileWriter* raw, const o2::InteractionRecord* ir, GPUO2InterfaceConfiguration& config, int32_t version, bool verify, bool padding = false, std::function&)> digitsFilter = nullptr); template - static float getNominalGPUBz(T& src) + static float getNominalGPUBzOld(T& src) { return (5.00668f / 30000.f) * src.getL3Current(); } + template + static float getNominalGPUBz(T& src) + { + return getNominalGPUBzFromCurrent(src.getL3Current()); + } + static float getNominalGPUBzFromCurrent(float l3curr); static std::unique_ptr getFullParam(float solenoidBz, uint32_t nHbfPerTf = 0, std::unique_ptr* pConfiguration = nullptr, std::unique_ptr* pO2Settings = nullptr, bool* autoMaxTimeBin = nullptr); static std::shared_ptr getFullParamShared(float solenoidBz, uint32_t nHbfPerTf = 0, std::unique_ptr* pConfiguration = nullptr, std::unique_ptr* pO2Settings = nullptr, bool* autoMaxTimeBin = nullptr); // Return owning pointer static void paramUseExternalOccupancyMap(GPUParam* param, uint32_t nHbfPerTf, const uint32_t* occupancymap, int32_t occupancyMapSize);