From 54ef1f13b4143f6ab521b68b7dd2b9823bb4a08c Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 18 Jan 2023 13:09:52 +0100
Subject: [PATCH 01/13] move CaloCellWeightCorrection from CaloUtils to CaloRec
 + migrate to ToolHandleArray

---
 .../src/CaloCellWeightCorrection.cxx          | 42 +++----------------
 .../src}/CaloCellWeightCorrection.h           |  4 +-
 .../src/components/CaloRec_entries.cxx        |  3 ++
 .../src/components/CaloUtils_entries.cxx      |  3 +-
 4 files changed, 10 insertions(+), 42 deletions(-)
 rename Calorimeter/{CaloUtils => CaloRec}/src/CaloCellWeightCorrection.cxx (70%)
 rename Calorimeter/{CaloUtils/CaloUtils => CaloRec/src}/CaloCellWeightCorrection.h (93%)

diff --git a/Calorimeter/CaloUtils/src/CaloCellWeightCorrection.cxx b/Calorimeter/CaloRec/src/CaloCellWeightCorrection.cxx
similarity index 70%
rename from Calorimeter/CaloUtils/src/CaloCellWeightCorrection.cxx
rename to Calorimeter/CaloRec/src/CaloCellWeightCorrection.cxx
index 58023775ae3c..6bc4faeda455 100644
--- a/Calorimeter/CaloUtils/src/CaloCellWeightCorrection.cxx
+++ b/Calorimeter/CaloRec/src/CaloCellWeightCorrection.cxx
@@ -16,7 +16,7 @@ PURPOSE: Loops over list of ICellWeightTools and applies weight to cell
 
 // Calo Header files:
 
-#include "CaloUtils/CaloCellWeightCorrection.h"
+#include "CaloCellWeightCorrection.h"
 #include "CaloEvent/CaloCellContainer.h"
 #include "CaloEvent/CaloCell.h"
 
@@ -31,11 +31,7 @@ CaloCellWeightCorrection::CaloCellWeightCorrection(const std::string& type,
 				     const std::string& name, 
 				     const IInterface* parent) 
   : CaloCellCorrection(type, name, parent)
-{
-
-  declareProperty( "CellWeightToolNames", m_cellWeightToolNames);
-
- }
+{ }
 
 // DESTRUCTOR:
 
@@ -48,36 +44,8 @@ CaloCellWeightCorrection::~CaloCellWeightCorrection()
 
 StatusCode CaloCellWeightCorrection::initialize() {
 
-//---- retrieve the noisetool ----------------
-  IToolSvc* toolSvc = nullptr;// Pointer to Tool Service
-  ATH_CHECK( service("ToolSvc", toolSvc) );
-
-// access tools  and store them
-
- std::vector<std::string>::const_iterator itrName=m_cellWeightToolNames.begin();
- std::vector<std::string>::const_iterator endName= m_cellWeightToolNames.end();
-
- IAlgTool* algtool;    
- for (; itrName!=endName;++itrName){
-
-   ListItem theItem(*itrName);
-
-
-   ATH_MSG_DEBUG( "Retrieving " << *itrName  );
-   StatusCode sc = toolSvc->retrieveTool(theItem.type(), theItem.name(), algtool);
-
-   if (sc.isFailure()) {
-     ATH_MSG_INFO( "Unable to find tool for " <<(*itrName) );
-   }
-   else 
-     { 
-       ATH_MSG_INFO( (*itrName) << " successfully retrieved" );
-
-       m_cellWeightTools.push_back( dynamic_cast<ICellWeightTool*>(algtool) );
-     }
- }
-
-
+  ATH_CHECK(m_cellWeightToolNames.retrieve());
+  
   // Return status code.
   return StatusCode::SUCCESS;
 }
@@ -118,7 +86,7 @@ CaloCellWeightCorrection::MakeCorrection ( CaloCell* theCell,
                                            const EventContext& /*ctx*/) const
 {
   double weight = 1.0;
-  for (const ICellWeightTool* tool : m_cellWeightTools) {
+  for (const auto& tool : m_cellWeightToolNames) {
     // need to be able to initialize tool (i.e. set container)    
     weight *= tool->wtCell( theCell );    
   }
diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloCellWeightCorrection.h b/Calorimeter/CaloRec/src/CaloCellWeightCorrection.h
similarity index 93%
rename from Calorimeter/CaloUtils/CaloUtils/CaloCellWeightCorrection.h
rename to Calorimeter/CaloRec/src/CaloCellWeightCorrection.h
index 7023069a254d..d7ebe4d5395e 100644
--- a/Calorimeter/CaloUtils/CaloUtils/CaloCellWeightCorrection.h
+++ b/Calorimeter/CaloRec/src/CaloCellWeightCorrection.h
@@ -53,9 +53,7 @@ class CaloCellWeightCorrection : public CaloCellCorrection
  private:
 
   // properties
-
-  std::vector< std::string > m_cellWeightToolNames;
-  std::vector< ICellWeightTool* > m_cellWeightTools;
+  ToolHandleArray<ICellWeightTool> m_cellWeightToolNames{this,"CellWeightToolNames",{},"Cell weight tools" };
   
 
 };
diff --git a/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx b/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
index 8b68511b3e66..cc859f831567 100644
--- a/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
+++ b/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
@@ -42,6 +42,8 @@
 #include "../CaloTopoTowerFromClusterMaker.h"
 #include "../CaloTopoTowerMaker.h"
 
+#include "../CaloCellWeightCorrection.h"
+
 DECLARE_COMPONENT( CaloTowerMonitor )
 DECLARE_COMPONENT( CaloTowerAlgorithm )
 DECLARE_COMPONENT( CaloTopoTowerAlgorithm )
@@ -90,3 +92,4 @@ DECLARE_COMPONENT( CaloTopoClusterTowerMerger )
 DECLARE_COMPONENT( CaloTopoTowerFromClusterMaker )
 DECLARE_COMPONENT( CaloTopoTowerFromClusterCalibrator )
 DECLARE_COMPONENT( CaloTopoTowerMaker )
+DECLARE_COMPONENT( CaloCellWeightCorrection )
diff --git a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
index 8caa4d2d7089..6711b263a710 100644
--- a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
+++ b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
@@ -1,4 +1,3 @@
-#include "CaloUtils/CaloCellWeightCorrection.h"
 #include "CaloUtils/CaloLCClassificationTool.h"
 #include "CaloUtils/CaloLCWeightTool.h"
 #include "CaloUtils/CaloLCOutOfClusterTool.h"
@@ -11,7 +10,7 @@
 #include "CaloUtils/ToolWithConstantsTestTool.h"
 
 
-DECLARE_COMPONENT( CaloCellWeightCorrection )
+
 DECLARE_COMPONENT( CaloLCClassificationTool )
 DECLARE_COMPONENT( CaloLCWeightTool )
 DECLARE_COMPONENT( CaloLCOutOfClusterTool )
-- 
GitLab


From 741969e1d90c99c837ec1575f8e408aa130ffb96 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 18 Jan 2023 13:40:29 +0100
Subject: [PATCH 02/13] move CaloLCClassificationTool from CaloUtils to
 CaloClusterCorrection (code only)

---
 .../src/CaloLCClassificationTool.cxx                           | 2 +-
 .../src}/CaloLCClassificationTool.h                            | 0
 .../src/components/CaloClusterCorrection_entries.cxx           | 2 ++
 Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx     | 3 ---
 4 files changed, 3 insertions(+), 4 deletions(-)
 rename Calorimeter/{CaloUtils => CaloClusterCorrection}/src/CaloLCClassificationTool.cxx (99%)
 rename Calorimeter/{CaloUtils/CaloUtils => CaloClusterCorrection/src}/CaloLCClassificationTool.h (100%)

diff --git a/Calorimeter/CaloUtils/src/CaloLCClassificationTool.cxx b/Calorimeter/CaloClusterCorrection/src/CaloLCClassificationTool.cxx
similarity index 99%
rename from Calorimeter/CaloUtils/src/CaloLCClassificationTool.cxx
rename to Calorimeter/CaloClusterCorrection/src/CaloLCClassificationTool.cxx
index 583b65f60972..30bec480ca91 100644
--- a/Calorimeter/CaloUtils/src/CaloLCClassificationTool.cxx
+++ b/Calorimeter/CaloClusterCorrection/src/CaloLCClassificationTool.cxx
@@ -19,7 +19,7 @@
 //-----------------------
 // This Class's Header --
 //-----------------------
-#include "CaloUtils/CaloLCClassificationTool.h"
+#include "CaloLCClassificationTool.h"
 #include "CaloUtils/CaloLCCoeffHelper.h"
 #include "xAODCaloEvent/CaloCluster.h"
 
diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloLCClassificationTool.h b/Calorimeter/CaloClusterCorrection/src/CaloLCClassificationTool.h
similarity index 100%
rename from Calorimeter/CaloUtils/CaloUtils/CaloLCClassificationTool.h
rename to Calorimeter/CaloClusterCorrection/src/CaloLCClassificationTool.h
diff --git a/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx b/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
index 7d368a36db55..3b8145b495df 100644
--- a/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
+++ b/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
@@ -49,6 +49,7 @@
 #include "../CaloClusterRemoveBad.h"
 
 #include "../CaloDummyCorrection.h"
+#include "../CaloLCClassificationTool.h"
 
 
 DECLARE_COMPONENT( CaloClusterLocalCalib )
@@ -103,3 +104,4 @@ DECLARE_COMPONENT( CaloClusterRemoveBad )
 
 DECLARE_COMPONENT( CaloDummyCorrection )
 
+DECLARE_COMPONENT( CaloLCClassificationTool )
diff --git a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
index 6711b263a710..1f64a2076e3f 100644
--- a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
+++ b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
@@ -1,4 +1,3 @@
-#include "CaloUtils/CaloLCClassificationTool.h"
 #include "CaloUtils/CaloLCWeightTool.h"
 #include "CaloUtils/CaloLCOutOfClusterTool.h"
 #include "CaloUtils/CaloLCDeadMaterialTool.h"
@@ -10,8 +9,6 @@
 #include "CaloUtils/ToolWithConstantsTestTool.h"
 
 
-
-DECLARE_COMPONENT( CaloLCClassificationTool )
 DECLARE_COMPONENT( CaloLCWeightTool )
 DECLARE_COMPONENT( CaloLCOutOfClusterTool )
 DECLARE_COMPONENT( CaloLCDeadMaterialTool )
-- 
GitLab


From e6b6afa6698e1020b9efc45ab5ee1b08da4b7c01 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 18 Jan 2023 13:49:31 +0100
Subject: [PATCH 03/13] move CaloLCWeightTool from CaloUtils to
 CaloClusterCorrection (code only)

---
 .../src/CaloLCWeightTool.cxx                                  | 2 +-
 .../src}/CaloLCWeightTool.h                                   | 0
 .../src/components/CaloClusterCorrection_entries.cxx          | 4 +++-
 Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx    | 2 --
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename Calorimeter/{CaloUtils => CaloClusterCorrection}/src/CaloLCWeightTool.cxx (99%)
 rename Calorimeter/{CaloUtils/CaloUtils => CaloClusterCorrection/src}/CaloLCWeightTool.h (100%)

diff --git a/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx b/Calorimeter/CaloClusterCorrection/src/CaloLCWeightTool.cxx
similarity index 99%
rename from Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
rename to Calorimeter/CaloClusterCorrection/src/CaloLCWeightTool.cxx
index 79b7b581bf73..ced804c73b96 100644
--- a/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
+++ b/Calorimeter/CaloClusterCorrection/src/CaloLCWeightTool.cxx
@@ -19,7 +19,7 @@
 //-----------------------
 // This Class's Header --
 //-----------------------
-#include "CaloUtils/CaloLCWeightTool.h"
+#include "CaloLCWeightTool.h"
 #include "CaloConditions/CaloLocalHadDefs.h"
 #include "CaloUtils/CaloSamplingHelper.h"
 #include "CaloUtils/CaloLCCoeffHelper.h"
diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloLCWeightTool.h b/Calorimeter/CaloClusterCorrection/src/CaloLCWeightTool.h
similarity index 100%
rename from Calorimeter/CaloUtils/CaloUtils/CaloLCWeightTool.h
rename to Calorimeter/CaloClusterCorrection/src/CaloLCWeightTool.h
diff --git a/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx b/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
index 3b8145b495df..792db2aadf41 100644
--- a/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
+++ b/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
@@ -49,8 +49,9 @@
 #include "../CaloClusterRemoveBad.h"
 
 #include "../CaloDummyCorrection.h"
-#include "../CaloLCClassificationTool.h"
 
+#include "../CaloLCClassificationTool.h"
+#include "../CaloLCWeightTool.h"
 
 DECLARE_COMPONENT( CaloClusterLocalCalib )
 DECLARE_COMPONENT( CaloClusterLogPos )
@@ -105,3 +106,4 @@ DECLARE_COMPONENT( CaloClusterRemoveBad )
 DECLARE_COMPONENT( CaloDummyCorrection )
 
 DECLARE_COMPONENT( CaloLCClassificationTool )
+DECLARE_COMPONENT (CaloLCWeightTool )
diff --git a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
index 1f64a2076e3f..e3f23cd1d70f 100644
--- a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
+++ b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
@@ -1,4 +1,3 @@
-#include "CaloUtils/CaloLCWeightTool.h"
 #include "CaloUtils/CaloLCOutOfClusterTool.h"
 #include "CaloUtils/CaloLCDeadMaterialTool.h"
 #include "CaloUtils/CaloTopoTowerBuilderTool.h"
@@ -9,7 +8,6 @@
 #include "CaloUtils/ToolWithConstantsTestTool.h"
 
 
-DECLARE_COMPONENT( CaloLCWeightTool )
 DECLARE_COMPONENT( CaloLCOutOfClusterTool )
 DECLARE_COMPONENT( CaloLCDeadMaterialTool )
 DECLARE_COMPONENT( CaloTopoTowerBuilderTool )
-- 
GitLab


From 0f631d9da192c819f4f255a4ab4c01588b6ee4aa Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 18 Jan 2023 13:55:59 +0100
Subject: [PATCH 04/13] move CaloLCOutOfClusterTool from CaloUtils to
 CaloClusterCorrection (code only)

---
 .../src/CaloLCOutOfClusterTool.cxx                        | 8 +-------
 .../src}/CaloLCOutOfClusterTool.h                         | 0
 .../src/components/CaloClusterCorrection_entries.cxx      | 5 ++++-
 .../CaloUtils/src/components/CaloUtils_entries.cxx        | 2 --
 4 files changed, 5 insertions(+), 10 deletions(-)
 rename Calorimeter/{CaloUtils => CaloClusterCorrection}/src/CaloLCOutOfClusterTool.cxx (98%)
 rename Calorimeter/{CaloUtils/CaloUtils => CaloClusterCorrection/src}/CaloLCOutOfClusterTool.h (100%)

diff --git a/Calorimeter/CaloUtils/src/CaloLCOutOfClusterTool.cxx b/Calorimeter/CaloClusterCorrection/src/CaloLCOutOfClusterTool.cxx
similarity index 98%
rename from Calorimeter/CaloUtils/src/CaloLCOutOfClusterTool.cxx
rename to Calorimeter/CaloClusterCorrection/src/CaloLCOutOfClusterTool.cxx
index 0e8f20bd14f0..e4c13128a3ce 100644
--- a/Calorimeter/CaloUtils/src/CaloLCOutOfClusterTool.cxx
+++ b/Calorimeter/CaloClusterCorrection/src/CaloLCOutOfClusterTool.cxx
@@ -19,7 +19,7 @@
 //-----------------------
 // This Class's Header --
 //-----------------------
-#include "CaloUtils/CaloLCOutOfClusterTool.h"
+#include "CaloLCOutOfClusterTool.h"
 #include "CaloConditions/CaloLocalHadDefs.h"
 #include "CaloUtils/CaloLCCoeffHelper.h"
 #include "CaloUtils/CaloSamplingHelper.h"
@@ -28,12 +28,6 @@
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "xAODCaloEvent/CaloClusterKineHelper.h"
 
