From 268386d962d2f7ed67d69da63c7ef2d28499293b Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 10 Mar 2020 10:15:30 +0100
Subject: [PATCH] LArCalib: Fix unchecked StatusCodes

---
 .../src/LArBadChannelHunter.cxx               |  4 +--
 .../LArCalibTools/LArReadParamsFromFile.h     | 28 +++++++++----------
 .../LArCalibTools/LArReadParamsFromFile.icc   |  4 +--
 .../src/LArMphysOverMcalFromTuple.cxx         |  4 +--
 .../LArOFCBin_PhysCaliTdiffFromStdNtuple.cxx  | 10 +++----
 .../src/LArParamsFromStdNtuple.cxx            | 10 +++----
 .../src/LArPhysWaveFromStdNtuple.cxx          |  6 ++--
 .../src/LArPhysWaveFromTuple.cxx              |  6 ++--
 .../src/LArCaliWaveBuilderXtalk.cxx           |  6 ++--
 .../LArCalibUtils/src/LArCaliWaveMerger.cxx   |  6 ++--
 .../src/LArDigitOscillationCorrTool.cxx       |  4 +--
 LArCalorimeter/LArCalibUtils/src/LArFill.cxx  |  9 +++---
 .../LArCalibUtils/src/LArPedestalBuilder.cxx  |  9 ++----
 .../LArCalibUtils/src/LArRampCorr.cxx         |  4 +--
 14 files changed, 55 insertions(+), 55 deletions(-)

diff --git a/LArCalorimeter/LArCalibDataQuality/src/LArBadChannelHunter.cxx b/LArCalorimeter/LArCalibDataQuality/src/LArBadChannelHunter.cxx
index 5dc971156fe1..c75a6a05ec54 100644
--- a/LArCalorimeter/LArCalibDataQuality/src/LArBadChannelHunter.cxx
+++ b/LArCalorimeter/LArCalibDataQuality/src/LArBadChannelHunter.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibDataQuality/LArBadChannelHunter.h"
@@ -127,7 +127,7 @@ StatusCode LArBadChannelHunter::stop() {
   if (m_undoCorr) {
     LArCaliWaveContainer* caliwavecomplete= const_cast<LArCaliWaveContainer*>(caliwave);
     ATH_MSG_INFO ( "Undo caliwave corrections now." ) ;
-    caliwavecomplete->undoCorrections();
+    ATH_CHECK( caliwavecomplete->undoCorrections() );
   }
 
   SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey};
diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.h
index 72c356d4c674..9ec9f932c3a4 100644
--- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.h
+++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.h
@@ -1,7 +1,7 @@
 //Dear emacs, this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -128,19 +128,19 @@ class LArReadParamsFromFile : public AthAlgorithm
   // define symLink for all classes
   //--------------------------------
 
