From 80b27b6489bf7524bee8bc84ae6e00b2a572177f Mon Sep 17 00:00:00 2001
From: James Richard Catmore <james.catmore@cern.ch>
Date: Tue, 20 Jun 2017 17:11:07 +0200
Subject: [PATCH] Make AOD CaloCluster and particle flow object thinning robust
 against missing containers ATR-16565 This MR modifies the tools for negative
 energy calo cluster and PFO container thinning to such that, if the container
 to be thinned is missing, the job returns STATUSCODE::SUCCESS rather than
 FAILURE, as well as printing a message.

Former-commit-id: db8111ba0cb27eff44db0a5bfb91393d8ebae42c
---
 .../ThinningUtils/src/ThinNegativeEnergyCaloClustersAlg.cxx | 6 +++---
 .../ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.cxx  | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyCaloClustersAlg.cxx b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyCaloClustersAlg.cxx
index 5ad00f5b072..db10655b482 100644
--- a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyCaloClustersAlg.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyCaloClustersAlg.cxx
@@ -100,7 +100,7 @@ StatusCode ThinNegativeEnergyCaloClustersAlg::execute()
     // Increase the event counter
     ++m_nEventsProcessed;
     
-    // Is truth thinning required?
+    // Is thinning required?
     if (!m_doThinning) {
         return StatusCode::SUCCESS;
     } 
@@ -110,8 +110,8 @@ StatusCode ThinNegativeEnergyCaloClustersAlg::execute()
     if (evtStore()->contains<xAOD::CaloClusterContainer>(m_caloClustersKey)) {
         CHECK( evtStore()->retrieve( caloClusters , m_caloClustersKey ) );
     } else {
-        ATH_MSG_FATAL("No CaloClusterContainer with key "+m_caloClustersKey+" found.");
-        return StatusCode::FAILURE;
+        ATH_MSG_INFO("No CaloClusterContainer with key "+m_caloClustersKey+" found. Thinning cannot be applied for this container");
+        return StatusCode::SUCCESS;
     }
 
     // Set up masks
diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.cxx b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.cxx
index c09f4f53973..a80e1fc2c2c 100644
--- a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.cxx
@@ -111,8 +111,8 @@ StatusCode ThinNegativeEnergyNeutralPFOsAlg::execute()
     if (evtStore()->contains<xAOD::PFOContainer>(m_neutralPFOsKey)) {
         CHECK( evtStore()->retrieve( neutralPFOs , m_neutralPFOsKey ) );
     } else {
-        ATH_MSG_FATAL("No PFOContainer with key "+m_neutralPFOsKey+" found.");
-        return StatusCode::FAILURE;
+        ATH_MSG_INFO("No PFOContainer with key "+m_neutralPFOsKey+" found. Thinning cannot be applied to this container");
+        return StatusCode::SUCCESS;
     }
 
     // Set up masks
-- 
GitLab