From 1476b9dbd3b75a80b589cfe8115d4e4df62de55d Mon Sep 17 00:00:00 2001
From: Thomas Strebler <thomas.strebler@cern.ch>
Date: Mon, 8 Jan 2024 06:55:34 +0100
Subject: [PATCH] Add protection for photons with no layer 1 EM clusters for
 pointing tool

Add protection for photons with no layer 1 EM clusters for pointing tool
---
 Reconstruction/egamma/egammaUtils/Root/egPhotonWrtPoint.cxx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Reconstruction/egamma/egammaUtils/Root/egPhotonWrtPoint.cxx b/Reconstruction/egamma/egammaUtils/Root/egPhotonWrtPoint.cxx
index 22eb6c9668cb..856d554d3710 100644
--- a/Reconstruction/egamma/egammaUtils/Root/egPhotonWrtPoint.cxx
+++ b/Reconstruction/egamma/egammaUtils/Root/egPhotonWrtPoint.cxx
@@ -9,8 +9,9 @@
 
 photonWrtPoint::PtEtaPhi photonWrtPoint::PtEtaPhiWrtZ(const xAOD::Egamma& ph,
                                                       double z) {
-  std::pair<double, float> RZ1 =
-      CP::ShowerDepthTool::getRZ(ph.caloCluster()->etaBE(1), 1);
+  std::pair<double, float> RZ1 = {0., 0.};
+  float etaBE1 = ph.caloCluster()->etaBE(1);
+  if(std::abs(etaBE1) < 10) RZ1 = CP::ShowerDepthTool::getRZ(etaBE1, 1);
 
   double rCalo = RZ1.first;
   double zCalo = RZ1.second;
-- 
GitLab