From 2004d061886276e746f2f6a3f8b327d4459e2252 Mon Sep 17 00:00:00 2001 From: scott snyder <sss@karma> Date: Fri, 8 Oct 2021 09:07:00 -0400 Subject: [PATCH 1/2] LArCalibUtils: Fix cppcheck warning. Redundant test. --- LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx index 240a32a45074..0eb822b76f0d 100644 --- a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx @@ -684,10 +684,9 @@ StatusCode LArRampBuilder::stop() if (!isADCsat) { rawramp->setsat(data.size()); } // if no saturation point was found, and ADC saturation did not happen, record the ramp size } - if (larRampComplete){ //Produce transient object - larRampComplete->set(chid,(int)gain,rampCoeffs); - NRamp++; - } + //Produce transient object + larRampComplete->set(chid,(int)gain,rampCoeffs); + NRamp++; }// end else (rampfitting suceeded) }// end if (build ramp object) //Save raw ramp for this cell, if requested by jobOpts -- GitLab From 9fd76c13bedb1e229d12f0790083765c5c4b9c90 Mon Sep 17 00:00:00 2001 From: scott snyder <sss@karma> Date: Fri, 8 Oct 2021 09:11:38 -0400 Subject: [PATCH 2/2] TileCalibAlgs: Fix cppcheck warnings. Prefer preincrement for iterator classes. --- .../TileCalib/TileCalibAlgs/src/TileCisDefaultCalibTool.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileCisDefaultCalibTool.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileCisDefaultCalibTool.cxx index a4f5b220c133..4a3f6c27b3ba 100644 --- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileCisDefaultCalibTool.cxx +++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileCisDefaultCalibTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // Gaudi includes @@ -388,7 +388,7 @@ StatusCode TileCisDefaultCalibTool::finalizeCalculations() { //nadc = 0; // loop over all adcs - for (; adcIter != adcIterE; adcIter++) { + for (; adcIter != adcIterE; ++adcIter) { hwid = (adcIter)->first; MeanDacMap = (adcIter)->second; MeanSqDacMap = m_MeanSqMap[hwid]; @@ -433,7 +433,7 @@ StatusCode TileCisDefaultCalibTool::finalizeCalculations() { badPts = 0; maxPointInFitRange = 0.0; maxRMS = 0.0; - for (; dacIter != dacIterE; dacIter++) { + for (; dacIter != dacIterE; ++dacIter) { dac = (dacIter)->first; mean = (dacIter)->second; meansq = (*MeanSqDacMap)[dac]; -- GitLab