-/*
-#include "GaudiKernel/ISvcLocator.h"
-#include "GaudiKernel/IToolSvc.h"
-#include "GaudiKernel/ListItem.h"
-*/
-
 using xAOD::CaloCluster;
 
 CaloLCOutOfClusterTool::CaloLCOutOfClusterTool(const std::string& type,
diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloLCOutOfClusterTool.h b/Calorimeter/CaloClusterCorrection/src/CaloLCOutOfClusterTool.h
similarity index 100%
rename from Calorimeter/CaloUtils/CaloUtils/CaloLCOutOfClusterTool.h
rename to Calorimeter/CaloClusterCorrection/src/CaloLCOutOfClusterTool.h
diff --git a/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx b/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
index 792db2aadf41..672fc0d3558f 100644
--- a/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
+++ b/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
@@ -52,6 +52,7 @@
 
 #include "../CaloLCClassificationTool.h"
 #include "../CaloLCWeightTool.h"
+#include "../CaloLCOutOfClusterTool.h"
 
 DECLARE_COMPONENT( CaloClusterLocalCalib )
 DECLARE_COMPONENT( CaloClusterLogPos )
@@ -106,4 +107,6 @@ DECLARE_COMPONENT( CaloClusterRemoveBad )
 DECLARE_COMPONENT( CaloDummyCorrection )
 
 DECLARE_COMPONENT( CaloLCClassificationTool )
-DECLARE_COMPONENT (CaloLCWeightTool )
+DECLARE_COMPONENT( CaloLCWeightTool )
+DECLARE_COMPONENT( CaloLCOutOfClusterTool )
+ 
diff --git a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
index e3f23cd1d70f..4b8f029dbfe5 100644
--- a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
+++ b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
@@ -1,4 +1,3 @@
-#include "CaloUtils/CaloLCOutOfClusterTool.h"
 #include "CaloUtils/CaloLCDeadMaterialTool.h"
 #include "CaloUtils/CaloTopoTowerBuilderTool.h"
 #include "CaloUtils/CaloTowerBuilderTool.h"
@@ -8,7 +7,6 @@
 #include "CaloUtils/ToolWithConstantsTestTool.h"
 
 
-DECLARE_COMPONENT( CaloLCOutOfClusterTool )
 DECLARE_COMPONENT( CaloLCDeadMaterialTool )
 DECLARE_COMPONENT( CaloTopoTowerBuilderTool )
 DECLARE_COMPONENT( CaloTowerBuilderTool )
-- 
GitLab


From 9bc858e13b4b68899ced1b55cb8160e9ebca6b91 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 18 Jan 2023 15:05:43 +0100
Subject: [PATCH 05/13] move CaloLCDeadMaterialTool from CaloUtils to
 CaloClusterCorrection (code only)

---
 .../src/CaloLCDeadMaterialTool.cxx                            | 2 +-
 .../src}/CaloLCDeadMaterialTool.h                             | 0
 .../src/components/CaloClusterCorrection_entries.cxx          | 4 +++-
 Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx    | 4 ++--
 4 files changed, 6 insertions(+), 4 deletions(-)
 rename Calorimeter/{CaloUtils => CaloClusterCorrection}/src/CaloLCDeadMaterialTool.cxx (99%)
 rename Calorimeter/{CaloUtils/CaloUtils => CaloClusterCorrection/src}/CaloLCDeadMaterialTool.h (100%)

diff --git a/Calorimeter/CaloUtils/src/CaloLCDeadMaterialTool.cxx b/Calorimeter/CaloClusterCorrection/src/CaloLCDeadMaterialTool.cxx
similarity index 99%
rename from Calorimeter/CaloUtils/src/CaloLCDeadMaterialTool.cxx
rename to Calorimeter/CaloClusterCorrection/src/CaloLCDeadMaterialTool.cxx
index 58834ebb736b..6f46d5553ce0 100644
--- a/Calorimeter/CaloUtils/src/CaloLCDeadMaterialTool.cxx
+++ b/Calorimeter/CaloClusterCorrection/src/CaloLCDeadMaterialTool.cxx
@@ -4,7 +4,7 @@
 
 #undef DEBUG_DMTHINGS
 #undef MAKE_MOMENTS
-#include "CaloUtils/CaloLCDeadMaterialTool.h"
+#include "CaloLCDeadMaterialTool.h"
 #include "CaloUtils/CaloLCCoeffHelper.h"
 
 #include "CaloIdentifier/CaloCell_ID.h"
diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloLCDeadMaterialTool.h b/Calorimeter/CaloClusterCorrection/src/CaloLCDeadMaterialTool.h
similarity index 100%
rename from Calorimeter/CaloUtils/CaloUtils/CaloLCDeadMaterialTool.h
rename to Calorimeter/CaloClusterCorrection/src/CaloLCDeadMaterialTool.h
diff --git a/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx b/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
index 672fc0d3558f..787ee21e1d24 100644
--- a/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
+++ b/Calorimeter/CaloClusterCorrection/src/components/CaloClusterCorrection_entries.cxx
@@ -53,6 +53,8 @@
 #include "../CaloLCClassificationTool.h"
 #include "../CaloLCWeightTool.h"
 #include "../CaloLCOutOfClusterTool.h"
+#include "../CaloLCDeadMaterialTool.h"
+
 
 DECLARE_COMPONENT( CaloClusterLocalCalib )
 DECLARE_COMPONENT( CaloClusterLogPos )
@@ -109,4 +111,4 @@ DECLARE_COMPONENT( CaloDummyCorrection )
 DECLARE_COMPONENT( CaloLCClassificationTool )
 DECLARE_COMPONENT( CaloLCWeightTool )
 DECLARE_COMPONENT( CaloLCOutOfClusterTool )
- 
+DECLARE_COMPONENT( CaloLCDeadMaterialTool )
diff --git a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
index 4b8f029dbfe5..6edc97e0e275 100644
--- a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
+++ b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
@@ -1,4 +1,4 @@
-#include "CaloUtils/CaloLCDeadMaterialTool.h"
+
 #include "CaloUtils/CaloTopoTowerBuilderTool.h"
 #include "CaloUtils/CaloTowerBuilderTool.h"
 #include "CaloUtils/xAODClusterCompressor.h"
@@ -7,7 +7,7 @@
 #include "CaloUtils/ToolWithConstantsTestTool.h"
 
 
-DECLARE_COMPONENT( CaloLCDeadMaterialTool )
+
 DECLARE_COMPONENT( CaloTopoTowerBuilderTool )
 DECLARE_COMPONENT( CaloTowerBuilderTool )
 DECLARE_COMPONENT( xAODClusterCompressor )
-- 
GitLab


From 20b61d4da4f83a09a57646d00cdf39b323b3f690 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 18 Jan 2023 15:06:22 +0100
Subject: [PATCH 06/13] Move components out of CaloUtils: Adjust job options,
 part 1

---
 Calorimeter/CaloRec/python/CaloClusterTopoGetter.py           | 3 +--
 .../HIJetRec/python/SubtractedCaloClusterTopoGetter.py        | 2 +-
 Reconstruction/tauRec/share/Pi0ClusterMaker_jobOptions.py     | 2 +-
 .../TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py    | 4 ++--
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py b/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py
index 19abbaa981f4..707d2e51b290 100644
--- a/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py
+++ b/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py
@@ -13,8 +13,7 @@ from AthenaCommon.Logging import logging
 from RecExConfig.Configured import Configured
 from RecExConfig.ObjKeyStore import objKeyStore
 
-#from CaloUtils.CaloUtilsConf import H1ClusterCellWeightTool, EMFracClusterClassificationTool, OutOfClusterCorrectionTool, DeadMaterialCorrectionTool2
-from CaloUtils.CaloUtilsConf import CaloLCClassificationTool, CaloLCWeightTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
+from CaloClusterCorrection.CaloClusterCorrectionConf import CaloLCClassificationTool, CaloLCWeightTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
 
 from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
 #>> new PL May 4, 2009
diff --git a/Reconstruction/HeavyIonRec/HIJetRec/python/SubtractedCaloClusterTopoGetter.py b/Reconstruction/HeavyIonRec/HIJetRec/python/SubtractedCaloClusterTopoGetter.py
index 9fa94094cf5f..2cc738e97a6b 100644
--- a/Reconstruction/HeavyIonRec/HIJetRec/python/SubtractedCaloClusterTopoGetter.py
+++ b/Reconstruction/HeavyIonRec/HIJetRec/python/SubtractedCaloClusterTopoGetter.py
@@ -7,7 +7,7 @@ from AthenaCommon.Logging import logging
 from RecExConfig.Configured import Configured
 from RecExConfig.ObjKeyStore import objKeyStore
 
-from CaloUtils.CaloUtilsConf import CaloLCClassificationTool, CaloLCWeightTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
+from CaloClusterCorrection.CaloClusterCorrectionConf import CaloLCClassificationTool, CaloLCWeightTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
 
 from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
 from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterCellWeightCalib
diff --git a/Reconstruction/tauRec/share/Pi0ClusterMaker_jobOptions.py b/Reconstruction/tauRec/share/Pi0ClusterMaker_jobOptions.py
index 30242681c392..d8cc96b42ec4 100644
--- a/Reconstruction/tauRec/share/Pi0ClusterMaker_jobOptions.py
+++ b/Reconstruction/tauRec/share/Pi0ClusterMaker_jobOptions.py
@@ -14,7 +14,7 @@ from AthenaCommon.JobProperties import jobproperties as jp
 import traceback
 
 #from CaloUtils.CaloUtilsConf import H1ClusterCellWeightTool, EMFracClusterClassificationTool, OutOfClusterCorrectionTool, DeadMaterialCorrectionTool2