-  void do_symLink(const LArCaliPulseParamsComplete* data) { detStore()->symLink(data,(ILArCaliPulseParams*)data) ; } ;
-  void do_symLink(const LArDetCellParamsComplete* data)   { detStore()->symLink(data,(ILArDetCellParams*)data)   ; } ;
-  void do_symLink(const LArPhysCaliTdiffComplete* data)   { detStore()->symLink(data,(ILArPhysCaliTdiff*)data)   ; } ;
-  void do_symLink(const LArTdriftComplete* data)          { detStore()->symLink(data,(ILArTdrift*)data)          ; } ;
-  void do_symLink(const LArMphysOverMcalComplete* data)   { detStore()->symLink(data,(ILArMphysOverMcal*)data)   ; } ;
-  void do_symLink(const LArRinjComplete* data)            { detStore()->symLink(data,(ILArRinj*)data)            ; } ;
-  void do_symLink(const LArTshaperComplete* data)         { detStore()->symLink(data,(ILArTshaper*)data)         ; } ;
-  void do_symLink(const LArEMEC_CphiComplete* data)       { detStore()->symLink(data,(ILArEMEC_Cphi*)data)       ; } ;
-  void do_symLink(const LArEMEC_HValphaComplete* data)    { detStore()->symLink(data,(ILArEMEC_HValpha*)data)    ; } ;
-  void do_symLink(const LArEMEC_HVbetaComplete* data)     { detStore()->symLink(data,(ILArEMEC_HVbeta*)data)     ; } ;
-  void do_symLink(const LArCableLengthComplete* data)     { detStore()->symLink(data,(ILArCableLength*)data)     ; } ;
-  void do_symLink(const LArCableAttenuationComplete* data){ detStore()->symLink(data,(ILArCableAttenuation*)data); } ;
-//  void do_symLink(const LArCaliPulseParamsVsCalib* data)  { detStore()->symLink(data,(ILArCaliPulseParams*)data) ; } ;
+  StatusCode do_symLink(const LArCaliPulseParamsComplete* data) { return detStore()->symLink(data,(ILArCaliPulseParams*)data).ignore() ; } ;
+  StatusCode do_symLink(const LArDetCellParamsComplete* data)   { return detStore()->symLink(data,(ILArDetCellParams*)data).ignore()   ; } ;
+  StatusCode do_symLink(const LArPhysCaliTdiffComplete* data)   { return detStore()->symLink(data,(ILArPhysCaliTdiff*)data).ignore()   ; } ;
+  StatusCode do_symLink(const LArTdriftComplete* data)          { return detStore()->symLink(data,(ILArTdrift*)data).ignore()          ; } ;
+  StatusCode do_symLink(const LArMphysOverMcalComplete* data)   { return detStore()->symLink(data,(ILArMphysOverMcal*)data).ignore()   ; } ;
+  StatusCode do_symLink(const LArRinjComplete* data)            { return detStore()->symLink(data,(ILArRinj*)data).ignore()            ; } ;
+  StatusCode do_symLink(const LArTshaperComplete* data)         { return detStore()->symLink(data,(ILArTshaper*)data).ignore()         ; } ;
+  StatusCode do_symLink(const LArEMEC_CphiComplete* data)       { return detStore()->symLink(data,(ILArEMEC_Cphi*)data).ignore()       ; } ;
+  StatusCode do_symLink(const LArEMEC_HValphaComplete* data)    { return detStore()->symLink(data,(ILArEMEC_HValpha*)data).ignore()    ; } ;
+  StatusCode do_symLink(const LArEMEC_HVbetaComplete* data)     { return detStore()->symLink(data,(ILArEMEC_HVbeta*)data).ignore()     ; } ;
+  StatusCode do_symLink(const LArCableLengthComplete* data)     { return detStore()->symLink(data,(ILArCableLength*)data).ignore()     ; } ;
+  StatusCode do_symLink(const LArCableAttenuationComplete* data){ return detStore()->symLink(data,(ILArCableAttenuation*)data).ignore(); } ;
+//  StatusCode do_symLink(const LArCaliPulseParamsVsCalib* data)  { return detStore()->symLink(data,(ILArCaliPulseParams*)data).ignore() ; };
 
 };
 
diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.icc b/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.icc
index 405e7163a4c8..2a5d9ec5c070 100644
--- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.icc
+++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.icc
@@ -1,7 +1,7 @@
 //Dear emacs, this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -138,7 +138,7 @@ StatusCode LArReadParamsFromFile<DATA>::stop()
   ATH_CHECK( detStore()->record(m_dataclass,key) );
   ATH_MSG_INFO ( "Object " << classname << " recorded into detStore with key " << key );
 
-  do_symLink(m_dataclass) ;
+  ATH_CHECK ( do_symLink(m_dataclass) );
   ATH_MSG_INFO ( "Object " << classname << " symLinked to its abstract interface" );
 
   ATH_MSG_INFO ( "finished!" );
diff --git a/LArCalorimeter/LArCalibTools/src/LArMphysOverMcalFromTuple.cxx b/LArCalorimeter/LArCalibTools/src/LArMphysOverMcalFromTuple.cxx
index 5771a23daf96..ae79a90d7be0 100755
--- a/LArCalorimeter/LArCalibTools/src/LArMphysOverMcalFromTuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArMphysOverMcalFromTuple.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibTools/LArMphysOverMcalFromTuple.h"
@@ -68,7 +68,7 @@ StatusCode LArMphysOverMcalFromTuple::stop()
   LArMphysOverMcalComplete* container = new LArMphysOverMcalComplete();
 //  container->setGroupingType(LArConditionsContainerBase::FeedThroughGrouping);
   container->setGroupingType(LArConditionsContainerBase::ExtendedFTGrouping);
-  container->initialize();
+  ATH_CHECK( container->initialize() );
 
   
 
diff --git a/LArCalorimeter/LArCalibTools/src/LArOFCBin_PhysCaliTdiffFromStdNtuple.cxx b/LArCalorimeter/LArCalibTools/src/LArOFCBin_PhysCaliTdiffFromStdNtuple.cxx
index 76ec9f55618b..ca4a6953ff81 100755
--- a/LArCalorimeter/LArCalibTools/src/LArOFCBin_PhysCaliTdiffFromStdNtuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArOFCBin_PhysCaliTdiffFromStdNtuple.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibTools/LArOFCBin_PhysCaliTdiffFromStdNtuple.h"
@@ -75,11 +75,11 @@ StatusCode LArOFCBin_PhysCaliTdiffFromStdNtuple::stop()
 
   // Create new objects
   LArOFCBinComplete *larOFCParams = new LArOFCBinComplete();
