From b2717a7ed68a551cd6fcf4d5642efaf5a6b7119c Mon Sep 17 00:00:00 2001
From: Lorenzo Pica <lorenzo.pica@cern.ch>
Date: Thu, 5 May 2022 17:18:45 +0200
Subject: [PATCH 1/6] Added compiling FilterSvs algorithm (almost empty)

---
 device/CMakeLists.txt                         |  1 +
 device/svs_pair_candidates/CMakeLists.txt     | 42 +++++++++++
 .../svs_pair_candidates/include/FilterSvs.cuh | 74 +++++++++++++++++++
 device/svs_pair_candidates/src/FilterSvs.cu   | 40 ++++++++++
 stream/CMakeLists.txt                         |  1 +
 5 files changed, 158 insertions(+)
 create mode 100644 device/svs_pair_candidates/CMakeLists.txt
 create mode 100644 device/svs_pair_candidates/include/FilterSvs.cuh
 create mode 100644 device/svs_pair_candidates/src/FilterSvs.cu

diff --git a/device/CMakeLists.txt b/device/CMakeLists.txt
index b47489364f5..28ce1bbc5f1 100644
--- a/device/CMakeLists.txt
+++ b/device/CMakeLists.txt
@@ -19,3 +19,4 @@ add_subdirectory(selections)
 add_subdirectory(event_model)
 add_subdirectory(validators)
 add_subdirectory(lumi)
+add_subdirectory(svs_pair_candidates)
diff --git a/device/svs_pair_candidates/CMakeLists.txt b/device/svs_pair_candidates/CMakeLists.txt
new file mode 100644
index 00000000000..4f9f5ede152
--- /dev/null
+++ b/device/svs_pair_candidates/CMakeLists.txt
@@ -0,0 +1,42 @@
+###############################################################################
+# (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration      #
+###############################################################################
+file(GLOB svs_pair_candidate_src "src/*cu")
+
+allen_add_device_library(Svs_pair_cand STATIC
+  ${svs_pair_candidate_src}
+)
+
+target_link_libraries(Svs_pair_cand PUBLIC Kalman PRIVATE Backend HostEventModel EventModel Utils)
+
+target_include_directories(VertexFitter PUBLIC
+  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
+
+
+if (USE_KALMAN_DOUBLE_PRECISION)
+  add_compile_definitions(KALMAN_DOUBLE_PRECISION)
+endif()
+
+
+
+
+
+
+
+
+
+
+
+#file(GLOB svs_pair_candidates_sources "src/*cu")
+
+#include_directories(include)
+#include_directories(${PROJECT_SOURCE_DIR}/device/velo/common/include)
+#include_directories(${PROJECT_SOURCE_DIR}/device/event_model/common/include)
+#include_directories(${PROJECT_SOURCE_DIR}/device/event_model/velo/include)
+#include_directories(${PROJECT_SOURCE_DIR}/main/include)
+#include_directories(${PROJECT_SOURCE_DIR}/stream/gear/include)
+#include_directories(${PROJECT_SOURCE_DIR}/stream/sequence/include)
+
+#allen_add_device_library(Svs_pair_cand STATIC
+#  ${svs_pair_candidates_sources}
+#)
diff --git a/device/svs_pair_candidates/include/FilterSvs.cuh b/device/svs_pair_candidates/include/FilterSvs.cuh
new file mode 100644
index 00000000000..537f43de032
--- /dev/null
+++ b/device/svs_pair_candidates/include/FilterSvs.cuh
@@ -0,0 +1,74 @@
+/*****************************************************************************\
+* (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration      *
+\*****************************************************************************/
+#pragma once
+
+#include "VertexDefinitions.cuh"
+
+#include "States.cuh"
+#include "AlgorithmTypes.cuh"
+#include "ParticleTypes.cuh"
+
+// #include "ParKalmanDefinitions.cuh"
+// #include "ParKalmanMath.cuh"
+// #include "ParKalmanFittedTrack.cuh"
+// #include "VertexDefinitions.cuh"
+// #include "PV_Definitions.cuh"
+// #include "SciFiConsolidated.cuh"
+// #include "UTConsolidated.cuh"
+// #include "VeloConsolidated.cuh"
+// #include "AssociateConsolidated.cuh"
+// #include "States.cuh"
+// #include "AlgorithmTypes.cuh"
+// #include "ParticleTypes.cuh"
+//
+namespace FilterSvs {
+
+  struct Parameters {
+    HOST_INPUT(host_number_of_events_t, unsigned) host_number_of_events;
+    HOST_INPUT(host_number_of_tracks_t, unsigned) host_number_of_tracks;
+    HOST_INPUT(host_number_of_svs_t, unsigned) host_number_of_svs;
+    MASK_INPUT(dev_event_list_t) dev_event_list;
+    DEVICE_INPUT(dev_number_of_events_t, unsigned) dev_number_of_events;
+    DEVICE_INPUT(dev_secondary_vertices_t, Allen::Views::Physics::MultiEventCompositeParticles) dev_secondary_vertices;
+    DEVICE_OUTPUT(dev_sv_atomics_t, unsigned) dev_sv_atomics;
+    DEVICE_OUTPUT(dev_svs_trk1_idx_t, unsigned) dev_svs_trk1_idx;
+    DEVICE_OUTPUT(dev_svs_trk2_idx_t, unsigned) dev_svs_trk2_idx;
+
+    DEVICE_OUTPUT_WITH_DEPENDENCIES(
+    dev_two_track_sv_track_pointers_t,
+      DEPENDENCIES(dev_secondary_vertices_t),
+      std::array<const Allen::Views::Physics::IParticle*, 4>)
+    dev_two_track_sv_track_pointers;
+
+    //Set all properties to filter svs
+    PROPERTY(track_min_ipchi2_t, "track_min_ipchi2", "minimum track IP chi2", float) track_min_ipchi2;
+    PROPERTY(vtx_max_chi2ndof_t, "vtx_max_chi2ndof", "max vertex chi2/ndof", float) vtx_max_chi2ndof;
+    PROPERTY(block_dim_filter_t, "block_dim_filter", "block dimensions for filter step", DeviceDimensions)
+    block_dim_filter;
+  };
+
+__global__ void filter_svs(Parameters);
+
+
+struct filter_svs_t : public DeviceAlgorithm, Parameters {
+  void set_arguments_size(
+    ArgumentReferences<Parameters> arguments,
+    const RuntimeOptions&,
+    const Constants&,
+    const HostBuffers&) const;
+
+    void operator()(
+      const ArgumentReferences<Parameters>& arguments,
+      const RuntimeOptions&,
+      const Constants&,
+      HostBuffers&,
+      const Allen::Context& context) const;
+
+  private:
+    Property<track_min_ipchi2_t> m_minipchi2 {this, 7.0f};
+    Property<vtx_max_chi2ndof_t> m_maxchi2ndof {this, 30.0f};
+    Property<block_dim_filter_t> m_block_dim_filter {this, {{16, 16, 1}}};
+
+  };
+}
diff --git a/device/svs_pair_candidates/src/FilterSvs.cu b/device/svs_pair_candidates/src/FilterSvs.cu
new file mode 100644
index 00000000000..bb3dd297cfb
--- /dev/null
+++ b/device/svs_pair_candidates/src/FilterSvs.cu
@@ -0,0 +1,40 @@
+ #include "../include/FilterSvs.cuh"
+
+ INSTANTIATE_ALGORITHM(FilterSvs::filter_svs_t)
+
+void FilterSvs::filter_svs_t::set_arguments_size(
+  ArgumentReferences<Parameters> arguments,
+  const RuntimeOptions&,
+  const Constants&,
+  const HostBuffers&) const
+{
+  set_size<dev_two_track_sv_track_pointers_t>(arguments, first<host_number_of_svs_t>(arguments));
+}
+
+void FilterSvs::filter_svs_t::operator()(
+  const ArgumentReferences<Parameters>& arguments,
+  const RuntimeOptions&,
+  const Constants&,
+  HostBuffers&,
+  const Allen::Context& context) const
+  {
+
+    global_function(filter_svs)(dim3(size<dev_event_list_t>(arguments)), property<block_dim_filter_t>(), context)(
+      arguments);
+  }
+
+  __global__ void FilterSvs::filter_svs(FilterSvs::Parameters parameters)
+  {
+
+    const unsigned event_number = parameters.dev_event_list[blockIdx.x];
+    const unsigned number_of_events = parameters.dev_number_of_events[0];
+
+    const auto composite_particles = parameters.dev_secondary_vertices->container(event_number);
+    const unsigned n_svs = composite_particles.size();
+
+    // unsigned* event_sv_number = parameters.dev_sv_atomics + event_number;
+    // unsigned* event_svs_trk1_idx = parameters.dev_svs_trk1_idx + idx_offset;
+    // unsigned* event_svs_trk2_idx = parameters.dev_svs_trk2_idx + idx_offset;
+
+
+   }
diff --git a/stream/CMakeLists.txt b/stream/CMakeLists.txt
index 4321af2d2a2..86c040de311 100644
--- a/stream/CMakeLists.txt
+++ b/stream/CMakeLists.txt
@@ -33,6 +33,7 @@ target_link_libraries(Stream
     HostErrorBanks
     Calo
     Muon
+    Svs_pair_cand
     Examples
     HostDataProvider
     HostInitEventList
-- 
GitLab


From b1c85b43f81eb2adf077dbb2757cc1496e74d17c Mon Sep 17 00:00:00 2001
From: Lorenzo Pica <lorenzo.pica@cern.ch>
Date: Thu, 5 May 2022 17:39:02 +0200
Subject: [PATCH 2/6] Add 2-SV combiner and 2-Ks line

Added loops over svs and right outputs

First complete filter alg (no selections)

Added 2KSs candidate creation algorithm

Fix filter SVs algorithm and add selections threshold

SV pair filter implementation

Implementation of views for 2KS pair candidates

Add particle_pointer to CompositeParticle

Use particle_pointer in 2 SVs CompositeParticle

Added FilterSvs and svsPairCandidate algorithms to secondary vertex reconstruction sequence

Tentative inclusion of TwoKs line (segfault)

Adapt to master

Fix dependency and configuration issues

Initialize number of SV pairs in SV filter

Fix event number when creating views

Re-apply HLT1TwoKs line selections in line definitions

Add pt(KS) selection to TwoKs line (lost in previous iterations)

Loosen selection in 2 SVs candidate filter

Remove wrong return True call in TwoKs line

Adapt TwoKsLine in HLT1.py to new changes

Fix copyright

Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Allen/-/jobs/22837574

Fix 2-Ks line configuration

Make naming more consistent in SV combiner

Remove 2Ks-specific property names from FilterSvs

Clean up TwoKsLine

Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Allen/-/jobs/22874940

Fix error in FilterSvs loop

Simplify SV filter

Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Allen/-/jobs/22876248

Add max combo calculator

Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Allen/-/jobs/22929044

Add copyright

Use input aggregates in max combo calculator

Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Allen/-/jobs/22936937

Added compiling FilterSvs algorithm (almost empty)

Added loops over svs and right outputs

First complete filter alg (no selections)

Added 2KSs candidate creation algorithm

Fix filter SVs algorithm and add selections threshold

SV pair filter implementation

Implementation of views for 2KS pair candidates

Use particle_pointer in 2 SVs CompositeParticle

Added FilterSvs and svsPairCandidate algorithms to secondary vertex reconstruction sequence

Adapt to master

Fix dependency and configuration issues

Initialize number of SV pairs in SV filter

Fix event number when creating views

Loosen selection in 2 SVs candidate filter

Fix copyright

Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Allen/-/jobs/22837574

Fix 2-Ks line configuration

Make naming more consistent in SV combiner

Clean up TwoKsLine

Simplify SV filter

Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Allen/-/jobs/22876248

Reference update

Add max combo calculator

Switch from initialize to memset_async

Change type of dev_multi_event_composites_ptr

Update references
---
 configuration/python/AllenConf/HLT1.py        |   5 +-
 .../python/AllenConf/hlt1_charm_lines.py      |   4 +-
 .../secondary_vertex_reconstruction.py        |  53 ++++++-
 device/CMakeLists.txt                         |   2 +-
 device/combiners/CMakeLists.txt               |  13 ++
 device/combiners/include/CalcMaxCombos.cuh    |  46 +++++++
 device/combiners/include/FilterSvs.cuh        |  69 ++++++++++
 device/combiners/include/SVCombiner.cuh       |  74 ++++++++++
 device/combiners/src/CalcMaxCombos.cu         |  83 +++++++++++
 device/combiners/src/FilterSvs.cu             |  96 +++++++++++++
 device/combiners/src/SVCombiner.cu            |  83 +++++++++++
 .../common/include/ParticleTypes.cuh          |   5 +
 .../lines/charm/include/TwoKsLine.cuh         |   5 +-
 .../selections/lines/charm/src/TwoKsLine.cu   | 129 +++++++-----------
 device/svs_pair_candidates/CMakeLists.txt     |  42 ------
 .../svs_pair_candidates/include/FilterSvs.cuh |  74 ----------
 device/svs_pair_candidates/src/FilterSvs.cu   |  40 ------
 .../vertex_fitter/include/VertexFitter.cuh    |   2 +-
 stream/CMakeLists.txt                         |   2 +-
 ...ster_v1_hlt1_pp_no_ut_validation_a5000.txt |   2 +
 ...r_v1_hlt1_pp_no_ut_validation_epyc7502.txt |   2 +
 ...1_pp_no_ut_validation_geforcertx2080ti.txt |   2 +
 ...lt1_pp_no_ut_validation_geforcertx3090.txt |   2 +
 ...lt1_pp_no_ut_validation_geforcertx3090.txt |   1 +
 24 files changed, 585 insertions(+), 251 deletions(-)
 create mode 100644 device/combiners/CMakeLists.txt
 create mode 100644 device/combiners/include/CalcMaxCombos.cuh
 create mode 100644 device/combiners/include/FilterSvs.cuh
 create mode 100644 device/combiners/include/SVCombiner.cuh
 create mode 100644 device/combiners/src/CalcMaxCombos.cu
 create mode 100644 device/combiners/src/FilterSvs.cu
 create mode 100644 device/combiners/src/SVCombiner.cu
 delete mode 100644 device/svs_pair_candidates/CMakeLists.txt
 delete mode 100644 device/svs_pair_candidates/include/FilterSvs.cuh
 delete mode 100644 device/svs_pair_candidates/src/FilterSvs.cu

diff --git a/configuration/python/AllenConf/HLT1.py b/configuration/python/AllenConf/HLT1.py
index c4fa54a5777..6b736e2ea47 100644
--- a/configuration/python/AllenConf/HLT1.py
+++ b/configuration/python/AllenConf/HLT1.py
@@ -5,7 +5,7 @@ from AllenConf.utils import line_maker, make_gec, make_checkPV, make_lowmult
 from AllenConf.odin import make_bxtype, odin_error_filter
 from AllenConf.hlt1_reconstruction import hlt1_reconstruction, validator_node
 from AllenConf.hlt1_inclusive_hadron_lines import make_track_mva_line, make_two_track_mva_line, make_kstopipi_line, make_two_track_line_ks
-from AllenConf.hlt1_charm_lines import make_d2kk_line, make_d2pipi_line, make_two_track_mva_charm_xsec_line
+from AllenConf.hlt1_charm_lines import make_d2kk_line, make_d2pipi_line, make_two_track_mva_charm_xsec_line, make_two_ks_line
 from AllenConf.hlt1_calibration_lines import make_d2kpi_line, make_passthrough_line, make_rich_1_line, make_rich_2_line, make_displaced_dimuon_mass_line, make_di_muon_mass_align_line
 from AllenConf.hlt1_muon_lines import make_single_high_pt_muon_line, make_single_high_pt_muon_no_muid_line, make_low_pt_muon_line, make_di_muon_mass_line, make_di_muon_soft_line, make_low_pt_di_muon_line, make_track_muon_mva_line, make_di_muon_no_ip_line
 from AllenConf.hlt1_electron_lines import make_track_electron_mva_line, make_single_high_pt_electron_line, make_lowmass_noip_dielectron_line, make_displaced_dielectron_line, make_displaced_leptons_line, make_single_high_et_line
@@ -42,7 +42,8 @@ def default_physics_lines(reconstructed_objects, with_calo, with_muon):
             long_tracks, secondary_vertices, name="Hlt1TwoTrackKs"),
         make_d2kk_line(long_tracks, secondary_vertices, name="Hlt1D2KK"),
         make_d2kpi_line(long_tracks, secondary_vertices, name="Hlt1D2KPi"),
-        make_d2pipi_line(long_tracks, secondary_vertices, name="Hlt1D2PiPi")
+        make_d2pipi_line(long_tracks, secondary_vertices, name="Hlt1D2PiPi"),
+        make_two_ks_line(long_tracks, secondary_vertices, name="Hlt1TwoKs")
     ]
 
     if with_muon:
