diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterUpdate.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterUpdate.cxx
index 0c8ea2299cbe8d173b41fbf8e8bb84df163dddcd..c079a6da5652bcef1dfc5aa429489e5bdf770b5e 100755
--- a/Calorimeter/CaloClusterCorrection/src/CaloClusterUpdate.cxx
+++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterUpdate.cxx
@@ -50,26 +50,22 @@ void CaloClusterUpdate::makeCorrection (const Context& myctx,
 {
   float energy=0; 
   float eta=0; 
-  float phi2=0; 
-  float weta=0; 
-  float wphi=0; 
-  // set eta to be weighted average of eta1 and eta2 
- 
-  ATH_MSG_DEBUG(" inBarrel "<<cluster->inBarrel() << " inEndcap "<<cluster->inEndcap() << endmsg) ;
+  float weta=0;
+
+  // set eta to be weighted average of eta1 and eta2
+  ATH_MSG_DEBUG(" inBarrel "<<cluster->inBarrel()
+		<< " inEndcap "<<cluster->inEndcap()) ;
 
   for(int i=0; i<5; i=i+4 )
   { 
   
-   if(i==0 && ! cluster->inBarrel() ) continue; 
-   if(i==4 && ! cluster->inEndcap() ) continue; 
+   if (i==0 && !cluster->inBarrel()) continue;
+   if (i==4 && !cluster->inEndcap()) continue;
 
    CaloSampling::CaloSample sam0 = (CaloSampling::CaloSample)(CaloSampling::PreSamplerB+i);   
    CaloSampling::CaloSample sam1 = (CaloSampling::CaloSample)(CaloSampling::PreSamplerB+i+1);   
    CaloSampling::CaloSample sam2 = (CaloSampling::CaloSample)(CaloSampling::PreSamplerB+i+2);   
    CaloSampling::CaloSample sam3 = (CaloSampling::CaloSample)(CaloSampling::PreSamplerB+i+3);
-
-   float eta1 = cluster->etaSample(sam1);
-   float eta2 = cluster->etaSample(sam2);
    
    float e0 = cluster->eSample(sam0);
    float e1 = cluster->eSample(sam1);
@@ -77,81 +73,67 @@ void CaloClusterUpdate::makeCorrection (const Context& myctx,
    float e3 = cluster->eSample(sam3);
 
    // total energy is the sum of each sampling, which had all corrections
-   energy += (e0 + e1 + e2 + e3) ; 
+   energy += (e0 + e1 + e2 + e3);
 
-   if (eta2 == -999.) continue;
+   // do not consider including in the average if both energies are negative
+   if (e1 <= 0 && e2 <= 0) continue;
 
-   // eta1 has better resolution.  so weight it differently. 
-   float w1 = e1*3. ; 
-   float w2 = e2    ; 
+   // reject weird clusters. Not even sure it can ever happen
+   float eta2 = cluster->etaSample(sam2);
+   if (cluster->hasSampling(sam2) && eta2 == -999.) continue;
 
-   if (e1 <= 0 && e2 <= 0) {
-     eta1 = cluster->eta0();
-     w1 = std::abs(energy);
-     w2 = 0;
-   }
-   else if (e1 <= 0) {
+   float eta1 = cluster->etaSample(sam1);
+   if (cluster->hasSampling(sam1) && eta1 == -999.) continue;
+
+   // eta1 has better resolution, so weight it differently
+   float w1 = e1*m_w1;
+   float w2 = e2;
+
+   // do not include layer if energy is negative
+   if (e1 <= 0) {
      w1 = 0;
    }
    else if (e2 <= 0) {
      w2 = 0;
    }
 
-   eta   += (eta1*w1+eta2*w2) ;
-   weta  += w1+w2; 
-
-   // phi2 for phi. 
-   if(wphi!=0) { 
-    float phi_old = phi2/wphi; 
-    float phi_new = cluster->phiSample(sam2); 
-    phi_new = proxim ( phi_new,phi_old ); 
-    phi2 += e2*phi_new; 
-    wphi += e2; 
-   } 
-   else {
-    phi2 += e2*cluster->phiSample(sam2); 
-    wphi += e2;     
-   }
-  // do some checks for unphysical cluster
-   if (cluster->phiSample(sam2) == -999.) phi2 = -999.;
-   if (cluster->etaSample(sam2) == -999. ||
-       cluster->etaSample(sam1) == -999.) eta  = -999.;
+   eta  += (eta1*w1+eta2*w2) ;
+   weta += w1+w2; 
   }
 
   //
   // set them in the cluster. 
   //
-
   if (eta  != -999. && weta != 0)
     eta  = eta/weta; 
   else {
-      if (cluster->inBarrel() && ! cluster->inEndcap()) eta = cluster->etaSample(CaloSampling::EMB2);      
-      else if (cluster->inEndcap() && !cluster->inBarrel()) eta = cluster->etaSample(CaloSampling::EME2);      
-      else {
-        if (cluster->eSample(CaloSampling::EMB2) > cluster->eSample(CaloSampling::EME2))  eta = cluster->etaSample(CaloSampling::EMB2);
-        else eta = cluster->etaSample(CaloSampling::EME2);
-      }
-  }
-
-  if (phi2 != -999. && wphi != 0) {
-    phi2 = phi2/wphi ; 
-    phi2 = CaloPhiRange::fix (phi2);
-  }
-  else {
-      if (cluster->inBarrel() && ! cluster->inEndcap()) phi2 = cluster->phiSample(CaloSampling::EMB2);      
-      else if (cluster->inEndcap() && !cluster->inBarrel()) phi2 = cluster->phiSample(CaloSampling::EME2);      
-      else {  
-        if (cluster->eSample(CaloSampling::EMB2) > cluster->eSample(CaloSampling::EME2))  phi2 = cluster->phiSample(CaloSampling::EMB2);
-        else phi2 = cluster->phiSample(CaloSampling::EME2);
-      }
-
+    ATH_MSG_DEBUG("Weird cluster "
+		  " EB1 = " << cluster->eSample(CaloSampling::EMB1)
+		  << " etaB1 = " << cluster->etaSample(CaloSampling::EMB1)
+		  << " EE1 = " << cluster->eSample(CaloSampling::EME1)
+		  << " etaE1 = " << cluster->etaSample(CaloSampling::EME1)
+		  << " EB2 = " << cluster->eSample(CaloSampling::EMB2)
+		  << " etaB2 = " << cluster->etaSample(CaloSampling::EMB2)
+		  << " EE2 = " << cluster->eSample(CaloSampling::EME2)
+		  << " etaE2 = " << cluster->etaSample(CaloSampling::EME2));
+    if (cluster->inBarrel() && !cluster->inEndcap())
+      eta = cluster->etaSample(CaloSampling::EMB2);
+    else if (cluster->inEndcap() && !cluster->inBarrel())
+      eta = cluster->etaSample(CaloSampling::EME2);
+    else {
+      if (cluster->eSample(CaloSampling::EMB2) >
+	  cluster->eSample(CaloSampling::EME2))
+	eta = cluster->etaSample(CaloSampling::EMB2);
+      else
+	eta = cluster->etaSample(CaloSampling::EME2);
+    }
   }
 
-  cluster->setEta(eta); 
-  cluster->setPhi(phi2); 
+  cluster->setEta(eta);
+  cluster->setPhi(cluster->phiBE(2));
 
   if (m_update_energy (myctx))
-    cluster->setE(energy); 
+    cluster->setE(energy);
 }
 
 
diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterUpdate.h b/Calorimeter/CaloClusterCorrection/src/CaloClusterUpdate.h
index ae1a5d5614cadd874dbea9fffe64e8fcd9a7c73a..ef8e9263d0de1fdd5ed6d7b7949fb30df586e3d8 100755
--- a/Calorimeter/CaloClusterCorrection/src/CaloClusterUpdate.h
+++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterUpdate.h
@@ -56,9 +56,13 @@ class CaloClusterUpdate : public CaloClusterCorrection
 
  private:
 
+  // Weight more layer 1 in eta average
+  Gaudi::Property<float> m_w1
+    { this, "layer1_weight", 3, "layer 1 additional weight in eta average" };
+
   // If true, the total cluster energy is set to the sum of all layer energies.
   Constant<bool> m_update_energy
-  { this, "update_energy", "Should cluster total energy be updated?" };
+    { this, "update_energy", "Should cluster total energy be updated?" };
 };
 
 
diff --git a/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx b/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx
index 0b1edc4003b8d5a39605e10311aab2f845cc2142..d664e2aafee46f0afd49c2fc8a020c96a942c768 100644
--- a/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx
+++ b/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx
@@ -657,7 +657,12 @@ namespace xAOD {
        float eSum=eBarrel + eEndcap;
        if (eSum > 100 /*MeV*/) {
 	 //E-weighted average ...
-         return (eBarrel * etaBarrel + eEndcap * etaEndcap) / (eBarrel + eEndcap);
+	 if ((eBarrel > 0 && eEndcap > 0) || (eBarrel < 0 && eEndcap < 0))
+	   return (eBarrel * etaBarrel + eEndcap * etaEndcap) / eSum;
+	 else if (eBarrel > 0)
+	   return etaBarrel;
+	 else
+	   return etaEndcap;
        }//else eSum==0 case, should never happen
        return (0.5 * (etaBarrel + etaEndcap));
     }
@@ -686,8 +691,13 @@ namespace xAOD {
        float phiBarrel=phiSample(barrelSample);
        float phiEndcap=phiSample(endcapSample);
        if (eSum != 0.0) {
-         float phiSum = eSum * phiBarrel + eEndcap * CaloPhiRange::diff(phiEndcap, phiBarrel);
-         return CaloPhiRange::fix(phiSum / (eBarrel + eEndcap));
+	 if ((eBarrel > 0 && eEndcap > 0) || (eBarrel < 0 && eEndcap < 0)) {
+	   float phiSum = eSum * phiBarrel + eEndcap * CaloPhiRange::diff(phiEndcap, phiBarrel);
+	   return CaloPhiRange::fix(phiSum / eSum);
+	 } else if (eBarrel > 0)
+	   return phiBarrel;
+	 else
+	   return phiEndcap;
        }
        // energy==0 case, should never happen
        return CaloPhiRange::fix(0.5 * (phiBarrel + phiEndcap));
diff --git a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/ShowerDepthTool.h b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/ShowerDepthTool.h
index 127b36c59672b7611ff043c60f43e5e1349c3b5c..ff534584b610a3abeddebf5da8410809a0d2e0fc 100644
--- a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/ShowerDepthTool.h
+++ b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/IsolationCorrections/ShowerDepthTool.h
@@ -1,13 +1,14 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef ELECTRONISOLATIONSELECTION_SHOWERDEPTHTOOL_H
 #define ELECTRONISOLATIONSELECTION_SHOWERDEPTHTOOL_H
 
-// ROOT include(s):
-#include <TString.h>
+// System include(s).
+#include <memory>
 #include <optional>
+#include <utility>
 
 // Forward declaration(s):
 class TH1;
@@ -16,52 +17,47 @@ namespace CP {
 
   class ShowerDepthTool{
   public :
-    ShowerDepthTool(); 
-    ~ShowerDepthTool(); 
+    ShowerDepthTool();
+    ~ShowerDepthTool();
     /// Function initialising the tool
-    bool initialize();      
-      
+    bool initialize();
+
     /** Shower depth (in mm) on EM1 vs. eta, considering misalignments **/
-    float getCorrectedShowerDepthEM1(const float& etas1,const float& phi,const bool& isData = true) const;
+    float getCorrectedShowerDepthEM1(float etas1, float phi, bool isData = true) const;
 
     /** Shower depth (in mm) on EM2 vs. eta, considering misalignments **/
-    float getCorrectedShowerDepthEM2(const float& etas2,const float& phi,const bool& isData = true) const;
+    float getCorrectedShowerDepthEM2(float etas2, float phi, bool isData = true) const;
 
     /** Return the shower depth in R,Z considering misalignments **/
-    std::pair<float, float> getCorrectedRZ(const float& eta,const float& phi,const bool& isData = true,const int& sampling = 1) const;
-      
+    std::pair<float, float> getCorrectedRZ(float eta, float phi, bool isData = true, int sampling = 1) const;
+
     /** Return the calorimeter displacement in R(Z) for barrel (endcap) **/
-    float getRZCorrection(const float& eta,const float& phi,const bool& isData = true) const;     
-      
+    float getRZCorrection(float eta, float phi, bool isData = true) const;
+
     /** Eta direction from zvertex to the shower in the given sampling **/
-    float getCorrectedEtaDirection(const float& zvertex,const float& eta,const float& phi,const bool& isData=true,const int& sampling = 1) const;
-      
+    float getCorrectedEtaDirection(float zvertex, float eta, float phi, bool isData=true, int sampling = 1) const;
+
     /** Eta direction from samplings 1 and 2 (pointing) **/
-    std::optional<float> getCaloPointingEta(const float& etas1,const float& etas2,const float& phi,const bool& isData=true) const;
+    std::optional<float> getCaloPointingEta(float etas1, float etas2, float phi, bool isData=true) const;
 
     /** Shower depth (in mm) vs. eta on EM1 **/
-    static float getShowerDepthEM1(const float& etas1) ;
-      
+    static float getShowerDepthEM1(float etas1);
+
     /** Shower depth (in mm) vs. eta on EM2 **/
-    static float getShowerDepthEM2(const float& etas2) ;
+    static float getShowerDepthEM2(float etas2);
 
     /** Shower depth in R,Z for the given sampling **/
-    static std::pair<float, float> getRZ(const float& eta,const int& sampling) ;
+    static std::pair<float, float> getRZ(float eta, int sampling);
 
-    static float getEtaDirection(const float& zvertex,const float& R,const float& z) ;
-      
-      
-  protected:
+    static float getEtaDirection(float zvertex, float R, float z);
 
-    /** Return TH1* from file given fileName, histoName **/
-    static TH1* getHistoFromFile(const TString& fileName,const TString& histoName);      
-      
   private:
-    TH1 *m_hData;
-    TH1 *m_hMC;    
-    std::string m_configFileName;
-    TString m_dataHistoName;
-    TString m_mcHistoName;
+
+    /** Return TH1* from file given fileName, histoName **/
+    static std::unique_ptr<TH1> getHistoFromFile(const char* fileName, const char* histoName);
+
+    std::unique_ptr<TH1> m_hData;
+    std::unique_ptr<TH1> m_hMC;
   };
 
 } // namespace CP
diff --git a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx
index 31240ab692bbfac587b547c436590c63db8d6941..645b7be0bea7d4b3fd13b066ef201c7caa59ac91 100644
--- a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx
@@ -21,6 +21,7 @@
 
 #include <typeinfo>
 #include <utility>
+#include <cmath>
 
 
 namespace{
@@ -130,7 +131,7 @@ namespace CP {
     if(part_type == IsolationCorrection::ELECTRON && fabs(etaS2) > 2.47) return 0.;
     
     if(fabs(etaS1) > 2.5) return 0.;
-    if(fabs(phiCluster) > 3.2) return 0.;
+    if(fabs(phiCluster) > float(M_PI)) return 0.;
 
     if (part_type == IsolationCorrection::ELECTRON && energy > 15e3)
       ATH_MSG_VERBOSE("Electron ? " << (part_type == IsolationCorrection::ELECTRON) << " Input E = " << input.caloCluster()->e() << " E used " << energy << " author = " << input.author() << " pT = " << input.pt() << " phi = " << input.phi());
diff --git a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/ShowerDepthTool.cxx b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/ShowerDepthTool.cxx
index 4d630353f972d545794f46d9795133a835d74e4d..47fe0346a743c9e01ae45da2e3f342f3c778e9d7 100644
--- a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/ShowerDepthTool.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/ShowerDepthTool.cxx
@@ -2,69 +2,62 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
+// Local include(s).
 #include "IsolationCorrections/ShowerDepthTool.h"
 
+// Project include(s).
+#include "AsgMessaging/MessageCheck.h"
+#include "PathResolver/PathResolver.h"
+
+// ROOT include(s).
 #include <TFile.h>
 #include <TH1.h>
-#include <TSystem.h>
 
+// System include(s).
 #include <cmath>
 
-#include <cmath>
-#include <cstdlib>
 #include <string>
 
+namespace CP{
 
-#include <map>
-#include <memory>
+  // Calibration file / histogram name(s).
+  static const char* const CONFIG_FILE_NAME = "ElectronIsolationSelection/v1/CaloDeltaRZ.root";
+  static const char* const DATA_HISTO_NAME = "hData";
+  static const char* const MC_HISTO_NAME = "hMC";
 
-#include "PathResolver/PathResolver.h"
+  // Make the messaging functions available.
+  ANA_MSG_SOURCE(ShowerDepthToolMessaging, "CP::ShowerDepthTool");
+  using namespace ShowerDepthToolMessaging;
 
-using std::make_pair;
+  ShowerDepthTool::ShowerDepthTool() {}
 
-namespace CP{
+  ShowerDepthTool::~ShowerDepthTool() {}
 
-  ShowerDepthTool::ShowerDepthTool() : 
-    m_hData(nullptr),
-    m_hMC(nullptr),
-    m_configFileName("ElectronIsolationSelection/v1/CaloDeltaRZ.root"),
-    m_dataHistoName("hData"),
-    m_mcHistoName("hMC")
-  {          
-  }
+  bool ShowerDepthTool::initialize()
+  {
+    const std::string filename = PathResolverFindCalibFile( CONFIG_FILE_NAME );
 
-  ShowerDepthTool::~ShowerDepthTool() {
-    delete m_hData;
-    delete m_hMC;
+    m_hData = getHistoFromFile( filename.c_str(), DATA_HISTO_NAME );
+    m_hMC = getHistoFromFile( filename.c_str(), MC_HISTO_NAME );
+
+    return (m_hData && m_hMC);
   }
-      
-  bool ShowerDepthTool::initialize() 
-  {   
-    std::string filename = PathResolverFindCalibFile( m_configFileName );
-       
-    TString Tfilename( filename );    
-
-    m_hData = getHistoFromFile( Tfilename , m_dataHistoName );
-    m_hMC = getHistoFromFile( Tfilename , m_mcHistoName );   
-    
-    return !(m_hData == nullptr || m_hMC == nullptr);
-  }      
-   
+
   /** Shower depth (in mm) on EM1 vs. eta, considering misalignments **/
-  float ShowerDepthTool::getCorrectedShowerDepthEM1(const float& etas1,const float& phi,const bool& isData) const
+  float ShowerDepthTool::getCorrectedShowerDepthEM1(float etas1, float phi, bool isData) const
   {
-    return getShowerDepthEM1(etas1) - getRZCorrection(etas1, phi, isData); 
+    return getShowerDepthEM1(etas1) - getRZCorrection(etas1, phi, isData);
   }
 
   /** Shower depth (in mm) on EM2 vs. eta, considering misalignments **/
-  float ShowerDepthTool::getCorrectedShowerDepthEM2(const float& etas2,const float& phi,const bool& isData) const
+  float ShowerDepthTool::getCorrectedShowerDepthEM2(float etas2, float phi, bool isData) const
   {
-    return getShowerDepthEM2(etas2) - getRZCorrection(etas2, phi, isData); 
+    return getShowerDepthEM2(etas2) - getRZCorrection(etas2, phi, isData);
   }
 
   /** Return the shower depth on sampling 1 given etas1. From:
   https://svnweb.cern.ch/trac/atlasoff/browser/Calorimeter/CaloDetDescr/trunk/src/CaloDepthTool.cxx#L347 **/
-  float ShowerDepthTool::getShowerDepthEM1(const float& etas1) 
+  float ShowerDepthTool::getShowerDepthEM1(float etas1)
   {
     float radius, aetas1 = std::fabs(etas1);
     if (aetas1 < 0.8)
@@ -80,7 +73,7 @@ namespace CP{
 
   /** Return the shower depth on sampling 2 given etas2. From:
   https://svnweb.cern.ch/trac/atlasoff/browser/Calorimeter/CaloDetDescr/trunk/src/CaloDepthTool.cxx#L347 **/
-  float ShowerDepthTool::getShowerDepthEM2(const float& etas2) 
+  float ShowerDepthTool::getShowerDepthEM2(float etas2)
   {
     float radius, aetas2 = std::fabs(etas2);
     if (aetas2 < 1.425) // Barrel, my definition
@@ -95,21 +88,21 @@ namespace CP{
   }
 
 
-  float ShowerDepthTool::getCorrectedEtaDirection(const float& zvertex, 
-                                                  const float& eta,
-                                                  const float& phi, 
-                                                  const bool& isData,
-                                                  const int& sampling) const 
+  float ShowerDepthTool::getCorrectedEtaDirection(float zvertex,
+                                                  float eta,
+                                                  float phi,
+                                                  bool isData,
+                                                  int sampling) const
   {
     std::pair<float, float> RZ = getCorrectedRZ(eta, phi, isData, sampling);
     return getEtaDirection(zvertex, RZ.first, RZ.second);
   }
 
-  std::pair<float,float> ShowerDepthTool::getRZ(const float& eta,const int& sampling) 
+  std::pair<float,float> ShowerDepthTool::getRZ(float eta, int sampling)
   {
     if ((sampling != 1 && sampling != 2) || (std::fabs(eta)>10))
     {
-//       ATH_MSG_INFO( "Invalid sampling: " << sampling );
+      ANA_MSG_LVL_SERIOUS(MSG::WARNING, "Invalid sampling, eta: " << sampling << ", " << eta);
       return std::make_pair(0., 0.);
     }
     float depth = (sampling == 1 ? getShowerDepthEM1(eta) : getShowerDepthEM2(eta) );
@@ -119,7 +112,7 @@ namespace CP{
   }
 
 
-  std::optional<float> ShowerDepthTool::getCaloPointingEta(const float& etas1,const float& etas2,const float& phi,const bool& isData) const
+  std::optional<float> ShowerDepthTool::getCaloPointingEta(float etas1, float etas2, float phi, bool isData) const
   {
     std::pair<float, float> RZ1 = getCorrectedRZ(etas1, phi, isData, 1);
     std::pair<float, float> RZ2 = getCorrectedRZ(etas2, phi, isData, 2);
@@ -132,15 +125,14 @@ namespace CP{
   }
 
 
-
-  std::pair<float, float> ShowerDepthTool::getCorrectedRZ(const float& eta, 
-                                                          const float& phi,
-                                                          const bool& isData,
-                                                          const int& sampling) const 
+  std::pair<float, float> ShowerDepthTool::getCorrectedRZ(float eta,
+                                                          float phi,
+                                                          bool isData,
+                                                          int sampling) const
   {
     if ((sampling != 1 && sampling != 2) || (std::fabs(eta)>10))
     {
-//       ATH_MSG_INFO( "Invalid sampling: " << sampling );
+      ANA_MSG_LVL_SERIOUS(MSG::WARNING, "Invalid sampling, eta: " << sampling << ", " << eta);
       return std::make_pair(0., 0.);
     }
     float depth = (sampling == 1 ? getCorrectedShowerDepthEM1(eta, phi, isData) :
@@ -152,35 +144,72 @@ namespace CP{
 
 
   /** Return the calorimeter displacement in R(Z) for barrel (endcap) **/
-  float ShowerDepthTool::getRZCorrection(const float& eta,const float& phi,const bool& isData) const
+  float ShowerDepthTool::getRZCorrection(float eta, float phi, bool isData) const
   {
-    TH1* histo = (isData ? m_hData : m_hMC);
-    if (!histo)
+    // Get the correct histogram.
+    const TH1* histo = (isData ? m_hData.get() : m_hMC.get());
+    if (!histo) {
       return 0;
+    }
+    // Make sure that we can perform the interpolation in both eta and phi.
+    // Note that std::numeric_limits<float>::epsilon() is just not large enough
+    // for the following. :-(
+    static constexpr float epsilon = 1e-6f;
+    const Int_t etaBin = histo->GetXaxis()->FindFixBin(eta);
+    if (etaBin < 1) {
+      const float etaOld = eta;
+      eta = histo->GetXaxis()->GetBinLowEdge(1) + epsilon;
+      ANA_MSG_LVL_SERIOUS(MSG::WARNING, "Using eta " << eta << " instead of "
+                          << etaOld);
+    }
+    else if (etaBin > histo->GetNbinsX()) {
+      const float etaOld = eta;
+      eta = histo->GetXaxis()->GetBinUpEdge(histo->GetNbinsX()) - epsilon;
+      ANA_MSG_LVL_SERIOUS(MSG::WARNING, "Using eta " << eta << " instead of "
+                          << etaOld);
+    }
+    const Int_t phiBin = histo->GetYaxis()->FindFixBin(phi);
+    if (phiBin < 1) {
+      const float phiOld = phi;
+      phi = histo->GetYaxis()->GetBinLowEdge(1) + epsilon;
+      ANA_MSG_LVL_SERIOUS(MSG::WARNING, "Using phi " << phi << " instead of "
+                          << phiOld);
+    }
+    else if (phiBin > histo->GetNbinsY()) {
+      const float phiOld = phi;
+      phi = histo->GetYaxis()->GetBinUpEdge(histo->GetNbinsY()) - epsilon;
+      ANA_MSG_LVL_SERIOUS(MSG::WARNING, "Using phi " << phi << " instead of "
+                          << phiOld);
+    }
+    // Get the correction as an interpolation.
     return histo->Interpolate(eta, phi);
   }
-  
-  float ShowerDepthTool::getEtaDirection(const float& zvertex,const float& R,const float& z) 
+
+
+  float ShowerDepthTool::getEtaDirection(float zvertex, float R, float z)
   {
     return std::asinh( (z- zvertex)/R );
-  }  
+  }
 
 
-  TH1* ShowerDepthTool::getHistoFromFile(const TString& fileName,const TString& histoName)
+  std::unique_ptr<TH1> ShowerDepthTool::getHistoFromFile(const char* fileName, const char* histoName)
   {
-    std::unique_ptr<TFile> f(TFile::Open(fileName));
+    std::unique_ptr<TFile> f(TFile::Open(fileName, "READ"));
     if (!f){
-      return nullptr;
+      ANA_MSG_LVL_SERIOUS(MSG::WARNING,
+                          "Could not open file: \"" << fileName << "\"");
+      return {};
     }
     TH1 *h = dynamic_cast<TH1*>( f->Get(histoName) );
     if (!h){
-      f->Close();
-      return nullptr;
+      ANA_MSG_LVL_SERIOUS(MSG::WARNING,
+                          "Could not get histogram: \"" << histoName
+                          << "\" from file: \"" << fileName << "\"");
+      return {};
     }
     //The file we be deleted so use SetDirectory
     h->SetDirectory(nullptr);
-    f->Close();
-    return h;
+    return std::unique_ptr<TH1>(h);
   }
 
 } // namespace CP
diff --git a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonVertexHelpers.cxx b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonVertexHelpers.cxx
index d51d6eb6c21c55fdc33a65d1006bb76adb8c57d2..588f3a0bc718f765681117400398f0d029090da9 100644
--- a/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonVertexHelpers.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection/Root/PhotonVertexHelpers.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
 */
 
 // Local includes
@@ -15,6 +15,9 @@
 // Asg tools
 #include "IsolationCorrections/ShowerDepthTool.h"
 
+// ROOT include(s).
+#include <TString.h>
+
 namespace xAOD {
 namespace PVHelpers {
 
@@ -51,7 +54,7 @@ getZCommonAndError(const xAOD::EventInfo* eventInfo,
   // Beam position is the base for zCommon weighted average
   double beamPosZ = eventInfo->beamPosZ();
   double beamPosSigmaZ = eventInfo->beamPosSigmaZ();
-  
+
   if( beamPosSigmaZ == 0 )
     beamPosSigmaZ = 10;
 
diff --git a/Projects/AthDataQuality/version.txt b/Projects/AthDataQuality/version.txt
index 8558a65069f08ed967fd519850fb5fe5b5789016..5579e6f1a4e8f5b283fcb6704201ac5d8fcb1e7a 100644
--- a/Projects/AthDataQuality/version.txt
+++ b/Projects/AthDataQuality/version.txt
@@ -1 +1 @@
-23.0.20.1
+23.0.20.2
diff --git a/Projects/AthSimulation/version.txt b/Projects/AthSimulation/version.txt
index 8558a65069f08ed967fd519850fb5fe5b5789016..5579e6f1a4e8f5b283fcb6704201ac5d8fcb1e7a 100644
--- a/Projects/AthSimulation/version.txt
+++ b/Projects/AthSimulation/version.txt
@@ -1 +1 @@
-23.0.20.1
+23.0.20.2
diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt
index 8558a65069f08ed967fd519850fb5fe5b5789016..5579e6f1a4e8f5b283fcb6704201ac5d8fcb1e7a 100644
--- a/Projects/Athena/version.txt
+++ b/Projects/Athena/version.txt
@@ -1 +1 @@
-23.0.20.1
+23.0.20.2
diff --git a/Projects/DetCommon/version.txt b/Projects/DetCommon/version.txt
index 8558a65069f08ed967fd519850fb5fe5b5789016..5579e6f1a4e8f5b283fcb6704201ac5d8fcb1e7a 100644
--- a/Projects/DetCommon/version.txt
+++ b/Projects/DetCommon/version.txt
@@ -1 +1 @@
-23.0.20.1
+23.0.20.2
diff --git a/Projects/VP1Light/version.txt b/Projects/VP1Light/version.txt
index 8558a65069f08ed967fd519850fb5fe5b5789016..5579e6f1a4e8f5b283fcb6704201ac5d8fcb1e7a 100644
--- a/Projects/VP1Light/version.txt
+++ b/Projects/VP1Light/version.txt
@@ -1 +1 @@
-23.0.20.1
+23.0.20.2
diff --git a/Tools/WorkflowTestRunner/python/References.py b/Tools/WorkflowTestRunner/python/References.py
index 5554c80f84dd45fce843f7cab18df7797f3eeab0..c8398d972faad734959d71320afbfd57136035bf 100644
--- a/Tools/WorkflowTestRunner/python/References.py
+++ b/Tools/WorkflowTestRunner/python/References.py
@@ -11,19 +11,19 @@
 # Format is "test" : "version"
 references_map = {
     # Simulation
-    "s3761": "v12",
-    "s3779": "v8",
-    "s4005": "v8",
-    "s4006": "v12",
-    "s4007": "v12",
-    "s4008": "v4",
+    "s3761": "v1",
+    "s3779": "v1",
+    "s4005": "v1",
+    "s4006": "v1",
+    "s4007": "v1",
+    "s4008": "v1",
     # Overlay
-    "d1590": "v15",
-    "d1726": "v11",
-    "d1759": "v23",
-
-    "q442": "v15",
-    "q443": "v15",
-    "q445": "v21",
-    "q449": "v26",
+    "d1590": "v1",
+    "d1726": "v1",
+    "d1759": "v1",
+    # Reco
+    "q442": "v4",
+    "q443": "v3",
+    "q445": "v3",
+    "q449": "v3",
 }