-  larOFCParams->setGroupingType(m_groupingType, msg());
-  larOFCParams->initialize();
+  ATH_CHECK ( larOFCParams->setGroupingType(m_groupingType, msg()) );
+  ATH_CHECK ( larOFCParams->initialize() );
   LArPhysCaliTdiffComplete *larTdiffParams = new LArPhysCaliTdiffComplete();
-  larTdiffParams->setGroupingType(m_groupingType, msg());
-  larTdiffParams->initialize();
+  ATH_CHECK ( larTdiffParams->setGroupingType(m_groupingType, msg()) );
+  ATH_CHECK ( larTdiffParams->initialize() );
 
 
   unsigned int hwid;
diff --git a/LArCalorimeter/LArCalibTools/src/LArParamsFromStdNtuple.cxx b/LArCalorimeter/LArCalibTools/src/LArParamsFromStdNtuple.cxx
index ebab8a0c9f2f..12090803ec13 100755
--- a/LArCalorimeter/LArCalibTools/src/LArParamsFromStdNtuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArParamsFromStdNtuple.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibTools/LArParamsFromStdNtuple.h"
@@ -80,11 +80,11 @@ StatusCode LArParamsFromStdNtuple::stop()
 
   // Create new objects
   LArCaliPulseParamsComplete *larCaliPulseParams = new LArCaliPulseParamsComplete();
-  larCaliPulseParams->setGroupingType(m_groupingType, msg());
-  larCaliPulseParams->initialize();
+  ATH_CHECK ( larCaliPulseParams->setGroupingType(m_groupingType, msg()) );
+  ATH_CHECK ( larCaliPulseParams->initialize() );
   LArDetCellParamsComplete *larDetCellParams = new LArDetCellParamsComplete();
-  larDetCellParams->setGroupingType(m_groupingType, msg());
-  larDetCellParams->initialize();
+  ATH_CHECK ( larDetCellParams->setGroupingType(m_groupingType, msg()) );
+  ATH_CHECK ( larDetCellParams->initialize() );
 
 
   unsigned int hwid;
diff --git a/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromStdNtuple.cxx b/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromStdNtuple.cxx
index 1888ba0c53df..20892da37b58 100755
--- a/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromStdNtuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromStdNtuple.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibTools/LArPhysWaveFromStdNtuple.h"
@@ -80,8 +80,8 @@ StatusCode LArPhysWaveFromStdNtuple::stop()
 
   // Create new LArPhysWaveContainer
   LArPhysWaveContainer* larPhysWaveContainerNew = new LArPhysWaveContainer();
-  larPhysWaveContainerNew->setGroupingType(m_groupingType, msg());
-  larPhysWaveContainerNew->initialize();
+  ATH_CHECK ( larPhysWaveContainerNew->setGroupingType(m_groupingType, msg()) );
+  ATH_CHECK ( larPhysWaveContainerNew->initialize() );
 
   unsigned int hwid;
   unsigned int uflag;
diff --git a/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromTuple.cxx b/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromTuple.cxx
index bcc4040c33a5..be74c2a211d4 100755
--- a/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromTuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromTuple.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibTools/LArPhysWaveFromTuple.h"
@@ -92,8 +92,8 @@ StatusCode LArPhysWaveFromTuple::stop()
 
   // Create new LArPhysWaveContainer
   LArPhysWaveContainer* larPhysWaveContainerNew = new LArPhysWaveContainer();
-  larPhysWaveContainerNew->setGroupingType(m_groupingType, msg());
-  larPhysWaveContainerNew->initialize();
+  ATH_CHECK ( larPhysWaveContainerNew->setGroupingType(m_groupingType, msg()) );
+  ATH_CHECK ( larPhysWaveContainerNew->initialize() );
 
   // loop over entries in the Tuple, one entry = one channel
   Long64_t nentries = outfit->GetEntries();
diff --git a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilderXtalk.cxx b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilderXtalk.cxx
index faccf5b5dd3b..5ea8812dcde2 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilderXtalk.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilderXtalk.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibUtils/LArCaliWaveBuilderXtalk.h"
@@ -371,7 +371,9 @@ StatusCode LArCaliWaveBuilderXtalk::execute()
      return StatusCode::FAILURE;
   }
  
