From 68de676cbbeef92fa6de843f90b32b178307debb Mon Sep 17 00:00:00 2001 From: Filomena Sopkova <filomena.sopkova@cern.ch> Date: Tue, 19 Sep 2017 16:47:53 +0200 Subject: [PATCH] fixing clusters validation job Former-commit-id: 17dd4afcf54d3b2cb7ac9e9fa61fe366dd2ceaf8 --- .../PFODQA/src/PhysValCluster.cxx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.cxx b/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.cxx index 8cba354ff379..86beb93132a2 100644 --- a/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.cxx +++ b/Reconstruction/PFlow/PFlowValidation/PFODQA/src/PhysValCluster.cxx @@ -38,21 +38,24 @@ StatusCode PhysValCluster::fillHistograms(){ const xAOD::CaloClusterContainer* theClusterContainer = NULL; - ATH_CHECK( evtStore()->retrieve(theClusterContainer,m_clusterContainerName) ); + if( evtStore()->contains<xAOD::CaloClusterContainer>(m_clusterContainerName)){ - if (!theClusterContainer){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << " Have NULL pointer to xAOD::PFOContainer " << endmsg; - return StatusCode::SUCCESS; - } + ATH_CHECK( evtStore()->retrieve(theClusterContainer,m_clusterContainerName) ); + + if (!theClusterContainer){ + if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << " Have NULL pointer to xAOD::PFOContainer " << endmsg; + return StatusCode::FAILURE; + } - xAOD::CaloClusterContainer::const_iterator firstCluster = theClusterContainer->begin(); - xAOD::CaloClusterContainer::const_iterator lastCluster = theClusterContainer->end(); + xAOD::CaloClusterContainer::const_iterator firstCluster = theClusterContainer->begin(); + xAOD::CaloClusterContainer::const_iterator lastCluster = theClusterContainer->end(); - for (; firstCluster != lastCluster; ++firstCluster) { - const xAOD::CaloCluster* theCluster = *firstCluster; - m_clusterValidationPlots->fill(*theCluster); + for (; firstCluster != lastCluster; ++firstCluster) { + const xAOD::CaloCluster* theCluster = *firstCluster; + m_clusterValidationPlots->fill(*theCluster); + } } - + else msg(MSG::WARNING) << " Cluster container : " << m_clusterContainerName << " not found" << endmsg; return StatusCode::SUCCESS; } -- GitLab