-from CaloUtils.CaloUtilsConf import CaloLCClassificationTool, CaloLCWeightTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
+from CaloClusterCorrection.CaloClusterCorrectionConf import CaloLCClassificationTool, CaloLCWeightTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
 
 from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
 #>> new PL May 4, 2009
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py b/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py
index f1dfa8be021c..02efe2655230 100755
--- a/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/python/TrigCaloRecConfig.py
@@ -77,7 +77,7 @@ class TrigCaloClusterMaker_topo (TrigCaloClusterMakerBase):
 
         self.Cells=cells
 
-        from CaloUtils.CaloUtilsConf import CaloLCWeightTool, CaloLCClassificationTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
+        from CaloClusterCorrection.CaloClusterCorrectionConf import CaloLCWeightTool, CaloLCClassificationTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
         from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
         from CaloRec.CaloRecConf import CaloTopoClusterMaker, CaloTopoClusterSplitter, CaloClusterMomentsMaker
         from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg
@@ -362,7 +362,7 @@ class TrigCaloClusterCalibrator_LC(TrigCaloClusterCalibrator):
         super(TrigCaloClusterCalibrator_LC, self).__init__(name, **kwargs)
 
         from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg
-        from CaloUtils.CaloUtilsConf import CaloLCClassificationTool, CaloLCWeightTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
+        from CaloClusterCorrection.CaloClusterCorrectionConf import CaloLCClassificationTool, CaloLCWeightTool, CaloLCOutOfClusterTool, CaloLCDeadMaterialTool
         from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterLocalCalib
         from AthenaCommon.GlobalFlags import globalflags
 
-- 
GitLab


From 3abd713f716d1d696e83a2e3c30604899cb96f31 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 18 Jan 2023 15:49:38 +0100
Subject: [PATCH 07/13] move CaloTopoTowerBuilderTool from CaloUtils to CaloRec
 (code only)

---
 .../{CaloUtils => CaloRec}/src/CaloTopoTowerBuilderTool.cxx | 2 +-
 .../CaloUtils => CaloRec/src}/CaloTopoTowerBuilderTool.h    | 0
 Calorimeter/CaloRec/src/components/CaloRec_entries.cxx      | 6 ++++--
 Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx  | 4 ----
 4 files changed, 5 insertions(+), 7 deletions(-)
 rename Calorimeter/{CaloUtils => CaloRec}/src/CaloTopoTowerBuilderTool.cxx (99%)
 rename Calorimeter/{CaloUtils/CaloUtils => CaloRec/src}/CaloTopoTowerBuilderTool.h (100%)

diff --git a/Calorimeter/CaloUtils/src/CaloTopoTowerBuilderTool.cxx b/Calorimeter/CaloRec/src/CaloTopoTowerBuilderTool.cxx
similarity index 99%
rename from Calorimeter/CaloUtils/src/CaloTopoTowerBuilderTool.cxx
rename to Calorimeter/CaloRec/src/CaloTopoTowerBuilderTool.cxx
index 7571ae6d3fb4..5e76d6fc57e3 100644
--- a/Calorimeter/CaloUtils/src/CaloTopoTowerBuilderTool.cxx
+++ b/Calorimeter/CaloRec/src/CaloTopoTowerBuilderTool.cxx
@@ -27,7 +27,7 @@
 #include "CaloEvent/CaloTopoTowerContainer.h"
 #include "CaloEvent/CaloCluster.h"
 
-#include "CaloUtils/CaloTopoTowerBuilderTool.h"
+#include "CaloTopoTowerBuilderTool.h"
 
 #include <string>
 #include <cmath>
diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloTopoTowerBuilderTool.h b/Calorimeter/CaloRec/src/CaloTopoTowerBuilderTool.h
similarity index 100%
rename from Calorimeter/CaloUtils/CaloUtils/CaloTopoTowerBuilderTool.h
rename to Calorimeter/CaloRec/src/CaloTopoTowerBuilderTool.h
diff --git a/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx b/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
index cc859f831567..1ec14e6439e4 100644
--- a/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
+++ b/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
@@ -35,14 +35,14 @@
 #include "../CaloCellContainerAliasAlg.h"
 #include "../ToolConstantsCondAlg.h"
 #include "../CaloNoiseSigmaDiffCondAlg.h"
+#include "../CaloCellWeightCorrection.h"
 
 //Includes for CaloTopoTowers
 #include "../CaloTopoClusterTowerMerger.h"
 #include "../CaloTopoTowerFromClusterCalibrator.h"
 #include "../CaloTopoTowerFromClusterMaker.h"
 #include "../CaloTopoTowerMaker.h"
-
-#include "../CaloCellWeightCorrection.h"
+#include "../CaloTopoTowerBuilderTool.h"
 
 DECLARE_COMPONENT( CaloTowerMonitor )
 DECLARE_COMPONENT( CaloTowerAlgorithm )
@@ -93,3 +93,5 @@ DECLARE_COMPONENT( CaloTopoTowerFromClusterMaker )
 DECLARE_COMPONENT( CaloTopoTowerFromClusterCalibrator )
 DECLARE_COMPONENT( CaloTopoTowerMaker )
 DECLARE_COMPONENT( CaloCellWeightCorrection )
+
+DECLARE_COMPONENT ( CaloTopoTowerBuilderTool )
diff --git a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
index 6edc97e0e275..26fa9cdabc83 100644
--- a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
+++ b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
@@ -1,14 +1,10 @@
 
-#include "CaloUtils/CaloTopoTowerBuilderTool.h"
 #include "CaloUtils/CaloTowerBuilderTool.h"
 #include "CaloUtils/xAODClusterCompressor.h"
 #include "../CaloTowerStoreTestAlg.h"
 #include "../CaloTowerBuilderToolTestAlg.h"
 #include "CaloUtils/ToolWithConstantsTestTool.h"
 
-
-
-DECLARE_COMPONENT( CaloTopoTowerBuilderTool )
 DECLARE_COMPONENT( CaloTowerBuilderTool )
 DECLARE_COMPONENT( xAODClusterCompressor )
 
-- 
GitLab


From 01a785682c9959818390ed3fdaf8369a35dbbaa3 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 18 Jan 2023 15:52:40 +0100
Subject: [PATCH 08/13] move CaloTopoTowerBuilderTool from CaloUtils to
 CaloRec: Adjust jobO

---
 Calorimeter/CaloRec/python/CaloTopoTowerGetter.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Calorimeter/CaloRec/python/CaloTopoTowerGetter.py b/Calorimeter/CaloRec/python/CaloTopoTowerGetter.py
index 98d48dbf1e79..720ee41eb6ba 100644
--- a/Calorimeter/CaloRec/python/CaloTopoTowerGetter.py
+++ b/Calorimeter/CaloRec/python/CaloTopoTowerGetter.py
@@ -86,7 +86,7 @@ class CaloTopoTowerGetter ( Configured )  :
 
                 # configure CaloTopoTowerAlgorithm here
                 try:
-                    from CaloUtils.CaloUtilsConf import CaloTopoTowerBuilderTool
+                    from CaloRec.CaloRecConf import CaloTopoTowerBuilderTool
                     theCaloTopoTowerBuilderTool=CaloTopoTowerBuilderTool("TopoTowerTwrBldr")
                 except Exception:
                     mlog.error("could not get handle to CaloTopoTowerBuilderTool Quit")
-- 
GitLab


From c372da58b6693f3372e34b78ffef14fe345982f1 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 18 Jan 2023 16:50:11 +0100
Subject: [PATCH 09/13] CaloTowerBuilderTool no longer a component, remove test

---
 Calorimeter/CaloUtils/CMakeLists.txt          |   6 -
 .../share/CaloTowerBuilderTool_test.py        |  49 -----
 .../src/CaloTowerBuilderToolTestAlg.cxx       | 200 ------------------
 .../src/CaloTowerBuilderToolTestAlg.h         |  76 -------
 .../src/components/CaloUtils_entries.cxx      |   4 -
 5 files changed, 335 deletions(-)
 delete mode 100644 Calorimeter/CaloUtils/share/CaloTowerBuilderTool_test.py
 delete mode 100644 Calorimeter/CaloUtils/src/CaloTowerBuilderToolTestAlg.cxx
 delete mode 100644 Calorimeter/CaloUtils/src/CaloTowerBuilderToolTestAlg.h

