From 6a020c89c608a85195bd012f560bc30d41cd3119 Mon Sep 17 00:00:00 2001 From: Beomki Yeo Date: Tue, 8 Oct 2024 23:49:49 +0200 Subject: [PATCH] A track is matched if the number of measurements of major particle is larger than the half of the number of measurements --- .../src/efficiency/finding_performance_writer.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/performance/src/efficiency/finding_performance_writer.cpp b/performance/src/efficiency/finding_performance_writer.cpp index 28548703c7..f1c2a5a8c3 100644 --- a/performance/src/efficiency/finding_performance_writer.cpp +++ b/performance/src/efficiency/finding_performance_writer.cpp @@ -170,14 +170,15 @@ void finding_performance_writer::write_common( std::vector particle_hit_counts = identify_contributing_particles(measurements, evt_map.meas_ptc_map); - if (particle_hit_counts.size() == 1) { - auto pid = particle_hit_counts.at(0).ptc.particle_id; + // Consider it being matched if hit counts is larger than the half + // of the number of measurements + assert(measurements.size() > 0u); + if (particle_hit_counts.at(0).hit_counts >= measurements.size() / 2) { + const auto pid = particle_hit_counts.at(0).ptc.particle_id; match_counter[pid]++; - } - - if (particle_hit_counts.size() > 1) { + } else { for (particle_hit_count const& phc : particle_hit_counts) { - auto pid = phc.ptc.particle_id; + const auto pid = phc.ptc.particle_id; fake_counter[pid]++; } }