-  if (m_event_counter==0) initializeCabling(cabling, clCont);
+  if (m_event_counter==0) {
+    ATH_CHECK ( initializeCabling(cabling, clCont) );
+  }
 
   // Print progression
   if ( m_event_counter < 100 || ( m_event_counter < 1000 && m_event_counter%100==0 ) || m_event_counter%1000==0 ) 
diff --git a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveMerger.cxx b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveMerger.cxx
index 6cab2fb7f1ed..83a79e156fcb 100755
--- a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveMerger.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveMerger.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibUtils/LArCaliWaveMerger.h"
@@ -26,8 +26,8 @@ StatusCode LArCaliWaveMerger::stop()
   
   // create empty LArCaliWaveContainer to store all LArCaliWave
   LArCaliWaveContainer* mergedCaliWaveContainer = new LArCaliWaveContainer();
-  mergedCaliWaveContainer->setGroupingType(m_groupingType,msg());
-  mergedCaliWaveContainer->initialize();  
+  ATH_CHECK ( mergedCaliWaveContainer->setGroupingType(m_groupingType,msg()) );
+  ATH_CHECK ( mergedCaliWaveContainer->initialize() );
 
   std::vector<std::string>::const_iterator key_it   = m_keylist.begin();
   std::vector<std::string>::const_iterator key_it_e = m_keylist.end();
diff --git a/LArCalorimeter/LArCalibUtils/src/LArDigitOscillationCorrTool.cxx b/LArCalorimeter/LArCalibUtils/src/LArDigitOscillationCorrTool.cxx
index ee28fed8dae2..e31e6ffba9e3 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArDigitOscillationCorrTool.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArDigitOscillationCorrTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibUtils/LArDigitOscillationCorrTool.h"
@@ -239,7 +239,7 @@ void LArDigitOscillationCorrTool::handle(const Incident& /* inc*/ )
 {
   ATH_MSG_DEBUG ( "LArDigitOscillationCorrTool handle()" );
   
-  this->retrieveDB();
+  this->retrieveDB().ignore();
   return;
 }
 
diff --git a/LArCalorimeter/LArCalibUtils/src/LArFill.cxx b/LArCalorimeter/LArCalibUtils/src/LArFill.cxx
index bcff1919a1cf..73aa8e44619e 100755
--- a/LArCalorimeter/LArCalibUtils/src/LArFill.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArFill.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibUtils/LArFill.h"
@@ -41,9 +41,10 @@ StatusCode LArFill::execute()
   m_adc2dac = new LArRampComplete();
   m_dac2ua  = new LArDAC2uAComplete();
   m_ua2mev  = new LAruA2MeVComplete();
-  m_adc2dac->initialize(); 
-  m_dac2ua->initialize();
-  m_ua2mev->initialize();
+
+  ATH_CHECK ( m_adc2dac->initialize() );
+  ATH_CHECK ( m_dac2ua->initialize() );
+  ATH_CHECK ( m_ua2mev->initialize() );
 
   std::vector<float> ramp;
   for (unsigned int i=0;i<3;i++){
diff --git a/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx
index 17bbed52c3c9..37ee9894000e 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /********************************************************************
@@ -69,11 +69,8 @@ StatusCode LArPedestalBuilder::initialize()
  //m_pedestal.setGroupingType(LArConditionsContainerBase::SingleGroup);
 
  m_accu.setGroupingType(LArConditionsContainerBase::SingleGroup);
- m_accu.initialize(); 
- if (sc.isFailure()) {
-    ATH_MSG_ERROR( "Failed initialize LArConditionsContainer 'm_accu'" );
-    return sc;
-  }
+ ATH_CHECK ( m_accu.initialize() );
+
  return StatusCode::SUCCESS;
 }
 
diff --git a/LArCalorimeter/LArCalibUtils/src/LArRampCorr.cxx b/LArCalorimeter/LArCalibUtils/src/LArRampCorr.cxx
index eb985ef993df..17468113a379 100755
--- a/LArCalorimeter/LArCalibUtils/src/LArRampCorr.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArRampCorr.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArCalibUtils/LArRampCorr.h"
@@ -89,7 +89,7 @@ StatusCode LArRampCorr::stop()
    LArRampComplete::LArCondObj ramp;
    
    ramp.m_vRamp = coeffs;
-   larRampCorr->insertCorrection(chid,ramp,iGain);
+   ATH_CHECK ( larRampCorr->insertCorrection(chid,ramp,iGain) );
  }
 
  ATH_CHECK( detStore()->record(std::move(larRampCorr),m_keyoutput) );
-- 
GitLab