diff --git a/Calorimeter/CaloUtils/CMakeLists.txt b/Calorimeter/CaloUtils/CMakeLists.txt
index e5d01c93ad83..a0428b9e756d 100644
--- a/Calorimeter/CaloUtils/CMakeLists.txt
+++ b/Calorimeter/CaloUtils/CMakeLists.txt
@@ -55,12 +55,6 @@ atlas_add_test( CaloTowerStore_test
    LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment|MetaReader|AutoConfiguration|IOVDbSvc +INFO"
    PROPERTIES TIMEOUT 500 )
 
-atlas_add_test( CaloTowerBuilderTool_test
-   SCRIPT athena.py CaloUtils/CaloTowerBuilderTool_test.py
-   LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment|MetaReader|AutoConfiguration|IOVDbSvc +INFO|INFO Initializing"
-   ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-20"
-   PROPERTIES TIMEOUT 500 )
-
 atlas_add_test( ToolWithConstants_test
    SCRIPT test/ToolWithConstants_test.py
    LOG_IGNORE_PATTERN "no dictionary for|by peeking into|Current filenames:|IOVDbSvc +INFO|Added successfully Conversion|DetDescrCnvSvc +INFO|GeoModelSvc +INFO|IOVSvc +INFO|with default tag|^Py:MetaReader" )
diff --git a/Calorimeter/CaloUtils/share/CaloTowerBuilderTool_test.py b/Calorimeter/CaloUtils/share/CaloTowerBuilderTool_test.py
deleted file mode 100644
index 30ca3c442d67..000000000000
--- a/Calorimeter/CaloUtils/share/CaloTowerBuilderTool_test.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# $Id$
-#
-# @file CaloUtils/share/CaloTowerBuilderTool_test.py
-# @author scott snyder <snyder@bnl.gov>
-# @date Jul, 2013
-# @brief Regression tests for CaloTowerBuilderTool.
-#
-
-
-from AthenaCommon.DetFlags      import DetFlags
-DetFlags.detdescr.LAr_setOn()
-DetFlags.detdescr.Tile_setOn()
-
-
-import sys
-import string
-from AtlasGeoModel import SetGeometryVersion
-from AtlasGeoModel import GeoModelInit
-from AtlasGeoModel import SetupRecoGeometry
-include( "CaloIdCnv/CaloIdCnv_joboptions.py" )
-include( "TileIdCnv/TileIdCnv_jobOptions.py" )
-
-from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
-ServiceMgr += GeoModelSvc()
-theApp.CreateSvc += [ "GeoModelSvc"]
-from AtlasGeoModel import LArGM
-from AtlasGeoModel import TileGM
-
-from IOVDbSvc.IOVDbSvcConf import IOVDbSvc
-IOVDbSvc().GlobalTag = 'OFLCOND-SDR-BS14T-IBL-06'
-
-
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-
-from CaloUtils import CaloUtilsConf
-
-builder_tool = CaloUtilsConf.CaloTowerBuilderTool \
-  (IncludedCalos = ['LAREM', 'LARHEC', 'TILE'])
-ToolSvc += builder_tool
-     
-topSequence += CaloUtilsConf.CaloTowerBuilderToolTestAlg ('towertest')
-
-theApp.EvtMax = 1
-
-
-# Suppress useless GeoModelSvc messages.
-from AthenaCommon import Constants
-GeoModelSvc().OutputLevel=Constants.WARNING
diff --git a/Calorimeter/CaloUtils/src/CaloTowerBuilderToolTestAlg.cxx b/Calorimeter/CaloUtils/src/CaloTowerBuilderToolTestAlg.cxx
deleted file mode 100644
index 28a03f1d27c9..000000000000
--- a/Calorimeter/CaloUtils/src/CaloTowerBuilderToolTestAlg.cxx
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
-  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
-*/
-/**
- * @file  CaloTowerBuilderToolTestAlg.cxx
- * @author scott snyder <snyder@bnl.gov>
- * @date Jul, 2013
- * @brief Regression test for CaloTowerBuilderTool.
- */
-
-#undef NDEBUG
-
-
-#include "CaloTowerBuilderToolTestAlg.h"
-#include "CaloUtils/CaloTowerBuilderTool.h"
-#include "CaloEvent/CaloCellContainer.h"
-#include "CaloEvent/CaloTowerContainer.h"
-#include "AthenaKernel/errorcheck.h"
-#include "TestTools/random.h"
-#include "CLHEP/Units/SystemOfUnits.h"
-#include <cstdlib>
-#include <iostream>
-#include <cmath>
-#include <cassert>
-
-
-using CLHEP::GeV;
-
-
-namespace {
-
-
-bool comp (double x1, double x2, double thresh = 1e-6)
-{
-  double den = std::abs(x1) + std::abs(x2);
-  if (den == 0) return true;
-  double num = std::abs (x1 - x2);
-  return num / den < thresh;
-}
-
-
-} // anonymous namespace
-
-
-/**
- * @brief Constructor.
- */
-CaloTowerBuilderToolTestAlg::CaloTowerBuilderToolTestAlg
-  (const std::string& name,
-   ISvcLocator* pSvcLocator)
-    : AthAlgorithm (name, pSvcLocator),
-      m_builder ("CaloTowerBuilderTool"),
-      m_seed (1)
-{
-}
-
-
-/** 
- * @brief Standard Gaudi initialize method.
- */
-StatusCode CaloTowerBuilderToolTestAlg::initialize()
-{
-  m_calos.push_back (CaloCell_ID::LAREM);
-  m_calos.push_back (CaloCell_ID::LARHEC);
-  m_calos.push_back (CaloCell_ID::TILE);
-
-  CHECK( m_builder.retrieve() );
-  ATH_CHECK(m_caloMgrKey.initialize());
-
-  m_seg = CaloTowerSeg (50, 64, -2.5, 2.5);
-  m_builder->setTowerSeg (m_seg);
-  return StatusCode::SUCCESS;
-}
-
-
-CaloCellContainer*
-CaloTowerBuilderToolTestAlg::make_cells()
-{
-  CaloCellContainer* cells = new CaloCellContainer;
-  SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
-  if(!caloMgrHandle.isValid()) std::abort();
-  const CaloDetDescrManager* ddman = *caloMgrHandle;
-  for (CaloCell_ID::SUBCALO subcalo : m_calos) {
-    for (const CaloDetDescrElement* dde :
-           ddman->element_range (subcalo))
-    {
-      float energy = Athena_test::randf_seed (m_seed, 100*GeV);
-      cells->push_back (new CaloCell (dde, energy, 0, 0, 0, 
-                                      CaloGain::LARMEDIUMGAIN) );
-    }
-  }
-  return cells;
-}
-
-
-StatusCode
-CaloTowerBuilderToolTestAlg::test_subseg (const EventContext& ctx,
-                                          const CaloTowerSeg::SubSeg& subseg,
-                                          const CaloCellContainer* cells,
-                                          const CaloTowerContainer* tow0)
-{
-  CaloTowerContainer* tow = new CaloTowerContainer (subseg.segmentation());
-  CHECK( m_builder->execute (ctx, tow, cells, &subseg) );
-
-  for (size_t i = 0; i < tow->size(); i++) {
-    using index_t = CaloTowerContainer::index_t;
-    index_t ieta1 = tow->getTowerEtaIndex (i);
-    index_t iphi1 = tow->getTowerPhiIndex (i);
-    index_t ieta0 = ieta1 + subseg.etamin()-1;
-    index_t iphi0 = iphi1 + subseg.phimin()-1;
-    if (iphi0 > m_seg.nphi())
-      iphi0 -= m_seg.nphi();
-    const CaloTower* t0 = tow0->getTower (ieta0, iphi0);
-    const CaloTower* t1 = tow->getTower (i);
-    if (!comp (t0->energy(), t1->energy()) ||
-        !comp (t0->eta(), t1->eta()) ||
-        !comp (t0->phi(), t1->phi()))
-    {
-      std::cout << "Energy mismatch " << i << " "
-                << ieta1 << " " << iphi1 << " "
-                << t0->eta() << " " << t0->phi() << " "
-                << t1->eta() << " " << t1->phi() << " "
-                << t0->energy() << " " << t1->energy() << "\n";
-    }
-
-    std::vector<unsigned int> h0;
-    for (CaloTower::cell_iterator cit = t0->cell_begin();
-         cit != t0->cell_end();
-         ++cit)
-    {
-      h0.push_back ((*cit)->caloDDE()->calo_hash());
-    }
-
-    std::vector<unsigned int> h1;
-    for (CaloTower::cell_iterator cit = t1->cell_begin();
-         cit != t1->cell_end();
-         ++cit)
-    {
-      h1.push_back ((*cit)->caloDDE()->calo_hash());
-    }
-
-    if (h0 != h1) {
-      std::cout << "Cell list mismatch.\n";
-      for (size_t i = 0; i < h0.size(); i++)
-        std::cout << " " << h0[i];
-      std::cout << "\n";
-      for (size_t i = 0; i < h1.size(); i++)
-        std::cout << " " << h1[i];
-      std::cout << "\n";
-    }
-  }
-
-  delete tow;
-  
-  return StatusCode::SUCCESS;
-}
-
-
-StatusCode CaloTowerBuilderToolTestAlg::test1()
-{
-  std::cout << "test1\n";
-
-  const EventContext& ctx = Gaudi::Hive::currentContext();
-
-  const CaloCellContainer* cells = make_cells();
-  CHECK( evtStore()->record (cells, "cells") );
-  CaloTowerContainer* tow1 = new CaloTowerContainer (m_seg);
-  CHECK( m_builder->execute (ctx, tow1, cells) );
-
-  for (size_t i = 0; i < tow1->size(); i++) {
-    const CaloTower* t = (*tow1)[i];
-    std::cout << i << " "
-              << tow1->getTowerEtaIndex(i) << " "
-              << tow1->getTowerPhiIndex(i) << " "
-              << t->energy() << " ";
-    for (CaloTower::cell_iterator cit = t->cell_begin();
-         cit != t->cell_end();
-         ++cit)
-    {
-      std::cout << (*cit)->caloDDE()->calo_hash() << " ";
-    }
-    std::cout << "\n";
-  }
-
-  CHECK( test_subseg (ctx, m_seg.subseg (0.7, 0.3, -0.2, 0.4), cells, tow1) );
-  CHECK( test_subseg (ctx, m_seg.subseg (0.7, 0.3,  3.1, 0.4), cells, tow1) );
-
-  delete tow1;
-  return StatusCode::SUCCESS;
-}
-
-
-/** 
- * @brief Standard Gaudi execute method.
- */
-StatusCode CaloTowerBuilderToolTestAlg::execute()
-{
-  CHECK( test1() );
-  return StatusCode::SUCCESS;
-}
diff --git a/Calorimeter/CaloUtils/src/CaloTowerBuilderToolTestAlg.h b/Calorimeter/CaloUtils/src/CaloTowerBuilderToolTestAlg.h
deleted file mode 100644
index 942b9360d07e..000000000000
--- a/Calorimeter/CaloUtils/src/CaloTowerBuilderToolTestAlg.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// This file's extension implies that it's C, but it's really -*- C++ -*-.
-/*
-  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
-*/
-/**
- * @file CaloTowerBuilderToolTestAlg.h
- * @author scott snyder <snyder@bnl.gov>
- * @date Jul, 2013
- * @brief Regression test for CaloTowerBuilderTool.
- */
-
-
-#ifndef CALOUTILS_CALOTOWERBUILDERTOOLTESTALG_H
-#define CALOUTILS_CALOTOWERBUILDERTOOLTESTALG_H
-
-
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "CaloUtils/CaloTowerStore.h"
-#include "CaloEvent/CaloTowerSeg.h"
-#include "CaloIdentifier/CaloCell_ID.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "CaloDetDescr/CaloDetDescrManager.h"
-#include "StoreGate/ReadCondHandleKey.h"
-#include <vector>
-#include <cstdint>
-class CaloCellContainer;
-class CaloTowerContainer;
-class ICaloTowerBuilderToolBase; 
-
-
-class CaloTowerBuilderToolTestAlg
-  : public AthAlgorithm
-{
-public:
-  /**
-   * @brief Constructor.
-   */
-  CaloTowerBuilderToolTestAlg (const std::string& name,
-                               ISvcLocator* pSvcLocator);
-
-
-  /** 
-   * @brief Standard Gaudi initialize method.
-   */
-  virtual StatusCode initialize() override;
-
-
-  /** 
-   * @brief Standard Gaudi execute method.
-   */
-  virtual StatusCode execute() override;
-
-
-private:
-  CaloCellContainer* make_cells();
-  StatusCode test_subseg (const EventContext& ctx,
-                          const CaloTowerSeg::SubSeg& subseg,
-                          const CaloCellContainer* cells,
-                          const CaloTowerContainer* tow0);
-  StatusCode test1();
-
-  ToolHandle<ICaloTowerBuilderToolBase> m_builder;
-  std::vector<CaloCell_ID::SUBCALO> m_calos;
-  CaloTowerSeg m_seg;
-
-  uint32_t m_seed;
-  SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
-      , "CaloDetDescrManager"
-      , "CaloDetDescrManager"
-      , "SG Key for CaloDetDescrManager in the Condition Store" };
-};
-
-
-
-
-#endif // not CALOUTILS_CALOTOWERBUILDERTOOLTESTALG_H
diff --git a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
index 26fa9cdabc83..a06d64820ea4 100644
--- a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
+++ b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
@@ -1,14 +1,10 @@
 