diff --git a/configuration/python/AllenConf/hlt1_charm_lines.py b/configuration/python/AllenConf/hlt1_charm_lines.py
index 7153aa87fcd..4ac6dd507f0 100644
--- a/configuration/python/AllenConf/hlt1_charm_lines.py
+++ b/configuration/python/AllenConf/hlt1_charm_lines.py
@@ -55,9 +55,9 @@ def make_two_ks_line(long_tracks,
         two_ks_line_t,
         name=name,
         host_number_of_events_t=number_of_events["host_number_of_events"],
-        host_number_of_svs_t=secondary_vertices["host_number_of_svs"],
+        host_number_of_svs_t=secondary_vertices["host_number_of_sv_pairs"],
         dev_particle_container_t=secondary_vertices[
-            "dev_multi_event_composites"],
+            "dev_multi_event_sv_combos_view"],
         pre_scaler_hash_string=pre_scaler_hash_string or name + '_pre',
         post_scaler_hash_string=post_scaler_hash_string or name + '_post')
 
diff --git a/configuration/python/AllenConf/secondary_vertex_reconstruction.py b/configuration/python/AllenConf/secondary_vertex_reconstruction.py
index ac8b7546c7e..0058d381c07 100644
--- a/configuration/python/AllenConf/secondary_vertex_reconstruction.py
+++ b/configuration/python/AllenConf/secondary_vertex_reconstruction.py
@@ -4,7 +4,8 @@
 from AllenAlgorithms.algorithms import (
     velo_pv_ip_t, kalman_velo_only_t, make_lepton_id_t,
     make_long_track_particles_t, filter_tracks_t, host_prefix_sum_t,
-    fit_secondary_vertices_t, empty_lepton_id_t)
+    fit_secondary_vertices_t, empty_lepton_id_t, sv_combiner_t, filter_svs_t,
+    calc_max_combos_t)
 from AllenConf.utils import initialize_number_of_events, mep_layout
 from AllenConf.velo_reconstruction import run_velo_kalman_filter
 from AllenCore.generator import make_algorithm
@@ -143,6 +144,50 @@ def fit_secondary_vertices(long_tracks, pvs, kalman_velo_only,
         dev_sv_offsets_t=prefix_sum_secondary_vertices.dev_output_buffer_t,
         dev_sv_poca_t=filter_tracks.dev_sv_poca_t)
 
