diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellMaskingTool.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellMaskingTool.h index 17a4b82da93a4b887100aa10988e77010b4ead94..0b7b2c3a9bd1cf64d874b4af6a112faafe5a314e 100644 --- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellMaskingTool.h +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellMaskingTool.h @@ -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 */ #ifndef TILECELLMASKINGTOOL_H @@ -38,7 +38,7 @@ class TileCellMaskingTool: public AthAlgTool, virtual public ICaloCellMakerTool private: StatusCode fillIncludedCellsMap(); - void killer(std::string component, int ros, int drw, int index); + void killer(const std::string& component, int ros, int drw, int index); std::vector<std::string> m_rejectedTileDrawer; std::vector<std::string> m_rejectedTileMB; diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelVerify.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelVerify.h index 2df15cc362a8fa9a68eaf0c322e8f64faeeddee6..51d25cebd90784cba36adea2d4cf60e8601c7c3d 100644 --- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelVerify.h +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileRawChannelVerify.h @@ -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 */ //**************************************************************************** @@ -50,7 +50,7 @@ class TileHWID; class TileRawChannelVerify: public AthAlgorithm { public: - TileRawChannelVerify(std::string name, ISvcLocator* pSvcLocator); //!< Constructor + TileRawChannelVerify(const std::string& name, ISvcLocator* pSvcLocator); //!< Constructor virtual ~TileRawChannelVerify(); //!< Destructor diff --git a/TileCalorimeter/TileRecUtils/src/TileCellMaskingTool.cxx b/TileCalorimeter/TileRecUtils/src/TileCellMaskingTool.cxx index 873bca789c38430f472ae4ac3d4aee92c3390e6d..e2ed713e234acc78840184c4f0a0721d9df1a34b 100644 --- a/TileCalorimeter/TileRecUtils/src/TileCellMaskingTool.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileCellMaskingTool.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 */ // Gaudi includes @@ -64,47 +64,37 @@ StatusCode TileCellMaskingTool::fillIncludedCellsMap() { int ros = 0, drw = 0, index = -1; - std::vector<std::string>::const_iterator it_dr = m_rejectedTileDrawer.begin(); - std::vector<std::string>::const_iterator it_dr_e = m_rejectedTileDrawer.end(); - for (; it_dr != it_dr_e; it_dr++) { + for (const std::string& dr : m_rejectedTileDrawer) { std::stringstream dris; - dris << (*it_dr); + dris << dr; dris >> ros >> drw; killer("drawer", ros, drw, index); } - std::vector<std::string>::const_iterator it_mb = m_rejectedTileMB.begin(); - std::vector<std::string>::const_iterator it_mb_e = m_rejectedTileMB.end(); - for (; it_mb != it_mb_e; it_mb++) { + for (const std::string& mb : m_rejectedTileMB) { std::stringstream dris; - dris << (*it_mb); + dris << mb; dris >> ros >> drw >> index; killer("mb", ros, drw, index); } - std::vector<std::string>::const_iterator it_dig = m_rejectedTileDigitizer.begin(); - std::vector<std::string>::const_iterator it_dig_e = m_rejectedTileDigitizer.end(); - for (; it_dig != it_dig_e; it_dig++) { + for (const std::string& dig : m_rejectedTileDigitizer) { std::stringstream dris; - dris << (*it_dig); + dris << dig; dris >> ros >> drw >> index; killer("dig", ros, drw, index); } - std::vector<std::string>::const_iterator it_dmu = m_rejectedTileDMU.begin(); - std::vector<std::string>::const_iterator it_dmu_e = m_rejectedTileDMU.end(); - for (; it_dmu != it_dmu_e; it_dmu++) { + for (const std::string& dmu : m_rejectedTileDMU) { std::stringstream dris; - dris << (*it_dmu); + dris << dmu; dris >> ros >> drw >> index; killer("dmu", ros, drw, index); } - std::vector<std::string>::const_iterator it = m_rejectedTileChannels.begin(); - std::vector<std::string>::const_iterator it_e = m_rejectedTileChannels.end(); - for (; it != it_e; it++) { + for (const std::string& chan : m_rejectedTileChannels) { std::stringstream dris; - dris << (*it); + dris << chan; dris >> ros >> drw >> index; killer("channel", ros, drw, index); } @@ -114,7 +104,7 @@ StatusCode TileCellMaskingTool::fillIncludedCellsMap() { /////////////////////////////////////////////////////////////////////////////// -void TileCellMaskingTool::killer(std::string component, int ros, int drw, int index) { +void TileCellMaskingTool::killer(const std::string& component, int ros, int drw, int index) { int begin = 0, end = 0; diff --git a/TileCalorimeter/TileRecUtils/src/TileFilterManager.cxx b/TileCalorimeter/TileRecUtils/src/TileFilterManager.cxx index 4466ea3bf7c48c7b2e3be38ed369945afd58f747..6032311fc7f0f10accbe9f472806a3f21cebfe5c 100644 --- a/TileCalorimeter/TileRecUtils/src/TileFilterManager.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileFilterManager.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 */ // ************************************************************************************** @@ -216,6 +216,8 @@ int TileFilterManager::fitDigits1(TileFilterResult &tResult, bool lDebug) { } // if(debug) tResult.SnapShot(0); iFitIndex = getFitIndex(Npar, vcross); + // cppcheck-suppress negativeContainerIndex + // Npar is changed as a side-effect of calling addCross() above. std::vector<TileFitter>& vFitter = m_vNpFitter[Npar - 2]; TileFitter& tileFitter = vFitter[iFitIndex]; (void) tileFitter.fitAmp(tResult, false); diff --git a/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilder.cxx b/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilder.cxx index e97efe737f7131dda65dc78e0c04162d4af79a7f..6beab3b8c71acd3da38e220e8d642b8308e799aa 100644 --- a/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilder.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileRawChannelBuilder.cxx @@ -348,10 +348,8 @@ void TileRawChannelBuilder::fill_drawer_errors(const EventContext& ctx, << "/" << drawer << "/" << channel << "/" << gain; - if (err) { - if (err < -5) msg(MSG::VERBOSE) << " Warning " << err; - else msg(MSG::VERBOSE) << " Error " << err; - } + if (err < -5) msg(MSG::VERBOSE) << " Warning " << err; + else msg(MSG::VERBOSE) << " Error " << err; if (mindig > m_ADCmaskValueMinusEps) msg(MSG::VERBOSE) << " BADDQ"; if (maxdig > m_ADCmaxMinusEps) msg(MSG::VERBOSE) << " Overflow"; if (mindig < 0.1) msg(MSG::VERBOSE) << " Underflow"; diff --git a/TileCalorimeter/TileRecUtils/src/TileRawChannelVerify.cxx b/TileCalorimeter/TileRecUtils/src/TileRawChannelVerify.cxx index fb65457bcd6cc2689616a43d6645643869a89ac0..6edca788f5776a82673dfaeed618be838aac0db0 100644 --- a/TileCalorimeter/TileRecUtils/src/TileRawChannelVerify.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileRawChannelVerify.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 */ //***************************************************************************** @@ -57,7 +57,7 @@ class CompRawChannel { //========================================================================== // Constructor -TileRawChannelVerify::TileRawChannelVerify(string name, ISvcLocator* pSvcLocator) +TileRawChannelVerify::TileRawChannelVerify(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator) , m_tileHWID(0) {