-#include "CaloUtils/CaloTowerBuilderTool.h"
 #include "CaloUtils/xAODClusterCompressor.h"
 #include "../CaloTowerStoreTestAlg.h"
-#include "../CaloTowerBuilderToolTestAlg.h"
 #include "CaloUtils/ToolWithConstantsTestTool.h"
 
-DECLARE_COMPONENT( CaloTowerBuilderTool )
 DECLARE_COMPONENT( xAODClusterCompressor )
 
 DECLARE_COMPONENT( CaloTowerStoreTestAlg )
-DECLARE_COMPONENT( CaloTowerBuilderToolTestAlg )
 DECLARE_COMPONENT( CaloUtils::ToolWithConstantsTestTool )
 
-- 
GitLab


From 4d1c6a99ed1b44d96d1d814113f45f541408bceb Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Thu, 19 Jan 2023 11:18:46 +0100
Subject: [PATCH 10/13] move xAODClusterCompressor from CaloUtils to
 xAODCaloEventCnv

---
 Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx    | 4 ++--
 Event/xAOD/xAODCaloEventCnv/CMakeLists.txt                    | 4 ++--
 .../src/components/xAODCaloEventCnv_entries.cxx               | 2 ++
 .../xAOD/xAODCaloEventCnv}/src/xAODClusterCompressor.cxx      | 2 +-
 .../xAOD/xAODCaloEventCnv/src}/xAODClusterCompressor.h        | 0
 5 files changed, 7 insertions(+), 5 deletions(-)
 rename {Calorimeter/CaloUtils => Event/xAOD/xAODCaloEventCnv}/src/xAODClusterCompressor.cxx (99%)
 rename {Calorimeter/CaloUtils/CaloUtils => Event/xAOD/xAODCaloEventCnv/src}/xAODClusterCompressor.h (100%)

diff --git a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
index a06d64820ea4..3d036c6675ba 100644
--- a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
+++ b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
@@ -1,9 +1,9 @@
 
-#include "CaloUtils/xAODClusterCompressor.h"
+
 #include "../CaloTowerStoreTestAlg.h"
 #include "CaloUtils/ToolWithConstantsTestTool.h"
 
-DECLARE_COMPONENT( xAODClusterCompressor )
+
 
 DECLARE_COMPONENT( CaloTowerStoreTestAlg )
 DECLARE_COMPONENT( CaloUtils::ToolWithConstantsTestTool )
