From 2b0ac45009ee7f00d246ed2d66f29e4022542edd Mon Sep 17 00:00:00 2001 From: Simon Stute <75432735+sstute1@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:19:37 +0100 Subject: [PATCH] Bug fix in petsird_helpers.h In the get_detection_efficiency() function, there were some safety checks that did the opposite of what they were supposed to. --- cpp/petsird_helpers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/petsird_helpers.h b/cpp/petsird_helpers.h index aa1f788..78665c6 100644 --- a/cpp/petsird_helpers.h +++ b/cpp/petsird_helpers.h @@ -56,16 +56,16 @@ get_detection_efficiency(const ScannerInformation& scanner, const CoincidenceEve { float eff = 1.0F; const auto& det_el_efficiencies = scanner.detection_efficiencies.det_el_efficiencies; - if (!det_el_efficiencies) + if (det_el_efficiencies) { eff *= ((*det_el_efficiencies)(event.detector_ids[0], event.energy_indices[0]) * (*det_el_efficiencies)(event.detector_ids[1], event.energy_indices[1])); } const auto& module_pair_efficiencies_vector = scanner.detection_efficiencies.module_pair_efficiencies_vector; - if (!module_pair_efficiencies_vector) + if (module_pair_efficiencies_vector) { const auto& module_pair_SGID_LUT = scanner.detection_efficiencies.module_pair_sgidlut; - assert(!module_pair_SGID_LUT); + assert(module_pair_SGID_LUT); const auto mod_and_els = get_module_and_element(scanner.scanner_geometry, event.detector_ids); assert(scanner.scanner_geometry.replicated_modules.size() == 1);