+    calc_max_combos = make_algorithm(
+        calc_max_combos_t,
+        name="calc_max_combos",
+        host_number_of_events_t=number_of_events["host_number_of_events"],
+        dev_input_agg_t=[
+            fit_secondary_vertices.dev_multi_event_composites_ptr_t
+        ])
+
+    prefix_sum_max_combos = make_algorithm(
+        host_prefix_sum_t,
+        name="prefix_sum_max_combos",
+        dev_input_buffer_t=calc_max_combos.dev_max_combos_t)
+
+    filter_svs = make_algorithm(
+        filter_svs_t,
+        name="filter_svs",
+        host_number_of_events_t=number_of_events["host_number_of_events"],
+        host_max_combos_t=prefix_sum_max_combos.host_total_sum_holder_t,
+        host_number_of_svs_t=prefix_sum_secondary_vertices.
+        host_total_sum_holder_t,
+        dev_number_of_events_t=number_of_events["dev_number_of_events"],
+        dev_max_combo_offsets_t=prefix_sum_max_combos.dev_output_buffer_t,
+        dev_secondary_vertices_t=fit_secondary_vertices.
+        dev_multi_event_composites_view_t)
+
+    prefix_sum_sv_combos = make_algorithm(
+        host_prefix_sum_t,
+        name="prefix_sum_sv_combos",
+        dev_input_buffer_t=filter_svs.dev_combo_number_t,
+    )
+
+    combine_svs = make_algorithm(
+        sv_combiner_t,
+        name="svs_pair_candidate",
+        host_number_of_events_t=number_of_events["host_number_of_events"],
+        host_number_of_combos_t=prefix_sum_sv_combos.host_total_sum_holder_t,
+        dev_number_of_events_t=number_of_events["dev_number_of_events"],
+        dev_combo_offsets_t=prefix_sum_sv_combos.dev_output_buffer_t,
+        dev_max_combo_offsets_t=prefix_sum_max_combos.dev_output_buffer_t,
+        dev_secondary_vertices_t=fit_secondary_vertices.
+        dev_multi_event_composites_view_t,
+        dev_child1_idx_t=filter_svs.dev_child1_idx_t,
+        dev_child2_idx_t=filter_svs.dev_child2_idx_t)
+
     return {
         "dev_consolidated_svs":
         fit_secondary_vertices.dev_consolidated_svs_t,
@@ -150,6 +195,8 @@ def fit_secondary_vertices(long_tracks, pvs, kalman_velo_only,
         kalman_velo_only["dev_kf_tracks"],
         "host_number_of_svs":
         prefix_sum_secondary_vertices.host_total_sum_holder_t,
+        "host_number_of_sv_pairs":
+        prefix_sum_sv_combos.host_total_sum_holder_t,
         "dev_sv_offsets":
         prefix_sum_secondary_vertices.dev_output_buffer_t,
         "dev_svs_trk1_idx":
@@ -161,5 +208,7 @@ def fit_secondary_vertices(long_tracks, pvs, kalman_velo_only,
         "dev_multi_event_composites":
         fit_secondary_vertices.dev_multi_event_composites_view_t,
         "dev_multi_event_composites_ptr":
-        fit_secondary_vertices.dev_multi_event_composites_ptr_t
+        fit_secondary_vertices.dev_multi_event_composites_ptr_t,
+        "dev_multi_event_sv_combos_view":
+        combine_svs.dev_multi_event_combos_view_t
     }
diff --git a/device/CMakeLists.txt b/device/CMakeLists.txt
index 28ce1bbc5f1..731f404c4da 100644
--- a/device/CMakeLists.txt
+++ b/device/CMakeLists.txt
@@ -19,4 +19,4 @@ add_subdirectory(selections)
 add_subdirectory(event_model)
 add_subdirectory(validators)
 add_subdirectory(lumi)
-add_subdirectory(svs_pair_candidates)
+add_subdirectory(combiners)
diff --git a/device/combiners/CMakeLists.txt b/device/combiners/CMakeLists.txt
new file mode 100644
index 00000000000..63c4e1ffcfd
--- /dev/null
+++ b/device/combiners/CMakeLists.txt
@@ -0,0 +1,13 @@
+###############################################################################
+# (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration      #
+###############################################################################
+file(GLOB combiners_src "src/*cu")
+
+allen_add_device_library(Combiners STATIC
+  ${combiners_src}
+)
+
+target_link_libraries(Combiners PUBLIC VertexFitter PRIVATE Backend HostEventModel EventModel Utils)
+
+target_include_directories(Combiners PUBLIC
+  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
\ No newline at end of file
diff --git a/device/combiners/include/CalcMaxCombos.cuh b/device/combiners/include/CalcMaxCombos.cuh
new file mode 100644
index 00000000000..b083b59cdd3
--- /dev/null
+++ b/device/combiners/include/CalcMaxCombos.cuh
@@ -0,0 +1,46 @@
+/*****************************************************************************\
+* (c) Copyright 2022 CERN for the benefit of the LHCb Collaboration           *
+*                                                                             *
+* This software is distributed under the terms of the Apache License          *
+* version 2 (Apache-2.0), copied verbatim in the file "COPYING".              *
+*                                                                             *
+* In applying this licence, CERN does not waive the privileges and immunities *
+* granted to it by virtue of its status as an Intergovernmental Organization  *
+* or submit itself to any jurisdiction.                                       *
+\*****************************************************************************/
+#pragma once
+
+#include "AlgorithmTypes.cuh"
+#include "ParticleTypes.cuh"
+
+namespace CalcMaxCombos {
+
+  struct Parameters {
+    HOST_INPUT(host_number_of_events_t, unsigned) host_number_of_events;
+    MASK_INPUT(dev_event_list_t) dev_event_list;
+    DEVICE_INPUT_AGGREGATE(dev_input_agg_t, Allen::IMultiEventContainer*) dev_input_agg;
+    DEVICE_OUTPUT(dev_input_containers_t, Allen::IMultiEventContainer*) dev_input_containers;
+    DEVICE_OUTPUT(dev_max_combos_t, unsigned) dev_max_combos;
+    PROPERTY(block_dim_t, "block_dim", "Block dimensions", DeviceDimensions) block_dim;
+  };
+
+  __global__ void calc_max_combos(Parameters parameters, const unsigned number_of_input_containers);
+
+  struct calc_max_combos_t : public DeviceAlgorithm, Parameters {
+    void set_arguments_size(
+      ArgumentReferences<Parameters> arguments,
+      const RuntimeOptions&,
+      const Constants&,
+      const HostBuffers&) const;
+
+    void operator()(
+      const ArgumentReferences<Parameters>& arguments,
+      const RuntimeOptions&,
+      const Constants&,
+      HostBuffers&,
+      const Allen::Context& context) const;
+
+  private:
+    Property<block_dim_t> m_block_dim {this, {{1, 1, 1}}};
+  };
+} // namespace CalcMaxCombos
diff --git a/device/combiners/include/FilterSvs.cuh b/device/combiners/include/FilterSvs.cuh
new file mode 100644
index 00000000000..59831458d9c
--- /dev/null
+++ b/device/combiners/include/FilterSvs.cuh
@@ -0,0 +1,69 @@
+/*****************************************************************************\
+* (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration      *
+\*****************************************************************************/
+#pragma once
+
+#include "VertexDefinitions.cuh"
+
+#include "States.cuh"
+#include "AlgorithmTypes.cuh"
+#include "ParticleTypes.cuh"
+
+namespace FilterSvs {
+
+  struct Parameters {
+    HOST_INPUT(host_number_of_events_t, unsigned) host_number_of_events;
+    HOST_INPUT(host_number_of_svs_t, unsigned) host_number_of_svs;
+    HOST_INPUT(host_max_combos_t, unsigned) host_max_combos;
+    MASK_INPUT(dev_event_list_t) dev_event_list;
+    DEVICE_INPUT(dev_number_of_events_t, unsigned) dev_number_of_events;
+    DEVICE_INPUT(dev_secondary_vertices_t, Allen::Views::Physics::MultiEventCompositeParticles) dev_secondary_vertices;
+    DEVICE_INPUT(dev_max_combo_offsets_t, unsigned) dev_max_combo_offsets;
+    DEVICE_OUTPUT(dev_sv_filter_decision_t, bool) dev_sv_filter_decision;
+    DEVICE_OUTPUT(dev_combo_number_t, unsigned) dev_combo_number;
+    DEVICE_OUTPUT(dev_child1_idx_t, unsigned) dev_child1_idx;
+    DEVICE_OUTPUT(dev_child2_idx_t, unsigned) dev_child2_idx;
+
+    // Set all properties to filter svs
+    PROPERTY(maxVertexChi2_t, "maxVertexChi2", "Max child vertex chi2", float) maxVertexChi2;
+    PROPERTY(minComboPt_t, "minComboPt", "Minimum combo pT", float) minComboPt;
+    PROPERTY(minCosDira_t, "minChildCosDira", "Minimum child DIRA", float) minCosDira;
+    PROPERTY(minChildEta_t, "minChildEta", "Minimum child eta", float) minChildEta;
+    PROPERTY(maxChildEta_t, "maxChildEta", "Maximum child eta", float) maxChildEta;
+    PROPERTY(minTrackPt_t, "minTrackPt", "Minimum track pT", float) minTrackPt;
+    PROPERTY(minTrackP_t, "minTrackP", "Minimum track p", float) minTrackP;
+    PROPERTY(minTrackIPChi2_t, "minTrackIPChi2", "Minimum track IP chi2", float) minTrackIPChi2;
+    PROPERTY(block_dim_filter_t, "block_dim_filter", "block dimensions for filter step", DeviceDimensions)
+    block_dim_filter;
+  };
+
+  __global__ void filter_svs(Parameters);
+
+  struct filter_svs_t : public DeviceAlgorithm, Parameters {
+    void set_arguments_size(
+      ArgumentReferences<Parameters> arguments,
+      const RuntimeOptions&,
+      const Constants&,
+      const HostBuffers&) const;
+
+    void operator()(
+      const ArgumentReferences<Parameters>& arguments,
+      const RuntimeOptions&,
+      const Constants&,
+      HostBuffers&,
+      const Allen::Context& context) const;
+
+  private:
+    Property<maxVertexChi2_t> m_maxVertexChi2 {this, 30.f};
+    Property<minComboPt_t> m_minComboPt {this, 500.f / Gaudi::Units::MeV};
+    // Momenta of SVs from displaced decays won't point back to a PV, so don't
+    // make a DIRA cut here by default.
+    Property<minCosDira_t> m_minCosDira {this, 0.0f};
+    Property<minChildEta_t> m_minChildEta {this, 2.f};
+    Property<maxChildEta_t> m_maxChildEta {this, 5.f};
+    Property<minTrackPt_t> m_minTrackPt {this, 300.f / Gaudi::Units::MeV};
+    Property<minTrackP_t> m_minTrackP {this, 1000.f / Gaudi::Units::MeV};
+    Property<minTrackIPChi2_t> m_minTrackIPChi2 {this, 4.f};
+    Property<block_dim_filter_t> m_block_dim_filter {this, {{128, 1, 1}}};
+  };
+} // namespace FilterSvs
diff --git a/device/combiners/include/SVCombiner.cuh b/device/combiners/include/SVCombiner.cuh
new file mode 100644
index 00000000000..e4150218d8c
--- /dev/null
+++ b/device/combiners/include/SVCombiner.cuh
@@ -0,0 +1,74 @@
+/*****************************************************************************\
+* (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration      *
+\*****************************************************************************/
+#pragma once
+
+#include "VertexDefinitions.cuh"
+#include "States.cuh"
+#include "AlgorithmTypes.cuh"
+#include "ParticleTypes.cuh"
+
+namespace SVCombiner {
+  struct Parameters {
+    HOST_INPUT(host_number_of_events_t, unsigned) host_number_of_events;
+    HOST_INPUT(host_number_of_combos_t, unsigned) host_number_of_combos;
+    MASK_INPUT(dev_event_list_t) dev_event_list;
+    DEVICE_INPUT(dev_number_of_events_t, unsigned) dev_number_of_events;
+    DEVICE_INPUT(dev_max_combo_offsets_t, unsigned) dev_max_combo_offsets;
+    DEVICE_INPUT(dev_combo_offsets_t, unsigned) dev_combo_offsets;
+    DEVICE_INPUT(dev_secondary_vertices_t, Allen::Views::Physics::MultiEventCompositeParticles) dev_secondary_vertices;
+    DEVICE_INPUT(dev_child1_idx_t, unsigned) dev_child1_idx;
+    DEVICE_INPUT(dev_child2_idx_t, unsigned) dev_child2_idx;
+
+    DEVICE_OUTPUT_WITH_DEPENDENCIES(
+      dev_child_pointers_t,
+      DEPENDENCIES(dev_secondary_vertices_t),
+      std::array<const Allen::Views::Physics::IParticle*, 4>)
+    dev_child_pointers;
+
+    DEVICE_OUTPUT_WITH_DEPENDENCIES(
+      dev_combo_view_t,
+      DEPENDENCIES(dev_child_pointers_t),
+      Allen::Views::Physics::CompositeParticle)
+    dev_combo_view;
+    DEVICE_OUTPUT_WITH_DEPENDENCIES(
+      dev_combos_view_t,
+      DEPENDENCIES(dev_combo_view_t),
+      Allen::Views::Physics::CompositeParticles)
+    dev_combos_view;
+    DEVICE_OUTPUT_WITH_DEPENDENCIES(
+      dev_multi_event_combos_view_t,
+      DEPENDENCIES(dev_combos_view_t),
+      Allen::Views::Physics::MultiEventCompositeParticles)
+    dev_multi_event_combos_view;
+    DEVICE_OUTPUT_WITH_DEPENDENCIES(
+      dev_multi_event_combos_ptr_t,
+      DEPENDENCIES(dev_multi_event_combos_view_t),
+      Allen::Views::Physics::MultiEventCompositeParticles*)
+    dev_multi_event_combos_ptr;
+
+    // Set all properties to filter svs
+    PROPERTY(block_dim_filter_t, "block_dim_filter", "block dimensions for filter step", DeviceDimensions)
+    block_dim_filter;
+  };
+
+  __global__ void combine_svs(Parameters);
+
+  struct sv_combiner_t : public DeviceAlgorithm, Parameters {
+    void set_arguments_size(
+      ArgumentReferences<Parameters> arguments,
+      const RuntimeOptions&,
+      const Constants&,
+      const HostBuffers&) const;
+
+    void operator()(
+      const ArgumentReferences<Parameters>& arguments,
+      const RuntimeOptions&,
+      const Constants&,
+      HostBuffers&,
+      const Allen::Context& context) const;
+
+  private:
+    Property<block_dim_filter_t> m_block_dim_filter {this, {{16, 16, 1}}};
+  };
+} // namespace SVCombiner
diff --git a/device/combiners/src/CalcMaxCombos.cu b/device/combiners/src/CalcMaxCombos.cu
new file mode 100644
index 00000000000..3be1be13910
--- /dev/null
+++ b/device/combiners/src/CalcMaxCombos.cu
@@ -0,0 +1,83 @@
+/*****************************************************************************\
+* (c) Copyright 2022 CERN for the benefit of the LHCb Collaboration           *
+*                                                                             *
+* This software is distributed under the terms of the Apache License          *
+* version 2 (Apache-2.0), copied verbatim in the file "COPYING".              *
+*                                                                             *
+* In applying this licence, CERN does not waive the privileges and immunities *
+* granted to it by virtue of its status as an Intergovernmental Organization  *
+* or submit itself to any jurisdiction.                                       *
+\*****************************************************************************/
+#include "CalcMaxCombos.cuh"
+
+INSTANTIATE_ALGORITHM(CalcMaxCombos::calc_max_combos_t)
+
+void CalcMaxCombos::calc_max_combos_t::set_arguments_size(
+  ArgumentReferences<Parameters> arguments,
+  const RuntimeOptions&,
+  const Constants&,
+  const HostBuffers&) const
+{
+  const auto dev_input_agg = input_aggregate<dev_input_agg_t>(arguments);
+  set_size<dev_max_combos_t>(arguments, first<host_number_of_events_t>(arguments));
+  set_size<dev_input_containers_t>(arguments, dev_input_agg.size_of_aggregate());
+}
+
+void CalcMaxCombos::calc_max_combos_t::operator()(
+  const ArgumentReferences<Parameters>& arguments,
+  const RuntimeOptions&,
+  const Constants&,
+  HostBuffers&,
+  const Allen::Context& context) const
+{
+  const auto dev_input_agg = input_aggregate<dev_input_agg_t>(arguments);
+  Allen::memset_async<dev_max_combos_t>(arguments, 0, context);
+  Allen::aggregate::store_contiguous_async<dev_input_containers_t, dev_input_agg_t>(arguments, context);
+  global_function(calc_max_combos)(dim3(size<dev_event_list_t>(arguments)), property<block_dim_t>(), context)(
+    arguments, dev_input_agg.size_of_aggregate());
+}
+
+__global__ void CalcMaxCombos::calc_max_combos(
+  CalcMaxCombos::Parameters parameters,
+  const unsigned number_of_input_containers)
+{
+  const unsigned event_number = parameters.dev_event_list[blockIdx.x];
+
+  const auto mec1 = parameters.dev_input_containers[0];
+  unsigned n_input1 = 0;
+  const auto basic_mec1 = Allen::dyn_cast<const Allen::Views::Physics::MultiEventBasicParticles*>(mec1);
+  if (basic_mec1) {
+    const auto particles = basic_mec1->container(event_number);
+    n_input1 = particles.size();
+  }
+  else {
+    const auto comp_mec1 = Allen::dyn_cast<const Allen::Views::Physics::MultiEventCompositeParticles*>(mec1);
+    if (comp_mec1) {
+      const auto particles = comp_mec1->container(event_number);
+      n_input1 = particles.size();
+    }
+  }
+
+  if (number_of_input_containers == 1) {
+    parameters.dev_max_combos[event_number] = n_input1 * (n_input1 - 1) / 2;
+    return;
+  }
+
+  const auto mec2 = parameters.dev_input_containers[1];
+  unsigned n_input2 = 0;
+  const auto basic_mec2 = Allen::dyn_cast<const Allen::Views::Physics::MultiEventBasicParticles*>(mec2);
+  if (basic_mec2) {
+    const auto particles = basic_mec2->container(event_number);
+    n_input2 = particles.size();
+  }
+  else {
+    const auto comp_mec2 = Allen::dyn_cast<const Allen::Views::Physics::MultiEventCompositeParticles*>(mec2);
+    if (comp_mec2) {
+      const auto particles = comp_mec2->container(event_number);
+      n_input2 = particles.size();
+    }
+  }
+
+  parameters.dev_max_combos[event_number] = n_input1 * n_input2;
+  return;
+}
\ No newline at end of file
diff --git a/device/combiners/src/FilterSvs.cu b/device/combiners/src/FilterSvs.cu
new file mode 100644
index 00000000000..b05522e5f4f
--- /dev/null
+++ b/device/combiners/src/FilterSvs.cu
@@ -0,0 +1,96 @@
+/*****************************************************************************\
+* (c) Copyright 2022 CERN for the benefit of the LHCb Collaboration           *
+*                                                                             *
+* This software is distributed under the terms of the Apache License          *
+* version 2 (Apache-2.0), copied verbatim in the file "COPYING".              *
+*                                                                             *
+* In applying this licence, CERN does not waive the privileges and immunities *
+* granted to it by virtue of its status as an Intergovernmental Organization  *
+* or submit itself to any jurisdiction.                                       *
+\*****************************************************************************/
+#include "FilterSvs.cuh"
+
+INSTANTIATE_ALGORITHM(FilterSvs::filter_svs_t)
+
+void FilterSvs::filter_svs_t::set_arguments_size(
+  ArgumentReferences<Parameters> arguments,
+  const RuntimeOptions&,
+  const Constants&,
+  const HostBuffers&) const
+{
+  set_size<dev_sv_filter_decision_t>(arguments, first<host_number_of_svs_t>(arguments));
+  set_size<dev_combo_number_t>(arguments, first<host_number_of_events_t>(arguments));
+  set_size<dev_child1_idx_t>(arguments, first<host_max_combos_t>(arguments));
+  set_size<dev_child2_idx_t>(arguments, first<host_max_combos_t>(arguments));
+}
+
+void FilterSvs::filter_svs_t::operator()(
+  const ArgumentReferences<Parameters>& arguments,
+  const RuntimeOptions&,
+  const Constants&,
+  HostBuffers&,
+  const Allen::Context& context) const
+{
+  Allen::memset_async<dev_combo_number_t>(arguments, 0, context);
+
+  global_function(filter_svs)(dim3(size<dev_event_list_t>(arguments)), property<block_dim_filter_t>(), context)(
+    arguments);
+}
+
+__global__ void FilterSvs::filter_svs(FilterSvs::Parameters parameters)
+{
+  const unsigned event_number = parameters.dev_event_list[blockIdx.x];
+
+  const unsigned idx_offset = parameters.dev_max_combo_offsets[event_number];
+  unsigned* event_combo_number = parameters.dev_combo_number + event_number;
+  unsigned* event_child1_idx = parameters.dev_child1_idx + idx_offset;
+  unsigned* event_child2_idx = parameters.dev_child2_idx + idx_offset;
+
+  // Get SVs array
+  const auto svs = parameters.dev_secondary_vertices->container(event_number);
+  const unsigned n_svs = svs.size();
+  bool* event_sv_filter_decision = parameters.dev_sv_filter_decision + svs.offset();
+
+  // Prefilter all SVs.
+  for (unsigned i_sv = threadIdx.x; i_sv < n_svs; i_sv += blockDim.x) {
+    bool dec = true;
+
+    const auto vertex = svs.particle(i_sv);
+
+    // Set decision
+    dec = vertex.vertex().chi2() > 0 && vertex.vertex().chi2() < parameters.maxVertexChi2;
+    // Kinematic cuts.
+    dec &= vertex.minpt() > parameters.minTrackPt;
+    dec &= vertex.minp() > parameters.minTrackP;
+    dec &= vertex.vertex().pt() > parameters.minComboPt;
+    dec &= vertex.eta() > parameters.minChildEta;
+    dec &= vertex.eta() < parameters.maxChildEta;
+    dec &= vertex.minipchi2() > parameters.minTrackIPChi2;
+    dec &= vertex.dira() > parameters.minCosDira;
+    event_sv_filter_decision[i_sv] = dec;
+  }
+
+  __syncthreads();
+
+  for (unsigned i_sv = threadIdx.x; i_sv < n_svs; i_sv += blockDim.x) {
+    // TODO: Don't worry about 2D blocks for now.
+    bool dec1 = event_sv_filter_decision[i_sv];
+    for (unsigned j_sv = i_sv + 1; j_sv < n_svs; j_sv += 1) {
+      bool dec2 = event_sv_filter_decision[j_sv];
+      if (dec1 && dec2) {
+        const auto vertex1 = svs.particle(i_sv);
+        const auto vertex2 = svs.particle(j_sv);
+
+        if (
+          vertex1.child(0) == vertex2.child(0) || vertex1.child(1) == vertex2.child(0) ||
+          vertex1.child(0) == vertex2.child(1) || vertex1.child(1) == vertex2.child(1))
+          continue;
+
+        // Add identified couple of SVs to the array
+        unsigned combo_idx = atomicAdd(event_combo_number, 1);
+        event_child1_idx[combo_idx] = i_sv;
+        event_child2_idx[combo_idx] = j_sv;
+      }
+    }
+  }
+}
diff --git a/device/combiners/src/SVCombiner.cu b/device/combiners/src/SVCombiner.cu
new file mode 100644
index 00000000000..ad8e7613c73
--- /dev/null
+++ b/device/combiners/src/SVCombiner.cu
@@ -0,0 +1,83 @@
+/*****************************************************************************\
+* (c) Copyright 2022 CERN for the benefit of the LHCb Collaboration           *
+*                                                                             *
+* This software is distributed under the terms of the Apache License          *
+* version 2 (Apache-2.0), copied verbatim in the file "COPYING".              *
+*                                                                             *
+* In applying this licence, CERN does not waive the privileges and immunities *
+* granted to it by virtue of its status as an Intergovernmental Organization  *
+* or submit itself to any jurisdiction.                                       *
+\*****************************************************************************/
+#include "SVCombiner.cuh"
+
+INSTANTIATE_ALGORITHM(SVCombiner::sv_combiner_t)
+
+__global__ void create_combo_views(SVCombiner::Parameters parameters)
+{
+  const unsigned event_number = blockIdx.x;
+  const unsigned number_of_events = parameters.dev_number_of_events[0];
+  const unsigned combo_offset = parameters.dev_combo_offsets[event_number];
+  const unsigned n_combos = parameters.dev_combo_offsets[event_number + 1] - combo_offset;
+
+  for (unsigned i = threadIdx.x; i < n_combos; i += blockDim.x) {
+    new (parameters.dev_combo_view + combo_offset + i) Allen::Views::Physics::CompositeParticle {
+      parameters.dev_child_pointers[combo_offset + i], nullptr, nullptr, 2, i};
+  }
+
+  if (threadIdx.x == 0) {
+    new (parameters.dev_combos_view + event_number)
+      Allen::Views::Physics::CompositeParticles {parameters.dev_combo_view, parameters.dev_combo_offsets, event_number};
+  }
+
+  if (blockIdx.x == 0 && threadIdx.x == 0) {
+    new (parameters.dev_multi_event_combos_view)
+      Allen::Views::Physics::MultiEventCompositeParticles {parameters.dev_combos_view, number_of_events};
+    parameters.dev_multi_event_combos_ptr[0] = parameters.dev_multi_event_combos_view;
+  }
+}
+
+void SVCombiner::sv_combiner_t::set_arguments_size(
+  ArgumentReferences<Parameters> arguments,
+  const RuntimeOptions&,
+  const Constants&,
+  const HostBuffers&) const
+{
+  set_size<dev_child_pointers_t>(arguments, first<host_number_of_combos_t>(arguments));
+  set_size<dev_combo_view_t>(arguments, first<host_number_of_combos_t>(arguments));
+  set_size<dev_combos_view_t>(arguments, first<host_number_of_events_t>(arguments));
+  set_size<dev_multi_event_combos_view_t>(arguments, 1);
+  set_size<dev_multi_event_combos_ptr_t>(arguments, 1);
+}
+
+void SVCombiner::sv_combiner_t::operator()(
+  const ArgumentReferences<Parameters>& arguments,
+  const RuntimeOptions&,
+  const Constants&,
+  HostBuffers&,
+  const Allen::Context& context) const
+{
+  global_function(combine_svs)(dim3(size<dev_event_list_t>(arguments)), property<block_dim_filter_t>(), context)(
+    arguments);
+
+  global_function(create_combo_views)(
+    dim3(first<host_number_of_events_t>(arguments)), property<block_dim_filter_t>(), context)(arguments);
+}
+
+__global__ void SVCombiner::combine_svs(SVCombiner::Parameters parameters)
+{
+  const unsigned event_number = parameters.dev_event_list[blockIdx.x];
+  const unsigned combo_offset = parameters.dev_combo_offsets[event_number];
+  const unsigned n_combos = parameters.dev_combo_offsets[event_number + 1] - combo_offset;
+  const unsigned idx_offset = parameters.dev_max_combo_offsets[event_number];
+  const unsigned* event_child1_idx = parameters.dev_child1_idx + idx_offset;
+  const unsigned* event_child2_idx = parameters.dev_child2_idx + idx_offset;
+
+  // Secondary Vertices
+  const auto svs = parameters.dev_secondary_vertices->container(event_number);
+  for (unsigned i_combo = threadIdx.x; i_combo < n_combos; i_combo += blockDim.x) {
+    const auto child1 = svs.particle_pointer(event_child1_idx[i_combo]);
+    const auto child2 = svs.particle_pointer(event_child2_idx[i_combo]);
+
+    parameters.dev_child_pointers[combo_offset + i_combo] = {child1, child2, nullptr, nullptr};
+  }
+}
diff --git a/device/event_model/common/include/ParticleTypes.cuh b/device/event_model/common/include/ParticleTypes.cuh
index f61380d00d7..f3b4aeceba5 100644
--- a/device/event_model/common/include/ParticleTypes.cuh
+++ b/device/event_model/common/include/ParticleTypes.cuh
@@ -736,6 +736,11 @@ namespace Allen {
           return m_particle[particle_index];
         }
 
+        __host__ __device__ const CompositeParticle* particle_pointer(const unsigned particle_index) const
+        {
+          return static_cast<const CompositeParticle*>(m_particle) + particle_index;
+        }
+
         __host__ __device__ unsigned offset() const { return m_offset; }
       };
 
diff --git a/device/selections/lines/charm/include/TwoKsLine.cuh b/device/selections/lines/charm/include/TwoKsLine.cuh
index 548f042ac5c..9fb2eea51c0 100644
--- a/device/selections/lines/charm/include/TwoKsLine.cuh
+++ b/device/selections/lines/charm/include/TwoKsLine.cuh
@@ -49,12 +49,9 @@ namespace two_ks_line {
   };
 
   struct two_ks_line_t : public SelectionAlgorithm, Parameters, TwoTrackLine<two_ks_line_t, Parameters> {
-    __device__ static std::tuple<const Allen::Views::Physics::CompositeParticle, const unsigned, const unsigned>
-    get_input(const Parameters& parameters, const unsigned event_number, const unsigned i);
-
     __device__ static bool select(
       const Parameters& parameters,
-      std::tuple<const Allen::Views::Physics::CompositeParticle, const unsigned, const unsigned> input);
+      std::tuple<const Allen::Views::Physics::CompositeParticle> input);
 
   private:
     Property<pre_scaler_t> m_pre_scaler {this, 1.f};
diff --git a/device/selections/lines/charm/src/TwoKsLine.cu b/device/selections/lines/charm/src/TwoKsLine.cu
index 611538a09e6..f83598faa73 100644
--- a/device/selections/lines/charm/src/TwoKsLine.cu
+++ b/device/selections/lines/charm/src/TwoKsLine.cu
@@ -12,48 +12,35 @@
 
 INSTANTIATE_LINE(two_ks_line::two_ks_line_t, two_ks_line::Parameters)
 
-__device__ std::tuple<const Allen::Views::Physics::CompositeParticle, const unsigned, const unsigned>
-two_ks_line::two_ks_line_t::get_input(const Parameters& parameters, const unsigned event_number, const unsigned i)
-{
-  const auto particles = static_cast<const Allen::Views::Physics::CompositeParticles&>(
-    parameters.dev_particle_container[0].container(event_number));
-  const auto particle = particles.particle(i);
-  return std::forward_as_tuple(particle, event_number, i);
-}
-
 __device__ bool two_ks_line::two_ks_line_t::select(
   const Parameters& parameters,
-  std::tuple<const Allen::Views::Physics::CompositeParticle, const unsigned, const unsigned> input)
+  std::tuple<const Allen::Views::Physics::CompositeParticle> input)
 {
   // Unpack the tuple.
-  const auto vertex1 = std::get<0>(input);
-  const auto& event_number = std::get<1>(input);
-  const auto& vertex1_id = std::get<2>(input);
-
-  const auto particles = static_cast<const Allen::Views::Physics::CompositeParticles&>(
-    parameters.dev_particle_container[0].container(event_number));
-  unsigned n_svs = particles.size();
+  const auto ks_pair = std::get<0>(input);
+  const auto ks1 = static_cast<const Allen::Views::Physics::CompositeParticle*>(ks_pair.child(0));
+  const auto ks2 = static_cast<const Allen::Views::Physics::CompositeParticle*>(ks_pair.child(1));
 
   // Get the first vertex decision.
   // Vertex quality cuts.
-  bool dec1 = vertex1.vertex().chi2() > 0 && vertex1.vertex().chi2() < parameters.maxVertexChi2;
-  dec1 &= vertex1.vertex().z() >= parameters.minZ;
+  bool dec1 = ks1->vertex().chi2() > 0 && ks1->vertex().chi2() < parameters.maxVertexChi2;
   if (!dec1) return false;
   // Kinematic cuts.
-  dec1 &= vertex1.minpt() > parameters.minTrackPt_piKs;
-  dec1 &= vertex1.minp() > parameters.minTrackP_piKs;
-  dec1 &= vertex1.mdipi() > parameters.minM_Ks;
-  dec1 &= vertex1.mdipi() < parameters.maxM_Ks;
+  dec1 &= ks1->minpt() > parameters.minTrackPt_piKs;
+  dec1 &= ks1->minp() > parameters.minTrackP_piKs;
+  dec1 &= ks1->mdipi() > parameters.minM_Ks;
+  dec1 &= ks1->mdipi() < parameters.maxM_Ks;
+  dec1 &= ks1->vertex().pt() > parameters.minComboPt_Ks;
   if (!dec1) return false;
   // PV cuts.
-  dec1 &= vertex1.eta() > parameters.minEta_Ks;
-  dec1 &= vertex1.eta() < parameters.maxEta_Ks;
-  dec1 &= vertex1.minipchi2() > parameters.minTrackIPChi2_Ks;
-  dec1 &= vertex1.dira() > parameters.minCosDira;
+  dec1 &= ks1->eta() > parameters.minEta_Ks;
+  dec1 &= ks1->eta() < parameters.maxEta_Ks;
+  dec1 &= ks1->minipchi2() > parameters.minTrackIPChi2_Ks;
+  dec1 &= ks1->dira() > parameters.minCosDira;
   if (!dec1) return false;
   // Cuts that need constituent tracks.
-  const auto v1track1 = static_cast<const Allen::Views::Physics::BasicParticle*>(vertex1.child(0));
-  const auto v1track2 = static_cast<const Allen::Views::Physics::BasicParticle*>(vertex1.child(1));
+  const auto v1track1 = static_cast<const Allen::Views::Physics::BasicParticle*>(ks1->child(0));
+  const auto v1track2 = static_cast<const Allen::Views::Physics::BasicParticle*>(ks1->child(1));
   const auto v1state1 = v1track1->state();
   const auto v1state2 = v1track2->state();
   const float cos1 = (v1state1.px() * v1state2.px() + v1state1.py() * v1state2.py() + v1state1.pz() * v1state2.pz()) /
@@ -61,61 +48,39 @@ __device__ bool two_ks_line::two_ks_line_t::select(
   dec1 &= cos1 > parameters.minCosOpening;
   const float v1ip1 = v1track1->ip();
   const float v1ip2 = v1track2->ip();
-  const float v1ip = vertex1.ip();
+  const float v1ip = ks1->ip();
   dec1 &= v1ip1 * v1ip2 / v1ip > parameters.min_combip;
   if (!dec1) return false;
 
-  for (unsigned i = vertex1_id + 1; i < n_svs; i++) {
-    const auto vertex2 = particles.particle(i);
-
-    // Return false if the vertices have a common track.
-    // Make this selection first as it is will initially reject the
-    // largest amount of combinations.
-    if (
-      vertex1.child(0) == vertex2.child(0) || vertex1.child(0) == vertex2.child(1) ||
-      vertex1.child(1) == vertex2.child(0) || vertex1.child(1) == vertex2.child(1)) {
-      continue;
-    }
-
-    if (vertex2.vertex().chi2() < 0) {
-      continue;
-    }
-
-    // Get the first vertex decision.
-    // Vertex quality cuts.
-    bool dec2 = vertex2.vertex().chi2() > 0 && vertex2.vertex().chi2() < parameters.maxVertexChi2;
-    dec2 &= vertex2.vertex().z() >= parameters.minZ;
-    if (!dec2) continue;
-    // Kinematic cuts.
-    dec2 &= vertex2.minpt() > parameters.minTrackPt_piKs;
-    dec2 &= vertex2.minp() > parameters.minTrackP_piKs;
-    dec2 &= vertex2.mdipi() > parameters.minM_Ks;
-    dec2 &= vertex2.mdipi() < parameters.maxM_Ks;
-    if (!dec2) continue;
-    // PV cuts.
-    dec2 &= vertex2.eta() > parameters.minEta_Ks;
-    dec2 &= vertex2.eta() < parameters.maxEta_Ks;
-    dec2 &= vertex2.minipchi2() > parameters.minTrackIPChi2_Ks;
-    dec2 &= vertex2.dira() > parameters.minCosDira;
-    if (!dec2) continue;
-    // Cuts that need constituent tracks.
-    const auto v2track1 = static_cast<const Allen::Views::Physics::BasicParticle*>(vertex2.child(0));
-    const auto v2track2 = static_cast<const Allen::Views::Physics::BasicParticle*>(vertex2.child(1));
-    const auto v2state1 = v2track1->state();
-    const auto v2state2 = v2track2->state();
-    const float cos2 = (v2state1.px() * v2state2.px() + v2state1.py() * v2state2.py() + v2state1.pz() * v2state2.pz()) /
-                       (v2state1.p() * v2state2.p());
-
-    dec2 &= cos2 > parameters.minCosOpening;
-    const float v2ip1 = v2track1->ip();
-    const float v2ip2 = v2track2->ip();
-    const float v2ip = vertex2.ip();
-    dec2 &= v2ip1 * v2ip2 / v2ip > parameters.min_combip;
-
-    if (dec1 && dec2) {
-      return true;
-    }
-  }
+  // Get the second vertex decision.
+  // Vertex quality cuts.
+  bool dec2 = ks2->vertex().chi2() > 0 && ks2->vertex().chi2() < parameters.maxVertexChi2;
+  if (!dec2) return false;
+  // Kinematic cuts.
+  dec2 &= ks2->minpt() > parameters.minTrackPt_piKs;
+  dec2 &= ks2->minp() > parameters.minTrackP_piKs;
+  dec2 &= ks2->mdipi() > parameters.minM_Ks;
+  dec2 &= ks2->mdipi() < parameters.maxM_Ks;
+  dec2 &= ks2->vertex().pt() > parameters.minComboPt_Ks;
+  if (!dec2) return false;
+  // PV cuts.
+  dec2 &= ks2->eta() > parameters.minEta_Ks;
+  dec2 &= ks2->eta() < parameters.maxEta_Ks;
+  dec2 &= ks2->minipchi2() > parameters.minTrackIPChi2_Ks;
+  dec2 &= ks2->dira() > parameters.minCosDira;
+  if (!dec2) return false;
+  // Cuts that need constituent tracks.
+  const auto v2track1 = static_cast<const Allen::Views::Physics::BasicParticle*>(ks2->child(0));
+  const auto v2track2 = static_cast<const Allen::Views::Physics::BasicParticle*>(ks2->child(1));
+  const auto v2state1 = v2track1->state();
+  const auto v2state2 = v2track2->state();
+  const float cos2 = (v2state1.px() * v2state2.px() + v2state1.py() * v2state2.py() + v2state1.pz() * v2state2.pz()) /
+                     (v2state1.p() * v2state2.p());
+  dec2 &= cos2 > parameters.minCosOpening;
+  const float v2ip1 = v2track1->ip();
+  const float v2ip2 = v2track2->ip();
+  const float v2ip = ks2->ip();
+  dec2 &= v2ip1 * v2ip2 / v2ip > parameters.min_combip;
 
-  return false;
+  return dec1 && dec2;
 }
diff --git a/device/svs_pair_candidates/CMakeLists.txt b/device/svs_pair_candidates/CMakeLists.txt
deleted file mode 100644
index 4f9f5ede152..00000000000
--- a/device/svs_pair_candidates/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration      #
-###############################################################################
-file(GLOB svs_pair_candidate_src "src/*cu")
-
-allen_add_device_library(Svs_pair_cand STATIC
-  ${svs_pair_candidate_src}
-)
-
-target_link_libraries(Svs_pair_cand PUBLIC Kalman PRIVATE Backend HostEventModel EventModel Utils)
-
-target_include_directories(VertexFitter PUBLIC
-  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
-
-
-if (USE_KALMAN_DOUBLE_PRECISION)
-  add_compile_definitions(KALMAN_DOUBLE_PRECISION)
-endif()
-
-
-
-
-
-
-
-
-
-
-
-#file(GLOB svs_pair_candidates_sources "src/*cu")
-
-#include_directories(include)
-#include_directories(${PROJECT_SOURCE_DIR}/device/velo/common/include)
-#include_directories(${PROJECT_SOURCE_DIR}/device/event_model/common/include)
-#include_directories(${PROJECT_SOURCE_DIR}/device/event_model/velo/include)
-#include_directories(${PROJECT_SOURCE_DIR}/main/include)
-#include_directories(${PROJECT_SOURCE_DIR}/stream/gear/include)
-#include_directories(${PROJECT_SOURCE_DIR}/stream/sequence/include)
-
-#allen_add_device_library(Svs_pair_cand STATIC
-#  ${svs_pair_candidates_sources}
-#)
diff --git a/device/svs_pair_candidates/include/FilterSvs.cuh b/device/svs_pair_candidates/include/FilterSvs.cuh
deleted file mode 100644
index 537f43de032..00000000000
--- a/device/svs_pair_candidates/include/FilterSvs.cuh
+++ /dev/null
@@ -1,74 +0,0 @@
-/*****************************************************************************\
-* (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration      *
-\*****************************************************************************/
-#pragma once
-
-#include "VertexDefinitions.cuh"
-
-#include "States.cuh"
-#include "AlgorithmTypes.cuh"
-#include "ParticleTypes.cuh"
-
-// #include "ParKalmanDefinitions.cuh"
-// #include "ParKalmanMath.cuh"
-// #include "ParKalmanFittedTrack.cuh"
-// #include "VertexDefinitions.cuh"
-// #include "PV_Definitions.cuh"
-// #include "SciFiConsolidated.cuh"
-// #include "UTConsolidated.cuh"
-// #include "VeloConsolidated.cuh"
-// #include "AssociateConsolidated.cuh"
-// #include "States.cuh"
-// #include "AlgorithmTypes.cuh"
-// #include "ParticleTypes.cuh"
-//
-namespace FilterSvs {
-
-  struct Parameters {
-    HOST_INPUT(host_number_of_events_t, unsigned) host_number_of_events;
-    HOST_INPUT(host_number_of_tracks_t, unsigned) host_number_of_tracks;
-    HOST_INPUT(host_number_of_svs_t, unsigned) host_number_of_svs;
-    MASK_INPUT(dev_event_list_t) dev_event_list;
-    DEVICE_INPUT(dev_number_of_events_t, unsigned) dev_number_of_events;
-    DEVICE_INPUT(dev_secondary_vertices_t, Allen::Views::Physics::MultiEventCompositeParticles) dev_secondary_vertices;
-    DEVICE_OUTPUT(dev_sv_atomics_t, unsigned) dev_sv_atomics;
-    DEVICE_OUTPUT(dev_svs_trk1_idx_t, unsigned) dev_svs_trk1_idx;
-    DEVICE_OUTPUT(dev_svs_trk2_idx_t, unsigned) dev_svs_trk2_idx;
-
-    DEVICE_OUTPUT_WITH_DEPENDENCIES(
-    dev_two_track_sv_track_pointers_t,
-      DEPENDENCIES(dev_secondary_vertices_t),
-      std::array<const Allen::Views::Physics::IParticle*, 4>)
-    dev_two_track_sv_track_pointers;
-
-    //Set all properties to filter svs
-    PROPERTY(track_min_ipchi2_t, "track_min_ipchi2", "minimum track IP chi2", float) track_min_ipchi2;
-    PROPERTY(vtx_max_chi2ndof_t, "vtx_max_chi2ndof", "max vertex chi2/ndof", float) vtx_max_chi2ndof;
-    PROPERTY(block_dim_filter_t, "block_dim_filter", "block dimensions for filter step", DeviceDimensions)
-    block_dim_filter;
-  };
-
-__global__ void filter_svs(Parameters);
-
-
-struct filter_svs_t : public DeviceAlgorithm, Parameters {
-  void set_arguments_size(
-    ArgumentReferences<Parameters> arguments,
-    const RuntimeOptions&,
-    const Constants&,
-    const HostBuffers&) const;
-
-    void operator()(
-      const ArgumentReferences<Parameters>& arguments,
-      const RuntimeOptions&,
-      const Constants&,
-      HostBuffers&,
-      const Allen::Context& context) const;
-
-  private:
-    Property<track_min_ipchi2_t> m_minipchi2 {this, 7.0f};
-    Property<vtx_max_chi2ndof_t> m_maxchi2ndof {this, 30.0f};
-    Property<block_dim_filter_t> m_block_dim_filter {this, {{16, 16, 1}}};
-
-  };
-}
diff --git a/device/svs_pair_candidates/src/FilterSvs.cu b/device/svs_pair_candidates/src/FilterSvs.cu
deleted file mode 100644
index bb3dd297cfb..00000000000
--- a/device/svs_pair_candidates/src/FilterSvs.cu
+++ /dev/null
@@ -1,40 +0,0 @@
- #include "../include/FilterSvs.cuh"
-
- INSTANTIATE_ALGORITHM(FilterSvs::filter_svs_t)
-
-void FilterSvs::filter_svs_t::set_arguments_size(
-  ArgumentReferences<Parameters> arguments,
-  const RuntimeOptions&,
-  const Constants&,
-  const HostBuffers&) const
-{
-  set_size<dev_two_track_sv_track_pointers_t>(arguments, first<host_number_of_svs_t>(arguments));
-}
-
-void FilterSvs::filter_svs_t::operator()(
-  const ArgumentReferences<Parameters>& arguments,
-  const RuntimeOptions&,
-  const Constants&,
-  HostBuffers&,
-  const Allen::Context& context) const
-  {
-
-    global_function(filter_svs)(dim3(size<dev_event_list_t>(arguments)), property<block_dim_filter_t>(), context)(
-      arguments);
-  }
-
-  __global__ void FilterSvs::filter_svs(FilterSvs::Parameters parameters)
-  {
-
-    const unsigned event_number = parameters.dev_event_list[blockIdx.x];
-    const unsigned number_of_events = parameters.dev_number_of_events[0];
-
-    const auto composite_particles = parameters.dev_secondary_vertices->container(event_number);
-    const unsigned n_svs = composite_particles.size();
-
-    // unsigned* event_sv_number = parameters.dev_sv_atomics + event_number;
-    // unsigned* event_svs_trk1_idx = parameters.dev_svs_trk1_idx + idx_offset;
-    // unsigned* event_svs_trk2_idx = parameters.dev_svs_trk2_idx + idx_offset;
-
-
-   }
diff --git a/device/vertex_fit/vertex_fitter/include/VertexFitter.cuh b/device/vertex_fit/vertex_fitter/include/VertexFitter.cuh
index 95c6cef83cf..53ae0b3bef8 100644
--- a/device/vertex_fit/vertex_fitter/include/VertexFitter.cuh
+++ b/device/vertex_fit/vertex_fitter/include/VertexFitter.cuh
@@ -75,7 +75,7 @@ namespace VertexFit {
     DEVICE_OUTPUT_WITH_DEPENDENCIES(
       dev_multi_event_composites_ptr_t,
       DEPENDENCIES(dev_multi_event_composites_view_t),
-      Allen::Views::Physics::MultiEventCompositeParticles*)
+      Allen::IMultiEventContainer*)
     dev_multi_event_composites_ptr;
     PROPERTY(max_assoc_ipchi2_t, "max_assoc_ipchi2", "maximum IP chi2 to associate to PV", float) max_assoc_ipchi2;
     PROPERTY(block_dim_t, "block_dim", "block dimensions", DeviceDimensions) block_dim;
diff --git a/stream/CMakeLists.txt b/stream/CMakeLists.txt
index 86c040de311..3dadf1fbea1 100644
--- a/stream/CMakeLists.txt
+++ b/stream/CMakeLists.txt
@@ -33,7 +33,7 @@ target_link_libraries(Stream
     HostErrorBanks
     Calo
     Muon
-    Svs_pair_cand
+    Combiners
     Examples
     HostDataProvider
     HostInitEventList
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_a5000.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_a5000.txt
index 7896708250a..52e91d0cfb3 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_a5000.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_a5000.txt
@@ -73,6 +73,7 @@ Hlt1SingleHighPtMuonNoMuID:                             6/  1000, (  180.00 +/-
 Hlt1LowPtMuon:                                         20/  1000, (  600.00 +/-   132.82) kHz
 Hlt1DiMuonHighMass:                                    22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1DiMuonLowMass:                                     18/  1000, (  540.00 +/-   126.13) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1DiMuonSoft:                                         0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtDiMuon:                                        3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1TrackMuonMVA:                                      14/  1000, (  420.00 +/-   111.46) kHz
@@ -134,6 +135,7 @@ Hlt1SingleHighPtMuonNoMuID:                             6           7
 Hlt1LowPtMuon:                                         20          20
 Hlt1DiMuonHighMass:                                    22          29
 Hlt1DiMuonLowMass:                                     18          19
+Hlt1TwoKs:                                              0           0
 Hlt1DiMuonSoft:                                         0           0
 Hlt1LowPtDiMuon:                                        3           3
 Hlt1TrackMuonMVA:                                      14          14
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_epyc7502.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_epyc7502.txt
index 0d0e61a5db2..ba1c8338679 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_epyc7502.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_epyc7502.txt
@@ -73,6 +73,7 @@ Hlt1SingleHighPtMuonNoMuID:                             7/  1000, (  210.00 +/-
 Hlt1LowPtMuon:                                         18/  1000, (  540.00 +/-   126.13) kHz
 Hlt1DiMuonHighMass:                                    21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1DiMuonLowMass:                                     14/  1000, (  420.00 +/-   111.46) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1DiMuonSoft:                                         0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtDiMuon:                                        2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1TrackMuonMVA:                                      14/  1000, (  420.00 +/-   111.46) kHz
@@ -134,6 +135,7 @@ Hlt1SingleHighPtMuonNoMuID:                             7           7
 Hlt1LowPtMuon:                                         18          18
 Hlt1DiMuonHighMass:                                    21          27
 Hlt1DiMuonLowMass:                                     14          17
+Hlt1TwoKs:                                              0           0
 Hlt1DiMuonSoft:                                         0           0
 Hlt1LowPtDiMuon:                                        2           2
 Hlt1TrackMuonMVA:                                      14          14
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx2080ti.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx2080ti.txt
index 7896708250a..52e91d0cfb3 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx2080ti.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx2080ti.txt
@@ -73,6 +73,7 @@ Hlt1SingleHighPtMuonNoMuID:                             6/  1000, (  180.00 +/-
 Hlt1LowPtMuon:                                         20/  1000, (  600.00 +/-   132.82) kHz
 Hlt1DiMuonHighMass:                                    22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1DiMuonLowMass:                                     18/  1000, (  540.00 +/-   126.13) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1DiMuonSoft:                                         0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtDiMuon:                                        3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1TrackMuonMVA:                                      14/  1000, (  420.00 +/-   111.46) kHz
@@ -134,6 +135,7 @@ Hlt1SingleHighPtMuonNoMuID:                             6           7
 Hlt1LowPtMuon:                                         20          20
 Hlt1DiMuonHighMass:                                    22          29
 Hlt1DiMuonLowMass:                                     18          19
+Hlt1TwoKs:                                              0           0
 Hlt1DiMuonSoft:                                         0           0
 Hlt1LowPtDiMuon:                                        3           3
 Hlt1TrackMuonMVA:                                      14          14
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt
index 7896708250a..52e91d0cfb3 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt
@@ -73,6 +73,7 @@ Hlt1SingleHighPtMuonNoMuID:                             6/  1000, (  180.00 +/-
 Hlt1LowPtMuon:                                         20/  1000, (  600.00 +/-   132.82) kHz
 Hlt1DiMuonHighMass:                                    22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1DiMuonLowMass:                                     18/  1000, (  540.00 +/-   126.13) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1DiMuonSoft:                                         0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtDiMuon:                                        3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1TrackMuonMVA:                                      14/  1000, (  420.00 +/-   111.46) kHz
@@ -134,6 +135,7 @@ Hlt1SingleHighPtMuonNoMuID:                             6           7
 Hlt1LowPtMuon:                                         20          20
 Hlt1DiMuonHighMass:                                    22          29
 Hlt1DiMuonLowMass:                                     18          19
+Hlt1TwoKs:                                              0           0
 Hlt1DiMuonSoft:                                         0           0
 Hlt1LowPtDiMuon:                                        3           3
 Hlt1TrackMuonMVA:                                      14          14
diff --git a/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt b/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt
index 4dc61dfe12c..dd105cc0ada 100644
--- a/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt
+++ b/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt
@@ -134,6 +134,7 @@ Hlt1SingleHighPtMuonNoMuID:                             7           9
 Hlt1LowPtMuon:                                         17          18
 Hlt1DiMuonHighMass:                                    10          14
 Hlt1DiMuonLowMass:                                     12          14
+Hlt1TwoKs:                                              0           0
 Hlt1DiMuonSoft:                                         0           0
 Hlt1LowPtDiMuon:                                        3           3
 Hlt1TrackMuonMVA:                                      17          18
-- 
GitLab


From be77c0f243d9dbb0eab6bdc95fa911f441e24c4c Mon Sep 17 00:00:00 2001
From: thboettc <boettcts@ucmail.uc.edu>
Date: Thu, 28 Jul 2022 17:27:50 -0400
Subject: [PATCH 3/6] Add check for SV fit in SubBank maker

Add check for SV fit in SubBank maker

Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Allen/-/jobs/23621652
---
 device/event_model/common/include/ParticleTypes.cuh |  8 +++++++-
 device/selections/Hlt1/src/MakeSubBanks.cu          | 10 ++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/device/event_model/common/include/ParticleTypes.cuh b/device/event_model/common/include/ParticleTypes.cuh
index f3b4aeceba5..bc57fcadb26 100644
--- a/device/event_model/common/include/ParticleTypes.cuh
+++ b/device/event_model/common/include/ParticleTypes.cuh
@@ -437,7 +437,13 @@ namespace Allen {
           return m_children[i];
         }
 
-        __host__ __device__ SecondaryVertex vertex() const { return m_vertices->vertex(m_index); }
+        __host__ __device__ bool has_vertex() const { return m_vertices != nullptr; }
+
+        __host__ __device__ SecondaryVertex vertex() const
+        {
+          assert(has_vertex());
+          return m_vertices->vertex(m_index);
+        }
 
         // TODO: Some of these quantities are expensive to calculate, so it
         // might be a good idea to store them in an "extra info" array. Need to
diff --git a/device/selections/Hlt1/src/MakeSubBanks.cu b/device/selections/Hlt1/src/MakeSubBanks.cu
index 2ac3a22fb98..c9acf6bf31d 100644
--- a/device/selections/Hlt1/src/MakeSubBanks.cu
+++ b/device/selections/Hlt1/src/MakeSubBanks.cu
@@ -312,10 +312,12 @@ __global__ void make_subbanks::make_rb_substr(make_subbanks::Parameters paramete
       // Store pt, (dipion) mass, FD, FD chi2
       i_word = svs_start_word + i_sv;
       float* float_info = reinterpret_cast<float*>(event_rb_stdinfo);
-      float_info[i_word] = sv_ptr->vertex().x();
-      float_info[i_word + 1] = sv_ptr->vertex().y();
-      float_info[i_word + 2] = sv_ptr->vertex().z();
-      float_info[i_word + 3] = sv_ptr->vertex().chi2();
+      if (sv_ptr->has_vertex()) {
+        float_info[i_word] = sv_ptr->vertex().x();
+        float_info[i_word + 1] = sv_ptr->vertex().y();
+        float_info[i_word + 2] = sv_ptr->vertex().z();
+        float_info[i_word + 3] = sv_ptr->vertex().chi2();
+      }
     }
 
     // Add track information to the beginning of the bank.
-- 
GitLab


From 48181ada5f554089a7ff27814b6300807a199ed0 Mon Sep 17 00:00:00 2001
From: Lorenzo Pica <lorenzo.pica@cern.ch>
Date: Thu, 29 Sep 2022 08:26:28 +0200
Subject: [PATCH 4/6] Update references

---
 ...cluster_v1_hlt1_pp_SMOG2_validation_a5000.txt |  2 ++
 ...ster_v1_hlt1_pp_SMOG2_validation_epyc7502.txt |  2 ++
 ...hlt1_pp_SMOG2_validation_geforcertx2080ti.txt |  2 ++
 ...1_hlt1_pp_SMOG2_validation_geforcertx3090.txt |  2 ++
 ...ster_v1_hlt1_pp_matching_validation_a5000.txt |  2 ++
 ...r_v1_hlt1_pp_matching_validation_epyc7502.txt |  2 ++
 ...1_pp_matching_validation_geforcertx2080ti.txt |  2 ++
 ...lt1_pp_matching_validation_geforcertx3090.txt |  2 ++
 ...retinacluster_v1_hlt1_pp_validation_a5000.txt |  2 ++
 ...inacluster_v1_hlt1_pp_validation_epyc7502.txt |  2 ++
 ...er_v1_hlt1_pp_validation_geforcertx2080ti.txt |  2 ++
 ...ster_v1_hlt1_pp_validation_geforcertx3090.txt |  2 ++
 ...iPhiMD_1k_hlt1_pp_veloSP_validation_a5000.txt | 12 +++++++-----
 ...iMD_1k_hlt1_pp_veloSP_validation_epyc7502.txt | 12 +++++++-----
 ...lt1_pp_veloSP_validation_geforcertx2080ti.txt | 12 +++++++-----
 ..._hlt1_pp_veloSP_validation_geforcertx3090.txt | 12 +++++++-----
 ...ster_v1_hlt1_pp_matching_validation_a5000.txt | 16 +++++++++-------
 ...r_v1_hlt1_pp_matching_validation_epyc7502.txt | 16 +++++++++-------
 ...1_pp_matching_validation_geforcertx2080ti.txt | 16 +++++++++-------
 ...lt1_pp_matching_validation_geforcertx3090.txt | 16 +++++++++-------
 ...cluster_v1_hlt1_pp_no_ut_validation_a5000.txt |  4 ++--
 ...ster_v1_hlt1_pp_no_ut_validation_epyc7502.txt |  4 ++--
 ...hlt1_pp_no_ut_validation_geforcertx2080ti.txt |  4 ++--
 ...1_hlt1_pp_no_ut_validation_geforcertx3090.txt |  4 ++--
 ...retinacluster_v1_hlt1_pp_validation_a5000.txt |  8 +++++---
 ...inacluster_v1_hlt1_pp_validation_epyc7502.txt |  2 ++
 ...er_v1_hlt1_pp_validation_geforcertx2080ti.txt |  8 +++++---
 ...ster_v1_hlt1_pp_validation_geforcertx3090.txt |  8 +++++---
 ...retinacluster_v1_hlt1_pp_validation_a5000.txt |  2 ++
 ...inacluster_v1_hlt1_pp_validation_epyc7502.txt |  2 ++
 ...er_v1_hlt1_pp_validation_geforcertx2080ti.txt |  2 ++
 ...ster_v1_hlt1_pp_validation_geforcertx3090.txt |  2 ++
 ...ter_000_v1_hlt1_pp_SMOG2_validation_a5000.txt |  2 ++
 ..._000_v1_hlt1_pp_SMOG2_validation_epyc7502.txt |  2 ++
 ...hlt1_pp_SMOG2_validation_geforcertx2080ti.txt |  2 ++
 ...1_hlt1_pp_SMOG2_validation_geforcertx3090.txt |  2 ++
 36 files changed, 129 insertions(+), 65 deletions(-)

diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_a5000.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_a5000.txt
index 8558e823655..5e879162d98 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_a5000.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_a5000.txt
@@ -71,6 +71,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -142,6 +143,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_epyc7502.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_epyc7502.txt
index bc21c5a5ff5..6a655e50576 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_epyc7502.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_epyc7502.txt
@@ -71,6 +71,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -142,6 +143,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_geforcertx2080ti.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_geforcertx2080ti.txt
index 8558e823655..5e879162d98 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_geforcertx2080ti.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_geforcertx2080ti.txt
@@ -71,6 +71,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -142,6 +143,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_geforcertx3090.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_geforcertx3090.txt
index 8558e823655..5e879162d98 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_geforcertx3090.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_SMOG2_validation_geforcertx3090.txt
@@ -71,6 +71,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -142,6 +143,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt
index 94b96db2c4f..e012a0a47e7 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt
@@ -93,6 +93,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -154,6 +155,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt
index 8262fb847a5..45854a910f8 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt
@@ -93,6 +93,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -154,6 +155,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt
index 94b96db2c4f..e012a0a47e7 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt
@@ -93,6 +93,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -154,6 +155,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt
index 94b96db2c4f..e012a0a47e7 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt
@@ -93,6 +93,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -154,6 +155,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_a5000.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_a5000.txt
index bdce9526022..13c4e8b172e 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_a5000.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_a5000.txt
@@ -71,6 +71,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -132,6 +133,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_epyc7502.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_epyc7502.txt
index f1b256f3ec1..45fd92757da 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_epyc7502.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_epyc7502.txt
@@ -71,6 +71,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -132,6 +133,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt
index bdce9526022..13c4e8b172e 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt
@@ -71,6 +71,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -132,6 +133,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt
index bdce9526022..13c4e8b172e 100644
--- a/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt
+++ b/test/reference/SMOG2_pHe_5k_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt
@@ -71,6 +71,7 @@ Hlt1TwoTrackKs:                                         0/  1000, (    0.00 +/-
 Hlt1D2KK:                                               0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2KPi:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1D2PiPi:                                             0/  1000, (    0.00 +/-     0.00) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtMuon:                                          0/  1000, (    0.00 +/-     0.00) kHz
@@ -132,6 +133,7 @@ Hlt1TwoTrackKs:                                         0           0
 Hlt1D2KK:                                               0           0
 Hlt1D2KPi:                                              0           0
 Hlt1D2PiPi:                                             0           0
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             0           0
 Hlt1LowPtMuon:                                          0           0
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_a5000.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_a5000.txt
index 80979e1f2c6..30c1f3ccfca 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_a5000.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_a5000.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             39/  1000, ( 1170.00 +/-   183.66) kHz
 Hlt1D2PiPi:                                            29/  1000, (  870.00 +/-   159.20) kHz
+Hlt1TwoKs:                                              2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1SingleHighPtMuon:                                   2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1SingleHighPtMuonNoMuID:                             2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1LowPtMuon:                                        163/  1000, ( 4890.00 +/-   350.41) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              21          24
 Hlt1D2KPi:                                             39          43
 Hlt1D2PiPi:                                            29          33
+Hlt1TwoKs:                                              2           2
 Hlt1SingleHighPtMuon:                                   2           2
 Hlt1SingleHighPtMuonNoMuID:                             2           2
 Hlt1LowPtMuon:                                        163         189
@@ -195,9 +197,9 @@ Hlt1D2KPiAlignment:                                    39          43
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           1           1
 
-Total decisions: 4192
-Total tracks:    3519
-Total SVs:       2972
-Total hits:      85957
-Total stdinfo:   44232
+Total decisions: 4194
+Total tracks:    3520
+Total SVs:       2975
+Total hits:      85980
+Total stdinfo:   44254
 
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_epyc7502.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_epyc7502.txt
index fb83cc1ab33..cdb041be95d 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_epyc7502.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_epyc7502.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1D2KPi:                                             40/  1000, ( 1200.00 +/-   185.90) kHz
 Hlt1D2PiPi:                                            31/  1000, (  930.00 +/-   164.42) kHz
+Hlt1TwoKs:                                              2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1SingleHighPtMuon:                                   2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1SingleHighPtMuonNoMuID:                             4/  1000, (  120.00 +/-    59.88) kHz
 Hlt1LowPtMuon:                                        154/  1000, ( 4620.00 +/-   342.43) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              22          25
 Hlt1D2KPi:                                             40          43
 Hlt1D2PiPi:                                            31          34
+Hlt1TwoKs:                                              2           2
 Hlt1SingleHighPtMuon:                                   2           2
 Hlt1SingleHighPtMuonNoMuID:                             4           4
 Hlt1LowPtMuon:                                        154         178
@@ -195,9 +197,9 @@ Hlt1D2KPiAlignment:                                    40          43
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           1           1
 
-Total decisions: 4122
-Total tracks:    3329
-Total SVs:       2793
-Total hits:      81238
-Total stdinfo:   41926
+Total decisions: 4124
+Total tracks:    3330
+Total SVs:       2796
+Total hits:      81261
+Total stdinfo:   41948
 
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_geforcertx2080ti.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_geforcertx2080ti.txt
index 80979e1f2c6..30c1f3ccfca 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_geforcertx2080ti.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_geforcertx2080ti.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             39/  1000, ( 1170.00 +/-   183.66) kHz
 Hlt1D2PiPi:                                            29/  1000, (  870.00 +/-   159.20) kHz
+Hlt1TwoKs:                                              2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1SingleHighPtMuon:                                   2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1SingleHighPtMuonNoMuID:                             2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1LowPtMuon:                                        163/  1000, ( 4890.00 +/-   350.41) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              21          24
 Hlt1D2KPi:                                             39          43
 Hlt1D2PiPi:                                            29          33
+Hlt1TwoKs:                                              2           2
 Hlt1SingleHighPtMuon:                                   2           2
 Hlt1SingleHighPtMuonNoMuID:                             2           2
 Hlt1LowPtMuon:                                        163         189
@@ -195,9 +197,9 @@ Hlt1D2KPiAlignment:                                    39          43
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           1           1
 
-Total decisions: 4192
-Total tracks:    3519
-Total SVs:       2972
-Total hits:      85957
-Total stdinfo:   44232
+Total decisions: 4194
+Total tracks:    3520
+Total SVs:       2975
+Total hits:      85980
+Total stdinfo:   44254
 
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_geforcertx3090.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_geforcertx3090.txt
index 80979e1f2c6..30c1f3ccfca 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_geforcertx3090.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_1k_hlt1_pp_veloSP_validation_geforcertx3090.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             39/  1000, ( 1170.00 +/-   183.66) kHz
 Hlt1D2PiPi:                                            29/  1000, (  870.00 +/-   159.20) kHz
+Hlt1TwoKs:                                              2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1SingleHighPtMuon:                                   2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1SingleHighPtMuonNoMuID:                             2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1LowPtMuon:                                        163/  1000, ( 4890.00 +/-   350.41) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              21          24
 Hlt1D2KPi:                                             39          43
 Hlt1D2PiPi:                                            29          33
+Hlt1TwoKs:                                              2           2
 Hlt1SingleHighPtMuon:                                   2           2
 Hlt1SingleHighPtMuonNoMuID:                             2           2
 Hlt1LowPtMuon:                                        163         189
@@ -195,9 +197,9 @@ Hlt1D2KPiAlignment:                                    39          43
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           1           1
 
-Total decisions: 4192
-Total tracks:    3519
-Total SVs:       2972
-Total hits:      85957
-Total stdinfo:   44232
+Total decisions: 4194
+Total tracks:    3520
+Total SVs:       2975
+Total hits:      85980
+Total stdinfo:   44254
 
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt
index 6b2211d2eef..f43343e4396 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt
@@ -91,13 +91,13 @@ long_fromB_P>5GeV_AND_Pt>1GeV                     :      2200/     2487  88.46%
 
 
 muon_validator validation:
-Muon fraction in all MCPs:                                              13578/  1005942   0.01% 
-Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01% 
-Correctly identified muons with isMuon:                                   569/      634  89.75% 
-Correctly identified muons from strange decays with isMuon:                 2/        2 100.00% 
-Correctly identified muons from B decays with isMuon:                     110/      119  92.44% 
-Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76% 
-Ghost tracks identified as muon with isMuon:                              819/     4243  19.30% 
+Muon fraction in all MCPs:                                              13578/  1005942   0.01%
+Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01%
+Correctly identified muons with isMuon:                                   569/      634  89.75%
+Correctly identified muons from strange decays with isMuon:                 2/        2 100.00%
+Correctly identified muons from B decays with isMuon:                     110/      119  92.44%
+Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76%
+Ghost tracks identified as muon with isMuon:                              819/     4243  19.30%
 
 
 rate_validator validation:
@@ -109,6 +109,7 @@ Hlt1TwoTrackKs:                                         3/  1000, (   90.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             36/  1000, ( 1080.00 +/-   176.73) kHz
 Hlt1D2PiPi:                                            37/  1000, ( 1110.00 +/-   179.08) kHz
+Hlt1TwoKs:                                              1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             5/  1000, (  150.00 +/-    66.91) kHz
 Hlt1LowPtMuon:                                        312/  1000, ( 9360.00 +/-   439.53) kHz
@@ -170,6 +171,7 @@ Hlt1TwoTrackKs:                                         3           3
 Hlt1D2KK:                                              21          23
 Hlt1D2KPi:                                             36          38
 Hlt1D2PiPi:                                            37          38
+Hlt1TwoKs:                                              1           1
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             5           5
 Hlt1LowPtMuon:                                        312         417
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt
index 24a61f000a9..2901a2a9bb8 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt
@@ -91,13 +91,13 @@ long_fromB_P>5GeV_AND_Pt>1GeV                     :      2200/     2487  88.46%
 
 
 muon_validator validation:
-Muon fraction in all MCPs:                                              13578/  1005942   0.01% 
-Muon fraction in MCPs to which a track(s) was matched:                    632/    60085   0.01% 
-Correctly identified muons with isMuon:                                   567/      632  89.72% 
-Correctly identified muons from strange decays with isMuon:                 2/        2 100.00% 
-Correctly identified muons from B decays with isMuon:                     110/      119  92.44% 
-Tracks identified as muon with isMuon, but matched to non-muon MCP:      6994/    59453  11.76% 
-Ghost tracks identified as muon with isMuon:                              803/     4230  18.98% 
+Muon fraction in all MCPs:                                              13578/  1005942   0.01%
+Muon fraction in MCPs to which a track(s) was matched:                    632/    60085   0.01%
+Correctly identified muons with isMuon:                                   567/      632  89.72%
+Correctly identified muons from strange decays with isMuon:                 2/        2 100.00%
+Correctly identified muons from B decays with isMuon:                     110/      119  92.44%
+Tracks identified as muon with isMuon, but matched to non-muon MCP:      6994/    59453  11.76%
+Ghost tracks identified as muon with isMuon:                              803/     4230  18.98%
 
 
 rate_validator validation:
@@ -109,6 +109,7 @@ Hlt1TwoTrackKs:                                         3/  1000, (   90.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             39/  1000, ( 1170.00 +/-   183.66) kHz
 Hlt1D2PiPi:                                            38/  1000, ( 1140.00 +/-   181.38) kHz
+Hlt1TwoKs:                                              1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             5/  1000, (  150.00 +/-    66.91) kHz
 Hlt1LowPtMuon:                                        308/  1000, ( 9240.00 +/-   437.98) kHz
@@ -170,6 +171,7 @@ Hlt1TwoTrackKs:                                         3           3
 Hlt1D2KK:                                              21          23
 Hlt1D2KPi:                                             39          41
 Hlt1D2PiPi:                                            38          39
+Hlt1TwoKs:                                              1           1
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             5           5
 Hlt1LowPtMuon:                                        308         416
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt
index 6b2211d2eef..f43343e4396 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt
@@ -91,13 +91,13 @@ long_fromB_P>5GeV_AND_Pt>1GeV                     :      2200/     2487  88.46%
 
 
 muon_validator validation:
-Muon fraction in all MCPs:                                              13578/  1005942   0.01% 
-Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01% 
-Correctly identified muons with isMuon:                                   569/      634  89.75% 
-Correctly identified muons from strange decays with isMuon:                 2/        2 100.00% 
-Correctly identified muons from B decays with isMuon:                     110/      119  92.44% 
-Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76% 
-Ghost tracks identified as muon with isMuon:                              819/     4243  19.30% 
+Muon fraction in all MCPs:                                              13578/  1005942   0.01%
+Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01%
+Correctly identified muons with isMuon:                                   569/      634  89.75%
+Correctly identified muons from strange decays with isMuon:                 2/        2 100.00%
+Correctly identified muons from B decays with isMuon:                     110/      119  92.44%
+Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76%
+Ghost tracks identified as muon with isMuon:                              819/     4243  19.30%
 
 
 rate_validator validation:
@@ -109,6 +109,7 @@ Hlt1TwoTrackKs:                                         3/  1000, (   90.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             36/  1000, ( 1080.00 +/-   176.73) kHz
 Hlt1D2PiPi:                                            37/  1000, ( 1110.00 +/-   179.08) kHz
+Hlt1TwoKs:                                              1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             5/  1000, (  150.00 +/-    66.91) kHz
 Hlt1LowPtMuon:                                        312/  1000, ( 9360.00 +/-   439.53) kHz
@@ -170,6 +171,7 @@ Hlt1TwoTrackKs:                                         3           3
 Hlt1D2KK:                                              21          23
 Hlt1D2KPi:                                             36          38
 Hlt1D2PiPi:                                            37          38
+Hlt1TwoKs:                                              1           1
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             5           5
 Hlt1LowPtMuon:                                        312         417
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt
index 6b2211d2eef..f43343e4396 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt
@@ -91,13 +91,13 @@ long_fromB_P>5GeV_AND_Pt>1GeV                     :      2200/     2487  88.46%
 
 
 muon_validator validation:
-Muon fraction in all MCPs:                                              13578/  1005942   0.01% 
-Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01% 
-Correctly identified muons with isMuon:                                   569/      634  89.75% 
-Correctly identified muons from strange decays with isMuon:                 2/        2 100.00% 
-Correctly identified muons from B decays with isMuon:                     110/      119  92.44% 
-Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76% 
-Ghost tracks identified as muon with isMuon:                              819/     4243  19.30% 
+Muon fraction in all MCPs:                                              13578/  1005942   0.01%
+Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01%
+Correctly identified muons with isMuon:                                   569/      634  89.75%
+Correctly identified muons from strange decays with isMuon:                 2/        2 100.00%
+Correctly identified muons from B decays with isMuon:                     110/      119  92.44%
+Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76%
+Ghost tracks identified as muon with isMuon:                              819/     4243  19.30%
 
 
 rate_validator validation:
@@ -109,6 +109,7 @@ Hlt1TwoTrackKs:                                         3/  1000, (   90.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             36/  1000, ( 1080.00 +/-   176.73) kHz
 Hlt1D2PiPi:                                            37/  1000, ( 1110.00 +/-   179.08) kHz
+Hlt1TwoKs:                                              1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             5/  1000, (  150.00 +/-    66.91) kHz
 Hlt1LowPtMuon:                                        312/  1000, ( 9360.00 +/-   439.53) kHz
@@ -170,6 +171,7 @@ Hlt1TwoTrackKs:                                         3           3
 Hlt1D2KK:                                              21          23
 Hlt1D2KPi:                                             36          38
 Hlt1D2PiPi:                                            37          38
+Hlt1TwoKs:                                              1           1
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             5           5
 Hlt1LowPtMuon:                                        312         417
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_a5000.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_a5000.txt
index 52e91d0cfb3..fd5f94b6006 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_a5000.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_a5000.txt
@@ -68,12 +68,12 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              19/  1000, (  570.00 +/-   129.52) kHz
 Hlt1D2KPi:                                             36/  1000, ( 1080.00 +/-   176.73) kHz
 Hlt1D2PiPi:                                            32/  1000, (  960.00 +/-   166.97) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             6/  1000, (  180.00 +/-    73.26) kHz
 Hlt1LowPtMuon:                                         20/  1000, (  600.00 +/-   132.82) kHz
 Hlt1DiMuonHighMass:                                    22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1DiMuonLowMass:                                     18/  1000, (  540.00 +/-   126.13) kHz
-Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1DiMuonSoft:                                         0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtDiMuon:                                        3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1TrackMuonMVA:                                      14/  1000, (  420.00 +/-   111.46) kHz
@@ -130,12 +130,12 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              19          23
 Hlt1D2KPi:                                             36          39
 Hlt1D2PiPi:                                            32          35
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             6           7
 Hlt1LowPtMuon:                                         20          20
 Hlt1DiMuonHighMass:                                    22          29
 Hlt1DiMuonLowMass:                                     18          19
-Hlt1TwoKs:                                              0           0
 Hlt1DiMuonSoft:                                         0           0
 Hlt1LowPtDiMuon:                                        3           3
 Hlt1TrackMuonMVA:                                      14          14
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_epyc7502.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_epyc7502.txt
index ba1c8338679..a972d32710e 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_epyc7502.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_epyc7502.txt
@@ -68,12 +68,12 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1D2KPi:                                             33/  1000, (  990.00 +/-   169.47) kHz
 Hlt1D2PiPi:                                            27/  1000, (  810.00 +/-   153.77) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             7/  1000, (  210.00 +/-    79.09) kHz
 Hlt1LowPtMuon:                                         18/  1000, (  540.00 +/-   126.13) kHz
 Hlt1DiMuonHighMass:                                    21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1DiMuonLowMass:                                     14/  1000, (  420.00 +/-   111.46) kHz
-Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1DiMuonSoft:                                         0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtDiMuon:                                        2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1TrackMuonMVA:                                      14/  1000, (  420.00 +/-   111.46) kHz
@@ -130,12 +130,12 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              22          25
 Hlt1D2KPi:                                             33          34
 Hlt1D2PiPi:                                            27          29
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             7           7
 Hlt1LowPtMuon:                                         18          18
 Hlt1DiMuonHighMass:                                    21          27
 Hlt1DiMuonLowMass:                                     14          17
-Hlt1TwoKs:                                              0           0
 Hlt1DiMuonSoft:                                         0           0
 Hlt1LowPtDiMuon:                                        2           2
 Hlt1TrackMuonMVA:                                      14          14
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx2080ti.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx2080ti.txt
index 52e91d0cfb3..fd5f94b6006 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx2080ti.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx2080ti.txt
@@ -68,12 +68,12 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              19/  1000, (  570.00 +/-   129.52) kHz
 Hlt1D2KPi:                                             36/  1000, ( 1080.00 +/-   176.73) kHz
 Hlt1D2PiPi:                                            32/  1000, (  960.00 +/-   166.97) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             6/  1000, (  180.00 +/-    73.26) kHz
 Hlt1LowPtMuon:                                         20/  1000, (  600.00 +/-   132.82) kHz
 Hlt1DiMuonHighMass:                                    22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1DiMuonLowMass:                                     18/  1000, (  540.00 +/-   126.13) kHz
-Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1DiMuonSoft:                                         0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtDiMuon:                                        3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1TrackMuonMVA:                                      14/  1000, (  420.00 +/-   111.46) kHz
@@ -130,12 +130,12 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              19          23
 Hlt1D2KPi:                                             36          39
 Hlt1D2PiPi:                                            32          35
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             6           7
 Hlt1LowPtMuon:                                         20          20
 Hlt1DiMuonHighMass:                                    22          29
 Hlt1DiMuonLowMass:                                     18          19
-Hlt1TwoKs:                                              0           0
 Hlt1DiMuonSoft:                                         0           0
 Hlt1LowPtDiMuon:                                        3           3
 Hlt1TrackMuonMVA:                                      14          14
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt
index 52e91d0cfb3..fd5f94b6006 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_no_ut_validation_geforcertx3090.txt
@@ -68,12 +68,12 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              19/  1000, (  570.00 +/-   129.52) kHz
 Hlt1D2KPi:                                             36/  1000, ( 1080.00 +/-   176.73) kHz
 Hlt1D2PiPi:                                            32/  1000, (  960.00 +/-   166.97) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             6/  1000, (  180.00 +/-    73.26) kHz
 Hlt1LowPtMuon:                                         20/  1000, (  600.00 +/-   132.82) kHz
 Hlt1DiMuonHighMass:                                    22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1DiMuonLowMass:                                     18/  1000, (  540.00 +/-   126.13) kHz
-Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1DiMuonSoft:                                         0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1LowPtDiMuon:                                        3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1TrackMuonMVA:                                      14/  1000, (  420.00 +/-   111.46) kHz
@@ -130,12 +130,12 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              19          23
 Hlt1D2KPi:                                             36          39
 Hlt1D2PiPi:                                            32          35
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             6           7
 Hlt1LowPtMuon:                                         20          20
 Hlt1DiMuonHighMass:                                    22          29
 Hlt1DiMuonLowMass:                                     18          19
-Hlt1TwoKs:                                              0           0
 Hlt1DiMuonSoft:                                         0           0
 Hlt1LowPtDiMuon:                                        3           3
 Hlt1TrackMuonMVA:                                      14          14
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_a5000.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_a5000.txt
index f8a7e048823..3bedc6f24ac 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_a5000.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_a5000.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             39/  1000, ( 1170.00 +/-   183.66) kHz
 Hlt1D2PiPi:                                            28/  1000, (  840.00 +/-   156.51) kHz
+Hlt1TwoKs:                                              1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1LowPtMuon:                                        164/  1000, ( 4920.00 +/-   351.27) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              21          24
 Hlt1D2KPi:                                             39          42
 Hlt1D2PiPi:                                            28          31
+Hlt1TwoKs:                                              1           1
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             2           2
 Hlt1LowPtMuon:                                        164         191
@@ -195,9 +197,9 @@ Hlt1D2KPiAlignment:                                    39          42
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           1           1
 
-Total decisions: 4192
+Total decisions: 4193
 Total tracks:    3525
-Total SVs:       2975
+Total SVs:       2976
 Total hits:      86137
-Total stdinfo:   44292
+Total stdinfo:   44297
 
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_epyc7502.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_epyc7502.txt
index 8248c31a84f..1bc9f955634 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_epyc7502.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_epyc7502.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             39/  1000, ( 1170.00 +/-   183.66) kHz
 Hlt1D2PiPi:                                            30/  1000, (  900.00 +/-   161.83) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1SingleHighPtMuonNoMuID:                             4/  1000, (  120.00 +/-    59.88) kHz
 Hlt1LowPtMuon:                                        157/  1000, ( 4710.00 +/-   345.13) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              21          24
 Hlt1D2KPi:                                             39          42
 Hlt1D2PiPi:                                            30          33
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   2           2
 Hlt1SingleHighPtMuonNoMuID:                             4           4
 Hlt1LowPtMuon:                                        157         182
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt
index f8a7e048823..3bedc6f24ac 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             39/  1000, ( 1170.00 +/-   183.66) kHz
 Hlt1D2PiPi:                                            28/  1000, (  840.00 +/-   156.51) kHz
+Hlt1TwoKs:                                              1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1LowPtMuon:                                        164/  1000, ( 4920.00 +/-   351.27) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              21          24
 Hlt1D2KPi:                                             39          42
 Hlt1D2PiPi:                                            28          31
+Hlt1TwoKs:                                              1           1
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             2           2
 Hlt1LowPtMuon:                                        164         191
@@ -195,9 +197,9 @@ Hlt1D2KPiAlignment:                                    39          42
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           1           1
 
-Total decisions: 4192
+Total decisions: 4193
 Total tracks:    3525
-Total SVs:       2975
+Total SVs:       2976
 Total hits:      86137
-Total stdinfo:   44292
+Total stdinfo:   44297
 
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt
index f8a7e048823..3bedc6f24ac 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         4/  1000, (  120.00 +/-
 Hlt1D2KK:                                              21/  1000, (  630.00 +/-   136.03) kHz
 Hlt1D2KPi:                                             39/  1000, ( 1170.00 +/-   183.66) kHz
 Hlt1D2PiPi:                                            28/  1000, (  840.00 +/-   156.51) kHz
+Hlt1TwoKs:                                              1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1LowPtMuon:                                        164/  1000, ( 4920.00 +/-   351.27) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         4           4
 Hlt1D2KK:                                              21          24
 Hlt1D2KPi:                                             39          42
 Hlt1D2PiPi:                                            28          31
+Hlt1TwoKs:                                              1           1
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             2           2
 Hlt1LowPtMuon:                                        164         191
@@ -195,9 +197,9 @@ Hlt1D2KPiAlignment:                                    39          42
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           1           1
 
-Total decisions: 4192
+Total decisions: 4193
 Total tracks:    3525
-Total SVs:       2975
+Total SVs:       2976
 Total hits:      86137
-Total stdinfo:   44292
+Total stdinfo:   44297
 
diff --git a/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_a5000.txt b/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_a5000.txt
index 80e6dc3ba9c..83699262503 100644
--- a/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_a5000.txt
+++ b/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_a5000.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         6/  1000, (  180.00 +/-
 Hlt1D2KK:                                              22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1D2KPi:                                             31/  1000, (  930.00 +/-   164.42) kHz
 Hlt1D2PiPi:                                            22/  1000, (  660.00 +/-   139.16) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1LowPtMuon:                                        135/  1000, ( 4050.00 +/-   324.19) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         6           6
 Hlt1D2KK:                                              22          24
 Hlt1D2KPi:                                             31          33
 Hlt1D2PiPi:                                            22          23
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             2           3
 Hlt1LowPtMuon:                                        135         155
diff --git a/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_epyc7502.txt b/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_epyc7502.txt
index c0b6edcc3e9..bc13c7ccfc8 100644
--- a/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_epyc7502.txt
+++ b/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_epyc7502.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         6/  1000, (  180.00 +/-
 Hlt1D2KK:                                              17/  1000, (  510.00 +/-   122.64) kHz
 Hlt1D2KPi:                                             27/  1000, (  810.00 +/-   153.77) kHz
 Hlt1D2PiPi:                                            17/  1000, (  510.00 +/-   122.64) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1LowPtMuon:                                        125/  1000, ( 3750.00 +/-   313.75) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         6           6
 Hlt1D2KK:                                              17          19
 Hlt1D2KPi:                                             27          30
 Hlt1D2PiPi:                                            17          18
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             3           4
 Hlt1LowPtMuon:                                        125         142
diff --git a/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt b/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt
index 80e6dc3ba9c..83699262503 100644
--- a/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt
+++ b/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_geforcertx2080ti.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         6/  1000, (  180.00 +/-
 Hlt1D2KK:                                              22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1D2KPi:                                             31/  1000, (  930.00 +/-   164.42) kHz
 Hlt1D2PiPi:                                            22/  1000, (  660.00 +/-   139.16) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1LowPtMuon:                                        135/  1000, ( 4050.00 +/-   324.19) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         6           6
 Hlt1D2KK:                                              22          24
 Hlt1D2KPi:                                             31          33
 Hlt1D2PiPi:                                            22          23
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             2           3
 Hlt1LowPtMuon:                                        135         155
diff --git a/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt b/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt
index 80e6dc3ba9c..83699262503 100644
--- a/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt
+++ b/test/reference/Upgrade_BsPhiPhi_MD_FTv4_DIGI_retinacluster_v1_hlt1_pp_validation_geforcertx3090.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         6/  1000, (  180.00 +/-
 Hlt1D2KK:                                              22/  1000, (  660.00 +/-   139.16) kHz
 Hlt1D2KPi:                                             31/  1000, (  930.00 +/-   164.42) kHz
 Hlt1D2PiPi:                                            22/  1000, (  660.00 +/-   139.16) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1SingleHighPtMuonNoMuID:                             2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1LowPtMuon:                                        135/  1000, ( 4050.00 +/-   324.19) kHz
@@ -146,6 +147,7 @@ Hlt1TwoTrackKs:                                         6           6
 Hlt1D2KK:                                              22          24
 Hlt1D2KPi:                                             31          33
 Hlt1D2PiPi:                                            22          23
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   3           3
 Hlt1SingleHighPtMuonNoMuID:                             2           3
 Hlt1LowPtMuon:                                        135         155
diff --git a/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_a5000.txt b/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_a5000.txt
index 46a6c85459e..848be7acd27 100644
--- a/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_a5000.txt
+++ b/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_a5000.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         2/  1000, (   60.00 +/-
 Hlt1D2KK:                                               2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1D2KPi:                                              3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1D2PiPi:                                             2/  1000, (   60.00 +/-    42.38) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1LowPtMuon:                                         77/  1000, ( 2310.00 +/-   252.91) kHz
@@ -156,6 +157,7 @@ Hlt1TwoTrackKs:                                         2           2
 Hlt1D2KK:                                               2           3
 Hlt1D2KPi:                                              3           3
 Hlt1D2PiPi:                                             2           2
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             1           1
 Hlt1LowPtMuon:                                         77          82
diff --git a/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_epyc7502.txt b/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_epyc7502.txt
index bba947f93d4..cde6c2e02ec 100644
--- a/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_epyc7502.txt
+++ b/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_epyc7502.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         2/  1000, (   60.00 +/-
 Hlt1D2KK:                                               1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1D2KPi:                                              3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1D2PiPi:                                             2/  1000, (   60.00 +/-    42.38) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1LowPtMuon:                                         75/  1000, ( 2250.00 +/-   249.87) kHz
@@ -156,6 +157,7 @@ Hlt1TwoTrackKs:                                         2           2
 Hlt1D2KK:                                               1           2
 Hlt1D2KPi:                                              3           3
 Hlt1D2PiPi:                                             2           2
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             1           1
 Hlt1LowPtMuon:                                         75          82
diff --git a/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_geforcertx2080ti.txt b/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_geforcertx2080ti.txt
index 46a6c85459e..848be7acd27 100644
--- a/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_geforcertx2080ti.txt
+++ b/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_geforcertx2080ti.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         2/  1000, (   60.00 +/-
 Hlt1D2KK:                                               2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1D2KPi:                                              3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1D2PiPi:                                             2/  1000, (   60.00 +/-    42.38) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1LowPtMuon:                                         77/  1000, ( 2310.00 +/-   252.91) kHz
@@ -156,6 +157,7 @@ Hlt1TwoTrackKs:                                         2           2
 Hlt1D2KK:                                               2           3
 Hlt1D2KPi:                                              3           3
 Hlt1D2PiPi:                                             2           2
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             1           1
 Hlt1LowPtMuon:                                         77          82
diff --git a/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_geforcertx3090.txt b/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_geforcertx3090.txt
index 46a6c85459e..848be7acd27 100644
--- a/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_geforcertx3090.txt
+++ b/test/reference/upgrade_mc_minbias_scifi_v5_retinacluster_000_v1_hlt1_pp_SMOG2_validation_geforcertx3090.txt
@@ -85,6 +85,7 @@ Hlt1TwoTrackKs:                                         2/  1000, (   60.00 +/-
 Hlt1D2KK:                                               2/  1000, (   60.00 +/-    42.38) kHz
 Hlt1D2KPi:                                              3/  1000, (   90.00 +/-    51.88) kHz
 Hlt1D2PiPi:                                             2/  1000, (   60.00 +/-    42.38) kHz
+Hlt1TwoKs:                                              0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuon:                                   0/  1000, (    0.00 +/-     0.00) kHz
 Hlt1SingleHighPtMuonNoMuID:                             1/  1000, (   30.00 +/-    29.98) kHz
 Hlt1LowPtMuon:                                         77/  1000, ( 2310.00 +/-   252.91) kHz
@@ -156,6 +157,7 @@ Hlt1TwoTrackKs:                                         2           2
 Hlt1D2KK:                                               2           3
 Hlt1D2KPi:                                              3           3
 Hlt1D2PiPi:                                             2           2
+Hlt1TwoKs:                                              0           0
 Hlt1SingleHighPtMuon:                                   0           0
 Hlt1SingleHighPtMuonNoMuID:                             1           1
 Hlt1LowPtMuon:                                         77          82
-- 
GitLab


From feafec1e891e9b55ca021946d53a4ddd1589c2a1 Mon Sep 17 00:00:00 2001
From: Rosen Matev <rosen.matev@cern.ch>
Date: Tue, 4 Oct 2022 15:49:38 +0200
Subject: [PATCH 5/6] Easier reference updates

---
 doc/ci/ci_configuration.rst                | 12 ++++++++++--
 scripts/ci/config/common-test.yaml         |  9 ++++-----
 scripts/ci/jobs/test_physics_efficiency.sh | 22 +++++++++++++++-------
 3 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/doc/ci/ci_configuration.rst b/doc/ci/ci_configuration.rst
index 4ea148115e9..92827842ab4 100644
--- a/doc/ci/ci_configuration.rst
+++ b/doc/ci/ci_configuration.rst
@@ -2,7 +2,7 @@ Allen CI configuration
 ==========================
 
 The scripts to configure Allen's CI pipeline are located in `scripts/ci/config <https://gitlab.cern.ch/lhcb/Allen/-/tree/master/scripts/ci/config>`_
-Two pipelines are defined and used as follows: Every commit to a merge request triggers the "minimal" pipeline. Before merging a merge request, the "full pipeline" with a larger varietey of build options and data sets is triggered manually from the merge request page. 
+Two pipelines are defined and used as follows: Every commit to a merge request triggers the "minimal" pipeline. Before merging a merge request, the "full pipeline" with a larger varietey of build options and data sets is triggered manually from the merge request page.
 
 Adding new devices
 ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -86,11 +86,19 @@ Adding new efficiency reference files
 -----------------------------------------
 Create the reference file with the format `test/reference/${DATA_TAG}_${DEVICE_ID}.txt`.
 
+Updating efficiency reference files
+-----------------------------------------
+If the changes introduced in a MR are expected to have an impact on the physics efficiency, the job will fail, pointing to the need of updating the reference files.
+Make sure that the differences reported in the make sense.
+If in doubt, or for any significant changes, flag it up on your MR.
+
+The failing CI job will produce a patch file and provide instructions on how to commit at the bottom.
+
 Adding new builds
 ---------------------
 The `parallel:matrix:` keys will need to be modified in either `.build_job_minimal_matrix` or `.build_job_additional_matrix`.
 
-N.B. 
+N.B.
 
 * `$LCG_QUALIFIER` does not need to be set in `parallel:matrix:` for the full builds, but it will need to be for the minimal builds.
 * `$OPTIONS` can be left blank or undefined. If options need to be passed to CMake e.g. `-DBUILD_TESTING=ON -DENABLE_CONTRACTS=ON`, then `$OPTIONS` can be set to `BUILD_TESTING+ENABLE_CONTRACTS` which will set both CMake options to `ON` by default. If you need this to be something other than `ON`, then you can do `BUILD_TESTING=OFF+ENABLE_CONTRACTS=OFF`, for example.
diff --git a/scripts/ci/config/common-test.yaml b/scripts/ci/config/common-test.yaml
index f893e2c9925..0dfdaee1cc5 100644
--- a/scripts/ci/config/common-test.yaml
+++ b/scripts/ci/config/common-test.yaml
@@ -4,7 +4,7 @@
 
 
 .test_physics_efficiency:
-  extends: 
+  extends:
     - .base_job
     - .default_rules
   variables:
@@ -18,14 +18,13 @@
     expire_in: 2 hours
     when: always
     paths:
-      - ./run_physics_efficiency_output_*/*.diff
       - ./run_physics_efficiency_output_*/efficiency_*
       - ./generated_reference_files/*
-
+      - update-references.patch
 
 
 .test_run_changes:
-  extends: 
+  extends:
     - .base_job
     - .default_rules
   variables:
@@ -37,7 +36,7 @@
 
 .publish_test_throughput:
   stage: publish
-  extends: 
+  extends:
     - .base_job
     - .default_rules
   variables:
diff --git a/scripts/ci/jobs/test_physics_efficiency.sh b/scripts/ci/jobs/test_physics_efficiency.sh
index 400618dec37..54315ab209c 100755
--- a/scripts/ci/jobs/test_physics_efficiency.sh
+++ b/scripts/ci/jobs/test_physics_efficiency.sh
@@ -11,7 +11,7 @@ mkdir -p ${TOPLEVEL}/generated_reference_files/
 set +x;
 RC=0
 DIFFERENCES=""
-for OUTPUT_FOLDER in run_physics_efficiency_output_*/ ; do 
+for OUTPUT_FOLDER in run_physics_efficiency_output_*/ ; do
   echo "==============================="
   echo "Entering ${OUTPUT_FOLDER}"
   cd ${OUTPUT_FOLDER}
@@ -19,7 +19,7 @@ for OUTPUT_FOLDER in run_physics_efficiency_output_*/ ; do
 
   DIFF_FOUND=0
   DIFFS_THISFOLDER=""
-  for i in $( ls ); do 
+  for i in $( ls ); do
     echo "==============="
     echo " "
     echo " "
@@ -27,13 +27,13 @@ for OUTPUT_FOLDER in run_physics_efficiency_output_*/ ; do
 
     echo "Folder    : ${OUTPUT_FOLDER}"
     echo "File      : efficiency_${i}"
-  
+
     FIRST=`grep -nr "Processing complete" ${i} | sed -e 's/\([0-9]*\).*/\1/'`
     NLINES=`wc -l ${i} | awk '{ print $1; }'`
     tail -n$((${NLINES}-${FIRST}-1)) ${i} | head -n$((${NLINES}-${FIRST}-3)) > efficiency_${i}
     cp efficiency_${i} ${TOPLEVEL}/generated_reference_files/${i}
 
-    if [ ! -f "${TOPLEVEL}/test/reference/${i}" ]; then 
+    if [ ! -f "${TOPLEVEL}/test/reference/${i}" ]; then
       echo "Reference : NOT FOUND - continue."
       continue
     else
@@ -46,7 +46,7 @@ for OUTPUT_FOLDER in run_physics_efficiency_output_*/ ; do
       echo "***"
       echo "*** A difference was found."
       echo "***"
-      diff -u -B -Z ${TOPLEVEL}/test/reference/${i} efficiency_${i} > ${i}.diff || true
+      cp efficiency_${i} ${TOPLEVEL}/test/reference/${i}
       DIFF_FOUND=1
       DIFFS_THISFOLDER="${DIFFS_THISFOLDER}
       - ${OUTPUT_FOLDER}: ${i}"
@@ -64,14 +64,22 @@ for OUTPUT_FOLDER in run_physics_efficiency_output_*/ ; do
     echo "*** No differences found against reference files for ${OUTPUT_FOLDER}.";
   fi
   cd ${TOPLEVEL}
-done 
+done
 
-if [ ${RC} -ne 0 ]; then 
+if [ ${RC} -ne 0 ]; then
   echo " "
   echo "*** Differences were found in efficiencies for:"
   echo "${DIFFERENCES}"
   echo " "
   echo "*** See above for diffs."
+
+  git --version
+  git -c user.name="Gitlab CI" -c user.email="noreply@cern.ch" commit test/reference -m "Update CI references" -m "patch generated by ${CI_JOB_URL}"
+  git format-patch -1 --output=update-references.patch
+  echo "======================================="
+  echo " If the diffs make sense, you can update the references with:"
+  echo "   curl ${CI_JOB_URL}/artifacts/raw/update-references.patch | git am"
+  echo "======================================="
 fi
 
 exit ${RC}
-- 
GitLab


From 19c2a20c10f75a1dea52ea78df003452ac3ccbef Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Tue, 4 Oct 2022 19:36:19 +0200
Subject: [PATCH 6/6] Update CI references

patch generated by https://gitlab.cern.ch/lhcb/Allen/-/jobs/24952727
---
 ...r_v1_hlt1_pp_matching_validation_a5000.txt | 20 +++++++++----------
 ...1_hlt1_pp_matching_validation_epyc7502.txt | 20 +++++++++----------
 ...p_matching_validation_geforcertx2080ti.txt | 20 +++++++++----------
 ..._pp_matching_validation_geforcertx3090.txt | 20 +++++++++----------
 4 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt
index f43343e4396..ff394fe1ab5 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_a5000.txt
@@ -91,13 +91,13 @@ long_fromB_P>5GeV_AND_Pt>1GeV                     :      2200/     2487  88.46%
 
 
 muon_validator validation:
-Muon fraction in all MCPs:                                              13578/  1005942   0.01%
-Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01%
-Correctly identified muons with isMuon:                                   569/      634  89.75%
-Correctly identified muons from strange decays with isMuon:                 2/        2 100.00%
-Correctly identified muons from B decays with isMuon:                     110/      119  92.44%
-Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76%
-Ghost tracks identified as muon with isMuon:                              819/     4243  19.30%
+Muon fraction in all MCPs:                                              13578/  1005942   0.01% 
+Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01% 
+Correctly identified muons with isMuon:                                   569/      634  89.75% 
+Correctly identified muons from strange decays with isMuon:                 2/        2 100.00% 
+Correctly identified muons from B decays with isMuon:                     110/      119  92.44% 
+Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76% 
+Ghost tracks identified as muon with isMuon:                              819/     4243  19.30% 
 
 
 rate_validator validation:
@@ -221,9 +221,9 @@ Hlt1D2KPiAlignment:                                    36          38
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           2           2
 
-Total decisions: 4439
+Total decisions: 4440
 Total tracks:    3913
-Total SVs:       3043
+Total SVs:       3045
 Total hits:      79317
-Total stdinfo:   47915
+Total stdinfo:   47924
 
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt
index 2901a2a9bb8..cf51b8da410 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_epyc7502.txt
@@ -91,13 +91,13 @@ long_fromB_P>5GeV_AND_Pt>1GeV                     :      2200/     2487  88.46%
 
 
 muon_validator validation:
-Muon fraction in all MCPs:                                              13578/  1005942   0.01%
-Muon fraction in MCPs to which a track(s) was matched:                    632/    60085   0.01%
-Correctly identified muons with isMuon:                                   567/      632  89.72%
-Correctly identified muons from strange decays with isMuon:                 2/        2 100.00%
-Correctly identified muons from B decays with isMuon:                     110/      119  92.44%
-Tracks identified as muon with isMuon, but matched to non-muon MCP:      6994/    59453  11.76%
-Ghost tracks identified as muon with isMuon:                              803/     4230  18.98%
+Muon fraction in all MCPs:                                              13578/  1005942   0.01% 
+Muon fraction in MCPs to which a track(s) was matched:                    632/    60085   0.01% 
+Correctly identified muons with isMuon:                                   567/      632  89.72% 
+Correctly identified muons from strange decays with isMuon:                 2/        2 100.00% 
+Correctly identified muons from B decays with isMuon:                     110/      119  92.44% 
+Tracks identified as muon with isMuon, but matched to non-muon MCP:      6994/    59453  11.76% 
+Ghost tracks identified as muon with isMuon:                              803/     4230  18.98% 
 
 
 rate_validator validation:
@@ -221,9 +221,9 @@ Hlt1D2KPiAlignment:                                    39          41
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           2           2
 
-Total decisions: 4438
+Total decisions: 4439
 Total tracks:    3935
-Total SVs:       3078
+Total SVs:       3080
 Total hits:      79744
-Total stdinfo:   48230
+Total stdinfo:   48239
 
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt
index f43343e4396..ff394fe1ab5 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx2080ti.txt
@@ -91,13 +91,13 @@ long_fromB_P>5GeV_AND_Pt>1GeV                     :      2200/     2487  88.46%
 
 
 muon_validator validation:
-Muon fraction in all MCPs:                                              13578/  1005942   0.01%
-Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01%
-Correctly identified muons with isMuon:                                   569/      634  89.75%
-Correctly identified muons from strange decays with isMuon:                 2/        2 100.00%
-Correctly identified muons from B decays with isMuon:                     110/      119  92.44%
-Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76%
-Ghost tracks identified as muon with isMuon:                              819/     4243  19.30%
+Muon fraction in all MCPs:                                              13578/  1005942   0.01% 
+Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01% 
+Correctly identified muons with isMuon:                                   569/      634  89.75% 
+Correctly identified muons from strange decays with isMuon:                 2/        2 100.00% 
+Correctly identified muons from B decays with isMuon:                     110/      119  92.44% 
+Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76% 
+Ghost tracks identified as muon with isMuon:                              819/     4243  19.30% 
 
 
 rate_validator validation:
@@ -221,9 +221,9 @@ Hlt1D2KPiAlignment:                                    36          38
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           2           2
 
-Total decisions: 4439
+Total decisions: 4440
 Total tracks:    3913
-Total SVs:       3043
+Total SVs:       3045
 Total hits:      79317
-Total stdinfo:   47915
+Total stdinfo:   47924
 
diff --git a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt
index f43343e4396..ff394fe1ab5 100644
--- a/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt
+++ b/test/reference/SciFiv6_upgrade_DC19_01_Bs2PhiPhiMD_retinacluster_v1_hlt1_pp_matching_validation_geforcertx3090.txt
@@ -91,13 +91,13 @@ long_fromB_P>5GeV_AND_Pt>1GeV                     :      2200/     2487  88.46%
 
 
 muon_validator validation:
-Muon fraction in all MCPs:                                              13578/  1005942   0.01%
-Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01%
-Correctly identified muons with isMuon:                                   569/      634  89.75%
-Correctly identified muons from strange decays with isMuon:                 2/        2 100.00%
-Correctly identified muons from B decays with isMuon:                     110/      119  92.44%
-Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76%
-Ghost tracks identified as muon with isMuon:                              819/     4243  19.30%
+Muon fraction in all MCPs:                                              13578/  1005942   0.01% 
+Muon fraction in MCPs to which a track(s) was matched:                    634/    60004   0.01% 
+Correctly identified muons with isMuon:                                   569/      634  89.75% 
+Correctly identified muons from strange decays with isMuon:                 2/        2 100.00% 
+Correctly identified muons from B decays with isMuon:                     110/      119  92.44% 
+Tracks identified as muon with isMuon, but matched to non-muon MCP:      6982/    59370  11.76% 
+Ghost tracks identified as muon with isMuon:                              819/     4243  19.30% 
 
 
 rate_validator validation:
@@ -221,9 +221,9 @@ Hlt1D2KPiAlignment:                                    36          38
 Hlt1DiMuonHighMassAlignment:                            0           0
 Hlt1DisplacedDiMuonAlignment:                           2           2
 
-Total decisions: 4439
+Total decisions: 4440
 Total tracks:    3913
-Total SVs:       3043
+Total SVs:       3045
 Total hits:      79317
-Total stdinfo:   47915
+Total stdinfo:   47924
 
-- 
GitLab