diff --git a/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt b/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt
index 11d631f92f47..8d540059fc08 100644
--- a/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt
+++ b/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt
@@ -7,14 +7,14 @@ atlas_subdir( xAODCaloEventCnv )
 atlas_add_library( xAODCaloEventCnvLib
                    xAODCaloEventCnv/*.h
                    INTERFACE
-                   PUBLIC_HEADERS xAODCaloEventCnv
+                   PUBLIC_HEADERS xAODCaloEventCnv 
                    LINK_LIBRARIES GaudiKernel xAODCaloEvent )
 
 # Component(s) in the package:
 atlas_add_component( xAODCaloEventCnv
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES xAODCaloEventCnvLib xAODCaloEvent CaloEvent AthenaBaseComps AthenaKernel GaudiKernel )
+                     LINK_LIBRARIES CaloInterfaceLib xAODCaloEventCnvLib xAODCaloEvent CaloEvent AthenaBaseComps AthenaKernel GaudiKernel )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
diff --git a/Event/xAOD/xAODCaloEventCnv/src/components/xAODCaloEventCnv_entries.cxx b/Event/xAOD/xAODCaloEventCnv/src/components/xAODCaloEventCnv_entries.cxx
index 2582a7abf069..c4ab8e5e2f2b 100644
--- a/Event/xAOD/xAODCaloEventCnv/src/components/xAODCaloEventCnv_entries.cxx
+++ b/Event/xAOD/xAODCaloEventCnv/src/components/xAODCaloEventCnv_entries.cxx
@@ -1,7 +1,9 @@
 #include "../ClusterCreator.h"
 #include "../ClusterDumper.h"
 #include "../CaloClusterCnvTool.h"
+#include "../xAODClusterCompressor.h"
 
+DECLARE_COMPONENT( xAODClusterCompressor )
 DECLARE_COMPONENT( ClusterCreator )
 DECLARE_COMPONENT( ClusterDumper )
 DECLARE_COMPONENT( xAODMaker::CaloClusterCnvTool )
diff --git a/Calorimeter/CaloUtils/src/xAODClusterCompressor.cxx b/Event/xAOD/xAODCaloEventCnv/src/xAODClusterCompressor.cxx
similarity index 99%
rename from Calorimeter/CaloUtils/src/xAODClusterCompressor.cxx
rename to Event/xAOD/xAODCaloEventCnv/src/xAODClusterCompressor.cxx
index e3bc7b81011f..01c34385a55c 100644
--- a/Calorimeter/CaloUtils/src/xAODClusterCompressor.cxx
+++ b/Event/xAOD/xAODCaloEventCnv/src/xAODClusterCompressor.cxx
@@ -11,7 +11,7 @@
 /////////////////////////////////////////////////////////////////// 
 
 // CaloUtils includes
-#include "CaloUtils/xAODClusterCompressor.h"
+#include "xAODClusterCompressor.h"
 #include <bitset>
 
 // Constructors
diff --git a/Calorimeter/CaloUtils/CaloUtils/xAODClusterCompressor.h b/Event/xAOD/xAODCaloEventCnv/src/xAODClusterCompressor.h
similarity index 100%
rename from Calorimeter/CaloUtils/CaloUtils/xAODClusterCompressor.h
rename to Event/xAOD/xAODCaloEventCnv/src/xAODClusterCompressor.h
-- 
GitLab


From ebd8386c37fb7176df1ce58f1c8df732583a08fd Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Thu, 19 Jan 2023 14:11:40 +0100
Subject: [PATCH 11/13] move CaloTowerStoreTestAlg from CaloUtils to CaloRec

---
 Calorimeter/CaloRec/CMakeLists.txt             |  4 ++++
 .../share/CaloTowerStore_test.ref              |  0
 .../src/CaloTowerStoreTestAlg.cxx              |  0
 .../src/CaloTowerStoreTestAlg.h                |  0
 .../CaloRec/src/components/CaloRec_entries.cxx |  5 +++++
 Calorimeter/CaloUtils/CMakeLists.txt           | 18 +++++++++---------
 .../src/components/CaloUtils_entries.cxx       |  4 ++--
 7 files changed, 20 insertions(+), 11 deletions(-)
 rename Calorimeter/{CaloUtils => CaloRec}/share/CaloTowerStore_test.ref (100%)
 rename Calorimeter/{CaloUtils => CaloRec}/src/CaloTowerStoreTestAlg.cxx (100%)
 rename Calorimeter/{CaloUtils => CaloRec}/src/CaloTowerStoreTestAlg.h (100%)

diff --git a/Calorimeter/CaloRec/CMakeLists.txt b/Calorimeter/CaloRec/CMakeLists.txt
index 332f8b7c118c..4f6866820dea 100644
--- a/Calorimeter/CaloRec/CMakeLists.txt
+++ b/Calorimeter/CaloRec/CMakeLists.txt
@@ -116,3 +116,7 @@ atlas_add_test( CaloCellMakerTest
                 SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/CaloCellMakerConfig.py
                 POST_EXEC_SCRIPT " /usr/bin/diff CaloCells.txt ${CMAKE_CURRENT_SOURCE_DIR}/share/CaloCells.txt.ref > diff.log " )
 
+atlas_add_test( CaloTowerStore_test
+   SCRIPT athena.py CaloUtils/CaloTowerStore_test.py
+   LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment|MetaReader|AutoConfiguration|IOVDbSvc +INFO"
+   PROPERTIES TIMEOUT 500 )
diff --git a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref b/Calorimeter/CaloRec/share/CaloTowerStore_test.ref
similarity index 100%
rename from Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
rename to Calorimeter/CaloRec/share/CaloTowerStore_test.ref
diff --git a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx b/Calorimeter/CaloRec/src/CaloTowerStoreTestAlg.cxx
similarity index 100%
rename from Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx
rename to Calorimeter/CaloRec/src/CaloTowerStoreTestAlg.cxx
diff --git a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h b/Calorimeter/CaloRec/src/CaloTowerStoreTestAlg.h
similarity index 100%
rename from Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h
rename to Calorimeter/CaloRec/src/CaloTowerStoreTestAlg.h
diff --git a/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx b/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
index 1ec14e6439e4..6f199b7dba29 100644
--- a/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
+++ b/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
@@ -44,6 +44,9 @@
 #include "../CaloTopoTowerMaker.h"
 #include "../CaloTopoTowerBuilderTool.h"
 
+#include "../CaloTowerStoreTestAlg.h"
+
+
 DECLARE_COMPONENT( CaloTowerMonitor )
 DECLARE_COMPONENT( CaloTowerAlgorithm )
 DECLARE_COMPONENT( CaloTopoTowerAlgorithm )
@@ -95,3 +98,5 @@ DECLARE_COMPONENT( CaloTopoTowerMaker )
 DECLARE_COMPONENT( CaloCellWeightCorrection )
 
 DECLARE_COMPONENT ( CaloTopoTowerBuilderTool )
+
+DECLARE_COMPONENT( CaloTowerStoreTestAlg )
diff --git a/Calorimeter/CaloUtils/CMakeLists.txt b/Calorimeter/CaloUtils/CMakeLists.txt
index a0428b9e756d..50e55c56c925 100644
--- a/Calorimeter/CaloUtils/CMakeLists.txt
+++ b/Calorimeter/CaloUtils/CMakeLists.txt
@@ -14,8 +14,8 @@ atlas_add_library( CaloUtilsLib CaloUtils/*.h CaloUtils/*.icc src/*.h src/*.cxx
    LINK_LIBRARIES AthenaBaseComps AthenaKernel CaloConditions CaloDetDescrLib CaloEvent CaloGeoHelpers CaloIdentifier CaloInterfaceLib CxxUtils FourMom GaudiKernel Navigation StoreGateLib xAODCaloEvent AthLinks
    PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} Identifier SGTools TestTools )
 
-atlas_add_component( CaloUtils src/components/*.cxx
-   LINK_LIBRARIES CaloUtilsLib )
+#atlas_add_component( CaloUtils src/components/*.cxx
+#   LINK_LIBRARIES CaloUtilsLib )
 
 atlas_add_dictionary( CaloUtilsDict
    CaloUtils/CaloUtilsDict.h CaloUtils/selection.xml
@@ -50,14 +50,14 @@ atlas_add_test( exceptions_test
    SOURCES test/exceptions_test.cxx
    LINK_LIBRARIES CaloUtilsLib )
 
-atlas_add_test( CaloTowerStore_test
-   SCRIPT athena.py CaloUtils/CaloTowerStore_test.py
-   LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment|MetaReader|AutoConfiguration|IOVDbSvc +INFO"
-   PROPERTIES TIMEOUT 500 )
+#atlas_add_test( CaloTowerStore_test
+#   SCRIPT athena.py CaloUtils/CaloTowerStore_test.py
+#   LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment|MetaReader|AutoConfiguration|IOVDbSvc +INFO"
+#   PROPERTIES TIMEOUT 500 )
 
-atlas_add_test( ToolWithConstants_test
-   SCRIPT test/ToolWithConstants_test.py
-   LOG_IGNORE_PATTERN "no dictionary for|by peeking into|Current filenames:|IOVDbSvc +INFO|Added successfully Conversion|DetDescrCnvSvc +INFO|GeoModelSvc +INFO|IOVSvc +INFO|with default tag|^Py:MetaReader" )
+#atlas_add_test( ToolWithConstants_test
+#   SCRIPT test/ToolWithConstants_test.py
+#   LOG_IGNORE_PATTERN "no dictionary for|by peeking into|Current filenames:|IOVDbSvc +INFO|Added successfully Conversion|DetDescrCnvSvc +INFO|GeoModelSvc +INFO|IOVSvc +INFO|with default tag|^Py:MetaReader" )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.txt share/*.py )
diff --git a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
index 3d036c6675ba..305965e83552 100644
--- a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
+++ b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
@@ -5,6 +5,6 @@
 
 
 
-DECLARE_COMPONENT( CaloTowerStoreTestAlg )
-DECLARE_COMPONENT( CaloUtils::ToolWithConstantsTestTool )
+//DECLARE_COMPONENT( CaloTowerStoreTestAlg )
+//DECLARE_COMPONENT( CaloUtils::ToolWithConstantsTestTool )
 
-- 
GitLab


From 30770879525a6d3ca8589cd1cdd147670cdb0adc Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Fri, 20 Jan 2023 09:14:13 +0100
Subject: [PATCH 12/13] Revert "move CaloTowerStoreTestAlg from CaloUtils to
 CaloRec"

This reverts commit d0dff78d9b11e83f961c8440bced5392819df103.
---
 Calorimeter/CaloRec/CMakeLists.txt             |  4 ----
 .../CaloRec/src/components/CaloRec_entries.cxx |  5 -----
 Calorimeter/CaloUtils/CMakeLists.txt           | 18 +++++++++---------
 .../share/CaloTowerStore_test.ref              |  0
 .../src/CaloTowerStoreTestAlg.cxx              |  0
 .../src/CaloTowerStoreTestAlg.h                |  0
 .../src/components/CaloUtils_entries.cxx       |  4 ++--
 7 files changed, 11 insertions(+), 20 deletions(-)
 rename Calorimeter/{CaloRec => CaloUtils}/share/CaloTowerStore_test.ref (100%)
 rename Calorimeter/{CaloRec => CaloUtils}/src/CaloTowerStoreTestAlg.cxx (100%)
 rename Calorimeter/{CaloRec => CaloUtils}/src/CaloTowerStoreTestAlg.h (100%)

diff --git a/Calorimeter/CaloRec/CMakeLists.txt b/Calorimeter/CaloRec/CMakeLists.txt
index 4f6866820dea..332f8b7c118c 100644
--- a/Calorimeter/CaloRec/CMakeLists.txt
+++ b/Calorimeter/CaloRec/CMakeLists.txt
@@ -116,7 +116,3 @@ atlas_add_test( CaloCellMakerTest
                 SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/CaloCellMakerConfig.py
                 POST_EXEC_SCRIPT " /usr/bin/diff CaloCells.txt ${CMAKE_CURRENT_SOURCE_DIR}/share/CaloCells.txt.ref > diff.log " )
 
-atlas_add_test( CaloTowerStore_test
-   SCRIPT athena.py CaloUtils/CaloTowerStore_test.py
-   LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment|MetaReader|AutoConfiguration|IOVDbSvc +INFO"
-   PROPERTIES TIMEOUT 500 )
diff --git a/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx b/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
index 6f199b7dba29..1ec14e6439e4 100644
--- a/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
+++ b/Calorimeter/CaloRec/src/components/CaloRec_entries.cxx
@@ -44,9 +44,6 @@
 #include "../CaloTopoTowerMaker.h"
 #include "../CaloTopoTowerBuilderTool.h"
 
-#include "../CaloTowerStoreTestAlg.h"
-
-
 DECLARE_COMPONENT( CaloTowerMonitor )
 DECLARE_COMPONENT( CaloTowerAlgorithm )
 DECLARE_COMPONENT( CaloTopoTowerAlgorithm )
@@ -98,5 +95,3 @@ DECLARE_COMPONENT( CaloTopoTowerMaker )
 DECLARE_COMPONENT( CaloCellWeightCorrection )
 
 DECLARE_COMPONENT ( CaloTopoTowerBuilderTool )
-
-DECLARE_COMPONENT( CaloTowerStoreTestAlg )
diff --git a/Calorimeter/CaloUtils/CMakeLists.txt b/Calorimeter/CaloUtils/CMakeLists.txt
index 50e55c56c925..a0428b9e756d 100644
--- a/Calorimeter/CaloUtils/CMakeLists.txt
+++ b/Calorimeter/CaloUtils/CMakeLists.txt
@@ -14,8 +14,8 @@ atlas_add_library( CaloUtilsLib CaloUtils/*.h CaloUtils/*.icc src/*.h src/*.cxx
    LINK_LIBRARIES AthenaBaseComps AthenaKernel CaloConditions CaloDetDescrLib CaloEvent CaloGeoHelpers CaloIdentifier CaloInterfaceLib CxxUtils FourMom GaudiKernel Navigation StoreGateLib xAODCaloEvent AthLinks
    PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} Identifier SGTools TestTools )
 
-#atlas_add_component( CaloUtils src/components/*.cxx
-#   LINK_LIBRARIES CaloUtilsLib )
+atlas_add_component( CaloUtils src/components/*.cxx
+   LINK_LIBRARIES CaloUtilsLib )
 
 atlas_add_dictionary( CaloUtilsDict
    CaloUtils/CaloUtilsDict.h CaloUtils/selection.xml
@@ -50,14 +50,14 @@ atlas_add_test( exceptions_test
    SOURCES test/exceptions_test.cxx
    LINK_LIBRARIES CaloUtilsLib )
 
-#atlas_add_test( CaloTowerStore_test
-#   SCRIPT athena.py CaloUtils/CaloTowerStore_test.py
-#   LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment|MetaReader|AutoConfiguration|IOVDbSvc +INFO"
-#   PROPERTIES TIMEOUT 500 )
+atlas_add_test( CaloTowerStore_test
+   SCRIPT athena.py CaloUtils/CaloTowerStore_test.py
+   LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment|MetaReader|AutoConfiguration|IOVDbSvc +INFO"
+   PROPERTIES TIMEOUT 500 )
 
-#atlas_add_test( ToolWithConstants_test
-#   SCRIPT test/ToolWithConstants_test.py
-#   LOG_IGNORE_PATTERN "no dictionary for|by peeking into|Current filenames:|IOVDbSvc +INFO|Added successfully Conversion|DetDescrCnvSvc +INFO|GeoModelSvc +INFO|IOVSvc +INFO|with default tag|^Py:MetaReader" )
+atlas_add_test( ToolWithConstants_test
+   SCRIPT test/ToolWithConstants_test.py
+   LOG_IGNORE_PATTERN "no dictionary for|by peeking into|Current filenames:|IOVDbSvc +INFO|Added successfully Conversion|DetDescrCnvSvc +INFO|GeoModelSvc +INFO|IOVSvc +INFO|with default tag|^Py:MetaReader" )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.txt share/*.py )
diff --git a/Calorimeter/CaloRec/share/CaloTowerStore_test.ref b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
similarity index 100%
rename from Calorimeter/CaloRec/share/CaloTowerStore_test.ref
rename to Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
diff --git a/Calorimeter/CaloRec/src/CaloTowerStoreTestAlg.cxx b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx
similarity index 100%
rename from Calorimeter/CaloRec/src/CaloTowerStoreTestAlg.cxx
rename to Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx
diff --git a/Calorimeter/CaloRec/src/CaloTowerStoreTestAlg.h b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h
similarity index 100%
rename from Calorimeter/CaloRec/src/CaloTowerStoreTestAlg.h
rename to Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h
diff --git a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
index 305965e83552..3d036c6675ba 100644
--- a/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
+++ b/Calorimeter/CaloUtils/src/components/CaloUtils_entries.cxx
@@ -5,6 +5,6 @@
 
 
 
-//DECLARE_COMPONENT( CaloTowerStoreTestAlg )
-//DECLARE_COMPONENT( CaloUtils::ToolWithConstantsTestTool )
+DECLARE_COMPONENT( CaloTowerStoreTestAlg )
+DECLARE_COMPONENT( CaloUtils::ToolWithConstantsTestTool )
 
-- 
GitLab


From b1ee8242167d9d4651d55f3816b8553283a7e9e7 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Mon, 23 Jan 2023 09:06:13 +0100
Subject: [PATCH 13/13] CaloTopoTowerContainerCnv: remove unnecssary include

---
 .../CaloCnv/CaloAthenaPool/src/CaloTopoTowerContainerCnv.cxx     | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTopoTowerContainerCnv.cxx b/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTopoTowerContainerCnv.cxx
index e8970d9d061a..52c564b7464f 100644
--- a/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTopoTowerContainerCnv.cxx
+++ b/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTopoTowerContainerCnv.cxx
@@ -14,7 +14,6 @@
 
 // Athena
 #include "CaloUtils/CaloTopoTowerBuilderToolBase.h"
-#include "CaloUtils/CaloTopoTowerBuilderTool.h"
 
 
 CaloTopoTowerContainerCnv::CaloTopoTowerContainerCnv(ISvcLocator* svcloc)
-- 
GitLab