From 86404506694964afc87c74a2b45724044f2b5587 Mon Sep 17 00:00:00 2001 From: Sandro Wenzel Date: Mon, 9 Nov 2026 21:00:32 +0100 Subject: [PATCH] Fix the inverted and the external primary transport selection in the Stack This fixes two problems in the transport selection of primaries. - With transportPrimaryInvert, the lambda negated the std::function instead of its result, so every primary was held back. - After loading an external selection, the check tested the member instead of the loaded function, so a failed load was not detected. Co-Authored-By: Claude Opus 5.5 --- Detectors/Base/src/Stack.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Detectors/Base/src/Stack.cxx b/Detectors/Base/src/Stack.cxx index e7caca2982318..cf80c45d3d11c 100644 --- a/Detectors/Base/src/Stack.cxx +++ b/Detectors/Base/src/Stack.cxx @@ -101,7 +101,7 @@ Stack::Stack(Int_t size) transportPrimary = o2::conf::GetFromMacro(param.transportPrimaryFileName, param.transportPrimaryFuncName, "o2::data::Stack::TransportFcn", "stack_transport_primary"); - if (!mTransportPrimary) { + if (!transportPrimary) { LOG(fatal) << "Failed to retrieve external \'transportPrimary\' function: problem with configuration "; } LOG(info) << "Successfully retrieve external \'transportPrimary\' frunction: " << param.transportPrimaryFileName; @@ -110,7 +110,7 @@ Stack::Stack(Int_t size) } if (param.transportPrimaryInvert) { - mTransportPrimary = [transportPrimary](const TParticle& p, const std::vector& particles) { return !transportPrimary; }; + mTransportPrimary = [transportPrimary](const TParticle& p, const std::vector& particles) { return !transportPrimary(p, particles); }; } else { mTransportPrimary = transportPrimary; }