From 46981fbb18472910742b96d64eef1f8605ab1e25 Mon Sep 17 00:00:00 2001 From: christos <christos@cern.ch> Date: Fri, 28 May 2021 00:10:42 +0200 Subject: [PATCH] egamma cppcheck [postfixOperator] --- .../egamma/egammaAlgs/src/egammaForwardBuilder.cxx | 2 +- Reconstruction/egamma/egammaEvent/src/EMBremFit.cxx | 8 ++++---- Reconstruction/egamma/egammaEvent/src/EMConvert.cxx | 12 ++++++------ .../egamma/egammaEvent/src/EMErrorDetail.cxx | 8 ++++---- Reconstruction/egamma/egammaEvent/src/EMShower.cxx | 4 ++-- .../egammaEvent/src/EMShowerMinimalContainer.cxx | 2 +- Reconstruction/egamma/egammaEvent/src/EMTrackFit.cxx | 8 ++++---- .../egamma/egammaEvent/src/EMTrackMatch.cxx | 8 ++++---- .../egamma/egammaEvent/src/ElectronContainer.cxx | 2 +- .../egamma/egammaEvent/src/PhotonContainer.cxx | 2 +- Reconstruction/egamma/egammaEvent/src/egPID.cxx | 8 ++++---- .../egamma/egammaEvent/src/egammaContainer.cxx | 4 +--- .../egamma/egammaPerformance/src/ZeeTaPMonTool.cxx | 2 +- .../egamma/egammaPerformance/src/electronMonTool.cxx | 2 +- .../egammaPerformance/src/forwardElectronMonTool.cxx | 2 +- .../egamma/egammaPerformance/src/photonMonTool.cxx | 2 +- 16 files changed, 37 insertions(+), 39 deletions(-) diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx index ae3a7d5e76cf..4641ee330cdf 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx @@ -102,7 +102,7 @@ StatusCode egammaForwardBuilder::execute(const EventContext& ctx) const xAOD::CaloClusterContainer::const_iterator clus_begin = cluster->begin(); xAOD::CaloClusterContainer::const_iterator clus_end = cluster->end(); - for (; clus_begin!=clus_end; clus_begin++) { + for (; clus_begin!=clus_end; ++clus_begin) { //Preselectcion cuts if((*clus_begin)->et() < m_ETcut|| diff --git a/Reconstruction/egamma/egammaEvent/src/EMBremFit.cxx b/Reconstruction/egamma/egammaEvent/src/EMBremFit.cxx index 0b0f8cca44e9..648414693b77 100755 --- a/Reconstruction/egamma/egammaEvent/src/EMBremFit.cxx +++ b/Reconstruction/egamma/egammaEvent/src/EMBremFit.cxx @@ -57,7 +57,7 @@ double EMBremFit::parameter(egammaParameters::ParamDef key) const { double result = egammaParameters::EgParamUndefined; std::vector<elParams>::const_iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) { result = (*p).second; break; @@ -77,7 +77,7 @@ void EMBremFit::set_parameter(egammaParameters::ParamDef key, double value, bool std::vector<elParams>::iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) break; } @@ -104,7 +104,7 @@ int EMBremFit::intParameter(egammaParameters::ParamDef key) const { int result = (int)egammaParameters::EgParamUndefined; std::vector<elParams>::const_iterator p = m_parametersInt.begin(); - for (;p !=m_parametersInt.end(); p++) { + for (;p !=m_parametersInt.end(); ++p) { if ( (*p).first == key ){ result = (*p).second; break; @@ -120,7 +120,7 @@ void EMBremFit::set_parameterInt(egammaParameters::ParamDef key, int value, bool std::vector<elParams>::iterator p = m_parametersInt.begin(); - for (;p !=m_parametersInt.end(); p++) { + for (;p !=m_parametersInt.end(); ++p) { if ( (*p).first == key ) break; } diff --git a/Reconstruction/egamma/egammaEvent/src/EMConvert.cxx b/Reconstruction/egamma/egammaEvent/src/EMConvert.cxx index 00aade94838b..62e12a5bd9ba 100755 --- a/Reconstruction/egamma/egammaEvent/src/EMConvert.cxx +++ b/Reconstruction/egamma/egammaEvent/src/EMConvert.cxx @@ -181,7 +181,7 @@ double EMConvert::parameter(egammaParameters::ParamDef key) const { typedef std::pair<egammaParameters::ParamDef,double> elParams; std::vector<elParams>::const_iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) { result = (*p).second; break; @@ -197,7 +197,7 @@ bool EMConvert::boolParameter(egammaParameters::ParamDef key) const { bool result = false; std::vector<elParams>::const_iterator p = m_parametersBool.begin(); - for (;p !=m_parametersBool.end(); p++) { + for (;p !=m_parametersBool.end(); ++p) { if ( (*p).first == key ) { result = (*p).second; break; @@ -214,7 +214,7 @@ int EMConvert::intParameter(egammaParameters::ParamDef key) const { int result = (int)egammaParameters::EgParamUndefined; std::vector<elParams>::const_iterator p = m_parametersInt.begin(); - for (;p !=m_parametersInt.end(); p++) { + for (;p !=m_parametersInt.end(); ++p) { if ( (*p).first == key ){ result = (*p).second; break; @@ -241,7 +241,7 @@ void EMConvert::set_parameter(egammaParameters::ParamDef key, double value, bool using elParams = std::pair<egammaParameters::ParamDef, double>; std::vector<elParams>::iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) break; } @@ -265,7 +265,7 @@ void EMConvert::set_parameterBool(egammaParameters::ParamDef key, bool value, bo std::vector<elParams>::iterator p = m_parametersBool.begin(); - for (;p !=m_parametersBool.end(); p++) { + for (;p !=m_parametersBool.end(); ++p) { if ( (*p).first == key ) break; } @@ -289,7 +289,7 @@ void EMConvert::set_parameterInt(egammaParameters::ParamDef key, int value, bool std::vector<elParams>::iterator p = m_parametersInt.begin(); - for (;p !=m_parametersInt.end(); p++) { + for (;p !=m_parametersInt.end(); ++p) { if ( (*p).first == key ) break; } diff --git a/Reconstruction/egamma/egammaEvent/src/EMErrorDetail.cxx b/Reconstruction/egamma/egammaEvent/src/EMErrorDetail.cxx index b18128b5b0b9..0d7bee92a59e 100644 --- a/Reconstruction/egamma/egammaEvent/src/EMErrorDetail.cxx +++ b/Reconstruction/egamma/egammaEvent/src/EMErrorDetail.cxx @@ -42,7 +42,7 @@ int EMErrorDetail::intParameter(egammaParameters::ParamDef key) const { int result = (int)egammaParameters::EgParamUndefined; std::vector<elParams>::const_iterator p = m_parametersInt.begin(); - for (;p !=m_parametersInt.end(); p++) { + for (;p !=m_parametersInt.end(); ++p) { if ( (*p).first == key ){ result = (*p).second; break; @@ -63,7 +63,7 @@ double EMErrorDetail::parameter(egammaParameters::ParamDef key) const { double result = egammaParameters::EgParamUndefined; std::vector<elParams>::const_iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) { result = (*p).second; break; @@ -80,7 +80,7 @@ void EMErrorDetail::set_parameterInt(egammaParameters::ParamDef key, int value, std::vector<elParams>::iterator p = m_parametersInt.begin(); - for (;p !=m_parametersInt.end(); p++) { + for (;p !=m_parametersInt.end(); ++p) { if ( (*p).first == key ) break; } @@ -107,7 +107,7 @@ void EMErrorDetail::set_parameter(egammaParameters::ParamDef key, double value, using elParams = std::pair<egammaParameters::ParamDef, double>; std::vector<elParams>::iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) break; } diff --git a/Reconstruction/egamma/egammaEvent/src/EMShower.cxx b/Reconstruction/egamma/egammaEvent/src/EMShower.cxx index 4d5b9b9fc78d..1fe14378df87 100755 --- a/Reconstruction/egamma/egammaEvent/src/EMShower.cxx +++ b/Reconstruction/egamma/egammaEvent/src/EMShower.cxx @@ -82,7 +82,7 @@ double EMShower::parameter(egammaParameters::ParamDef key) const { double result = egammaParameters::EgParamUndefined; std::vector<elParams>::const_iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) { result = (*p).second; break; @@ -99,7 +99,7 @@ void EMShower::set_parameter(egammaParameters::ParamDef key, double value, bool std::vector<elParams>::iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) break; } diff --git a/Reconstruction/egamma/egammaEvent/src/EMShowerMinimalContainer.cxx b/Reconstruction/egamma/egammaEvent/src/EMShowerMinimalContainer.cxx index 14bc07d1ade8..d28aeed0fd42 100755 --- a/Reconstruction/egamma/egammaEvent/src/EMShowerMinimalContainer.cxx +++ b/Reconstruction/egamma/egammaEvent/src/EMShowerMinimalContainer.cxx @@ -32,7 +32,7 @@ void EMShowerMinimalContainer::print() std::cout << "Number of EMShowerMinimal objects in container " << this->size() << std::endl; - for (c_itr=begin(); c_itr!=end(); c_itr++) + for (c_itr=begin(); c_itr!=end(); ++c_itr) { (*c_itr)->print(); } diff --git a/Reconstruction/egamma/egammaEvent/src/EMTrackFit.cxx b/Reconstruction/egamma/egammaEvent/src/EMTrackFit.cxx index 0e353ecb8681..8281e397c1a4 100644 --- a/Reconstruction/egamma/egammaEvent/src/EMTrackFit.cxx +++ b/Reconstruction/egamma/egammaEvent/src/EMTrackFit.cxx @@ -67,7 +67,7 @@ double EMTrackFit::parameter(egammaParameters::ParamDef key) const double result = egammaParameters::EgParamUndefined; std::vector<elParams>::const_iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) { result = (*p).second; break; @@ -88,7 +88,7 @@ void EMTrackFit::set_parameter(egammaParameters::ParamDef key, double value, boo std::vector<elParams>::iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) break; } @@ -114,7 +114,7 @@ int EMTrackFit::intParameter(egammaParameters::ParamDef key) const int result = (int)egammaParameters::EgParamUndefined; std::vector<elParams>::const_iterator p = m_parametersInt.begin(); - for (;p !=m_parametersInt.end(); p++) { + for (;p !=m_parametersInt.end(); ++p) { if ( (*p).first == key ){ result = (*p).second; break; @@ -131,7 +131,7 @@ void EMTrackFit::set_parameterInt(egammaParameters::ParamDef key, int value, boo std::vector<elParams>::iterator p = m_parametersInt.begin(); - for (;p !=m_parametersInt.end(); p++) { + for (;p !=m_parametersInt.end(); ++p) { if ( (*p).first == key ) break; } diff --git a/Reconstruction/egamma/egammaEvent/src/EMTrackMatch.cxx b/Reconstruction/egamma/egammaEvent/src/EMTrackMatch.cxx index 4aef9da0770a..7e91ec253f0d 100755 --- a/Reconstruction/egamma/egammaEvent/src/EMTrackMatch.cxx +++ b/Reconstruction/egamma/egammaEvent/src/EMTrackMatch.cxx @@ -131,7 +131,7 @@ double EMTrackMatch::parameter(egammaParameters::ParamDef key) const double result = egammaParameters::EgParamUndefined; std::vector<elParams>::const_iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ){ result = (*p).second; break; @@ -157,7 +157,7 @@ void EMTrackMatch::set_parameter(egammaParameters::ParamDef key, double value, b std::vector<elParams>::iterator p = m_parameters.begin(); - for (;p !=m_parameters.end(); p++) { + for (;p !=m_parameters.end(); ++p) { if ( (*p).first == key ) break; } @@ -182,7 +182,7 @@ void EMTrackMatch::set_boolParameter(egammaParameters::ParamDef key, bool value, std::vector<elParams>::iterator p = m_parametersBool.begin(); - for (;p !=m_parametersBool.end(); p++) { + for (;p !=m_parametersBool.end(); ++p) { if ( (*p).first == key ) break; } @@ -207,7 +207,7 @@ bool EMTrackMatch::boolParameter(egammaParameters::ParamDef key) const double result = false; std::vector<elParams>::const_iterator p = m_parametersBool.begin(); - for (;p !=m_parametersBool.end(); p++) { + for (;p !=m_parametersBool.end(); ++p) { if ( (*p).first == key ) { result = (*p).second; break; diff --git a/Reconstruction/egamma/egammaEvent/src/ElectronContainer.cxx b/Reconstruction/egamma/egammaEvent/src/ElectronContainer.cxx index ae2aeea10591..660cf55dc1f7 100755 --- a/Reconstruction/egamma/egammaEvent/src/ElectronContainer.cxx +++ b/Reconstruction/egamma/egammaEvent/src/ElectronContainer.cxx @@ -31,7 +31,7 @@ void ElectronContainer::print() std::cout << "Number of Electron objects in container " << this->size() << std::endl; - for (c_itr=begin(); c_itr!=end(); c_itr++) + for (c_itr=begin(); c_itr!=end(); ++c_itr) { (*c_itr)->print(); } diff --git a/Reconstruction/egamma/egammaEvent/src/PhotonContainer.cxx b/Reconstruction/egamma/egammaEvent/src/PhotonContainer.cxx index 9801099eff34..cef8d754a2d9 100755 --- a/Reconstruction/egamma/egammaEvent/src/PhotonContainer.cxx +++ b/Reconstruction/egamma/egammaEvent/src/PhotonContainer.cxx @@ -31,7 +31,7 @@ void PhotonContainer::print() std::cout << "Number of Photon objects in container " << this->size() << std::endl; - for (c_itr=begin(); c_itr!=end(); c_itr++) + for (c_itr=begin(); c_itr!=end(); ++c_itr) { (*c_itr)->print(); } diff --git a/Reconstruction/egamma/egammaEvent/src/egPID.cxx b/Reconstruction/egamma/egammaEvent/src/egPID.cxx index 5d3d0429afb5..2f83c9d82297 100755 --- a/Reconstruction/egamma/egammaEvent/src/egPID.cxx +++ b/Reconstruction/egamma/egammaEvent/src/egPID.cxx @@ -76,7 +76,7 @@ double egPID::egammaID(egammaPIDObs::PID key, bool *found) const std::vector<elParams>::const_iterator p = m_egammaID.begin(); - for (;p !=m_egammaID.end(); p++) { + for (;p !=m_egammaID.end(); ++p) { if ( (*p).first == key ){ if (found != nullptr) { *found = true; @@ -112,7 +112,7 @@ bool egPID::set_egammaID(egammaPIDObs::PID key, double value) std::vector<elParams>::iterator p = m_egammaID.begin(); - for (;p !=m_egammaID.end(); p++) { + for (;p !=m_egammaID.end(); ++p) { if ( (*p).first == key ) break; } @@ -138,7 +138,7 @@ bool egPID::set_egammaIDint(egammaPIDObs::PID key, unsigned int value) std::vector<elParams>::iterator p = m_egammaIDint.begin(); - for (;p !=m_egammaIDint.end(); p++) { + for (;p !=m_egammaIDint.end(); ++p) { if ( (*p).first == key ) break; } @@ -196,7 +196,7 @@ unsigned int egPID::egammaIDint(egammaPIDObs::PID key, bool *found) const std::vector<elParams>::const_iterator p = m_egammaIDint.begin(); - for (;p !=m_egammaIDint.end(); p++) { + for (;p !=m_egammaIDint.end(); ++p) { if ( (*p).first == key ){ if (found != nullptr) { *found = true; diff --git a/Reconstruction/egamma/egammaEvent/src/egammaContainer.cxx b/Reconstruction/egamma/egammaEvent/src/egammaContainer.cxx index fffd09cd1724..6bc4849b205c 100755 --- a/Reconstruction/egamma/egammaEvent/src/egammaContainer.cxx +++ b/Reconstruction/egamma/egammaEvent/src/egammaContainer.cxx @@ -35,9 +35,7 @@ void egammaContainer::print() DataVector<egamma>::const_iterator c_itr; - //std::cout << "Number of egamma objects in container " << this->size() << std::endl; - - for (c_itr=begin(); c_itr!=end(); c_itr++) + for (c_itr=begin(); c_itr!=end(); ++c_itr) { (*c_itr)->print(); } diff --git a/Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.cxx b/Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.cxx index 3557c5141600..b5dbddba2680 100755 --- a/Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.cxx @@ -200,7 +200,7 @@ StatusCode ZeeTaPMonTool::fillHistograms() const xAOD::Electron *lead_el = nullptr; const xAOD::Electron *subl_el = nullptr; - for (; e_iter!=e_end; e_iter++) { + for (; e_iter!=e_end; ++e_iter) { if(!(*e_iter)) continue; // Formally unnecessary because all electrons in the container have these authors by construction diff --git a/Reconstruction/egamma/egammaPerformance/src/electronMonTool.cxx b/Reconstruction/egamma/egammaPerformance/src/electronMonTool.cxx index 94e9e819e488..8add26c20dfd 100755 --- a/Reconstruction/egamma/egammaPerformance/src/electronMonTool.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/electronMonTool.cxx @@ -584,7 +584,7 @@ StatusCode electronMonTool::fillHistograms() { m_LhTightElectrons->m_nElectronsPerRegion.resize(NREGION,0); m_CbTightElectrons->m_nElectronsPerRegion.resize(NREGION,0); - for (; e_iter!=e_end; e_iter++){ + for (; e_iter!=e_end; ++e_iter){ if(!(*e_iter)) continue; // Formally unnecessary because all electrons in the container have these authors by construction diff --git a/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx b/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx index 79b02d36aa2c..c572c8254d94 100644 --- a/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx @@ -239,7 +239,7 @@ StatusCode forwardElectronMonTool::fillHistograms() n_el.resize(NREGION,0); n_el_tight.resize(NREGION,0); - for (; e_iter!=e_end; e_iter++) { + for (; e_iter!=e_end; ++e_iter) { if(!(*e_iter)) continue; if((*e_iter)->author(xAOD::EgammaParameters::AuthorFwdElectron)==0) continue; diff --git a/Reconstruction/egamma/egammaPerformance/src/photonMonTool.cxx b/Reconstruction/egamma/egammaPerformance/src/photonMonTool.cxx index e5a2dfe12b94..e95e78a7ae18 100755 --- a/Reconstruction/egamma/egammaPerformance/src/photonMonTool.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/photonMonTool.cxx @@ -716,7 +716,7 @@ StatusCode photonMonTool::fillHistograms() { m_CbTightPhotons->m_nPhotonsPerRegionUnconv.resize(NREGION,0); m_CbTightPhotons->m_nPhotonsPerRegionConv.resize(NREGION,0); - for (; ph_iter!=ph_end; ph_iter++){ + for (; ph_iter!=ph_end; ++ph_iter){ if(!(*ph_iter)) continue; // Necessary because some photons in the container have another author because reconstructed from topocluster -- GitLab