From b117e6aaa55f9f03d249ce5421e2500001dbad64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Fri, 5 Apr 2024 20:39:02 +0200 Subject: [PATCH] Use trackmap instead --- Biasing/src/Biasing/Utility/StepPrinter.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Biasing/src/Biasing/Utility/StepPrinter.cxx b/Biasing/src/Biasing/Utility/StepPrinter.cxx index ef3d0b0f0..ec81897d6 100644 --- a/Biasing/src/Biasing/Utility/StepPrinter.cxx +++ b/Biasing/src/Biasing/Utility/StepPrinter.cxx @@ -38,12 +38,17 @@ void StepPrinter::stepping(const G4Step* step) { // This could be a negated condition, but it is easier to read this way // - if (trackID == trackID_ || // We are the track of interest - isDescendent(track) || // We are a descendent of the track of interest - processName == processName_ // The parent process was the process of interest + auto trackMap{simcore::g4user::TrackingAction::get()->getTrackMap()}; + auto found{isDescendent(track)}; + if (trackID == trackID_ || // We are the track of interest + trackMap.isDescendant( + trackID, trackID_, + depth_) || // We are a descendent of the track of interest + processName == + processName_ // The parent process was the process of interest ) { // This is an interesting track -> Carry on processing - } else { + } else { return; } // Get the particle name.