From d5d6b1946d5da9a86005f88380499bcbf5659005 Mon Sep 17 00:00:00 2001
From: Nicholas Styles <nicholas.styles@desy.de>
Date: Thu, 27 Mar 2025 23:35:44 +0000
Subject: [PATCH] Fix for non-unique alignable transforms being created in
 multicopies

---
 .../GeoModelXML/GeoModelXml/src/MulticopyProcessor.cxx      | 6 ++++--
 athena_ci/ci.yml                                            | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/GeoModelTools/GeoModelXML/GeoModelXml/src/MulticopyProcessor.cxx b/GeoModelTools/GeoModelXML/GeoModelXml/src/MulticopyProcessor.cxx
index 127732a4f..f3f255c66 100644
--- a/GeoModelTools/GeoModelXML/GeoModelXml/src/MulticopyProcessor.cxx
+++ b/GeoModelTools/GeoModelXML/GeoModelXml/src/MulticopyProcessor.cxx
@@ -72,7 +72,9 @@ void MulticopyProcessor::process(const DOMElement *element, GmxUtil &gmxUtil, Ge
 
     map<string, GeoNodeList>::iterator entry;
     GeoNodeList *xfList;
-    if ((entry = m_map.find(name)) == m_map.end()) { // Not in registry; make a new item
+    // Check that the item is not already in the registry, or is alignable and so a new transform must *always* be made to allow unique alignment corrections; make a new item
+    //See also handling in TransformProcessor/Element2GeoItem
+    if ((entry = m_map.find(name)) == m_map.end() || alignable) { 
         //
         //    Add empty node list to the map
         //       
@@ -153,7 +155,7 @@ void MulticopyProcessor::process(const DOMElement *element, GmxUtil &gmxUtil, Ge
                 hepXf = hepXf0 * hepXf; //multiply by hepXf0 again for each copy
             }
         }
-    } else {
+    } else { //if it is already in the registry, use existing version (if allowed)
         xfList = &entry->second;
     }
 
diff --git a/athena_ci/ci.yml b/athena_ci/ci.yml
index 3d56cbd6f..36ce1283d 100644
--- a/athena_ci/ci.yml
+++ b/athena_ci/ci.yml
@@ -173,7 +173,7 @@ run_workflow_tests_run3_mc:
   extends: .run_base
   script:
     - cd run
-    - RunWorkflowTests_Run3.py --CI -r -w MCReco -e '--maxEvents 25 --conditionsTag OFLCOND-MC23-SDR-RUN3-05' --detailed-comparison
+    - RunWorkflowTests_Run3.py --CI -r -w MCReco -e '--maxEvents 25 --conditionsTag OFLCOND-MC23-SDR-RUN3-08' --detailed-comparison
 
 run_workflow_tests_run4_reco:
   extends: .run_base
@@ -182,7 +182,7 @@ run_workflow_tests_run4_reco:
       - build_geomodel_athena
   script:
       - cd run
-      - RunWorkflowTests_Run4.py --CI -r -w MCReco -e '--conditionsTag OFLCOND-MC21-SDR-RUN4-01 --maxEvents 5 --inputHITSFile=../../myHITS.pool.root' --no-output-checks
+      - RunWorkflowTests_Run4.py --CI -r -w MCReco -e '--conditionsTag OFLCOND-MC21-SDR-RUN4-03 --maxEvents 5 --inputHITSFile=../../myHITS.pool.root' --no-output-checks
 
 
 ###################################################
-- 
GitLab