diff --git a/ForwardDetectors/ALFA/ALFA_BeamTransport/src/ALFA_BeamTrack.cxx b/ForwardDetectors/ALFA/ALFA_BeamTransport/src/ALFA_BeamTrack.cxx index ea2c4f30f15ecb55a8391130270056d3e94647d6..5da67ca8a9d317e81205129a84c6476ff528cefd 100644 --- a/ForwardDetectors/ALFA/ALFA_BeamTransport/src/ALFA_BeamTrack.cxx +++ b/ForwardDetectors/ALFA/ALFA_BeamTransport/src/ALFA_BeamTrack.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #include "ALFA_BeamTrack.h" @@ -24,28 +24,6 @@ #include <iostream> #include <utility> -//constructor -ALFA_BeamTrack::ALFA_BeamTrack() -{ - - //initialisation with standart values - - //declareProperty("ConfDir", m_ConfDir= "./config"); - /*m_ConfDir= ... - m_AlfaTwiss = ...*/ - - m_AlfaTwiss=true; - m_ip = 1; - m_Magver = 3; - m_Side = FPTracker::beam1; - - -} - -//destructor -ALFA_BeamTrack::~ALFA_BeamTrack() -{ -} int ALFA_BeamTrack::initialize(const FPConfig &ConfigValues){ diff --git a/ForwardDetectors/ALFA/ALFA_BeamTransport/src/ALFA_BeamTrack.h b/ForwardDetectors/ALFA/ALFA_BeamTransport/src/ALFA_BeamTrack.h index 8a62540d8030f6c458583b9170a9fca6d5d5c3a6..98792e7507568e2704e46b0644b5561130e6218d 100644 --- a/ForwardDetectors/ALFA/ALFA_BeamTransport/src/ALFA_BeamTrack.h +++ b/ForwardDetectors/ALFA/ALFA_BeamTransport/src/ALFA_BeamTrack.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #ifndef ALFA_BeamTrack_H @@ -30,9 +30,9 @@ class ALFA_BeamTrack public: - ALFA_BeamTrack(); - ~ALFA_BeamTrack(); - int initialize(const FPConfig &ConfigValues); + ALFA_BeamTrack() = default; + ~ALFA_BeamTrack() = default; + int initialize(const FPConfig &ConfigValues); /**calculates the particle position and momentum at RP run first CalculatePosRP() then posRP() and momRP()*/ @@ -41,32 +41,24 @@ class ALFA_BeamTrack const FPTracker::Point& PosRP(); /**gives back Momentum*/ const FPTracker::Point& MomRP(); - - private: - //double m_variablen; - std::string m_ConfDir; - FPTracker::ConfigData m_ConfigData; - bool m_AlfaTwiss; - int m_ip; - int m_Magver; - - FPTracker::Side m_Side; - std::shared_ptr< std::ifstream > m_Magfile; - - //FPTracker::Particle m_Particle; - FPTracker::Point m_PosParticleRP; - FPTracker::Point m_MomParticleRP; - FPTracker::Beamline m_Beamline_1; - FPTracker::Beamline m_Beamline_2; - - - - - + std::string m_ConfDir; + FPTracker::ConfigData m_ConfigData; + bool m_AlfaTwiss{true}; + int m_ip{1}; + int m_Magver{3}; + + FPTracker::Side m_Side{FPTracker::beam1}; + std::shared_ptr< std::ifstream > m_Magfile; + //FPTracker::Particle m_Particle; + FPTracker::Point m_PosParticleRP; + FPTracker::Point m_MomParticleRP; + + FPTracker::Beamline m_Beamline_1; + FPTracker::Beamline m_Beamline_2; }; #endif diff --git a/InnerDetector/InDetAlignment/InDetAlignNtupleTools/src/DetailedIDNtupleTool.cxx b/InnerDetector/InDetAlignment/InDetAlignNtupleTools/src/DetailedIDNtupleTool.cxx index 52de3accfd6d6d80facc8a5b37cdefd84bfa9f09..8e4f19da74f2d082649880c1ea6b906549b4c83e 100644 --- a/InnerDetector/InDetAlignment/InDetAlignNtupleTools/src/DetailedIDNtupleTool.cxx +++ b/InnerDetector/InDetAlignment/InDetAlignNtupleTools/src/DetailedIDNtupleTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #include "TrkEventPrimitives/FitQuality.h" @@ -388,52 +388,50 @@ namespace InDet { return false; } - if (TruthMap) { - ElementLink<TrackCollection> tracklink; - tracklink.setElement(const_cast<Trk::Track*>(alignTrack->originalTrack())); - tracklink.setStorableObject(*RecCollection); - const ElementLink<TrackCollection> tracklink2 = tracklink; + ElementLink<TrackCollection> tracklink; + tracklink.setElement(const_cast<Trk::Track*>(alignTrack->originalTrack())); + tracklink.setStorableObject(*RecCollection); + const ElementLink<TrackCollection> tracklink2 = tracklink; - TrackTruthCollection::const_iterator found = TruthMap->find(tracklink2); - if ((found != TruthMap->end()) && (found->second.probability() > m_matchProbability)) { - TrackTruth trtruth = found->second; - const HepMcParticleLink& HMPL = trtruth.particleLink(); + TrackTruthCollection::const_iterator found = TruthMap->find(tracklink2); + if ((found != TruthMap->end()) && (found->second.probability() > m_matchProbability)) { + TrackTruth trtruth = found->second; + const HepMcParticleLink& HMPL = trtruth.particleLink(); - if (HMPL.isValid()) { + if (HMPL.isValid()) { #ifdef HEPMC3 - HepMC::ConstGenParticlePtr genparptr = HMPL.scptr(); + HepMC::ConstGenParticlePtr genparptr = HMPL.scptr(); #else - const HepMC::GenParticle* genparptr = HMPL.cptr(); + const HepMC::GenParticle* genparptr = HMPL.cptr(); #endif - if (genparptr) { - if (genparptr->production_vertex()) { - if (genparptr->pdg_id() == 0) { - ATH_MSG_INFO("PDG ID is zero in DetailedIDNtupleTool::retrieveTruthInfo"); - } else { - const Trk::TrackParameters* generatedTrackPerigee = m_truthToTrack->makePerigeeParameters(genparptr); - if (!generatedTrackPerigee) ATH_MSG_WARNING("Unable to extrapolate genparticle to perigee!"); - else { - flag = true; - m_truth_qoverpt = generatedTrackPerigee->parameters()[Trk::qOverP] / std::sin( - generatedTrackPerigee->parameters()[Trk::theta]); - m_truth_qoverp = generatedTrackPerigee->parameters()[Trk::qOverP]; - m_truth_phi0 = generatedTrackPerigee->parameters()[Trk::phi0]; - m_truth_d0 = generatedTrackPerigee->parameters()[Trk::d0]; - m_truth_z0 = generatedTrackPerigee->parameters()[Trk::z0]; - m_truth_theta = generatedTrackPerigee->parameters()[Trk::theta]; - m_truth_eta = generatedTrackPerigee->eta(); - m_truth_prod_x = genparptr->production_vertex()->position().x(); - m_truth_prod_y = genparptr->production_vertex()->position().y(); - m_truth_prod_z = genparptr->production_vertex()->position().z(); - - delete generatedTrackPerigee; - m_truth_pt = 1. / std::abs(m_truth_qoverpt); - m_truth_charge = 1; - if (m_truth_qoverpt < 0) m_truth_charge = -1; - if (m_truth_phi0 < 0) m_truth_phi0 += 2 * M_PI; - ATH_MSG_DEBUG("Found matched truth track with phi, PT = " << m_truth_phi0 << ", " << m_truth_pt); - } + if (genparptr) { + if (genparptr->production_vertex()) { + if (genparptr->pdg_id() == 0) { + ATH_MSG_INFO("PDG ID is zero in DetailedIDNtupleTool::retrieveTruthInfo"); + } else { + const Trk::TrackParameters* generatedTrackPerigee = m_truthToTrack->makePerigeeParameters(genparptr); + if (!generatedTrackPerigee) ATH_MSG_WARNING("Unable to extrapolate genparticle to perigee!"); + else { + flag = true; + m_truth_qoverpt = generatedTrackPerigee->parameters()[Trk::qOverP] / std::sin( + generatedTrackPerigee->parameters()[Trk::theta]); + m_truth_qoverp = generatedTrackPerigee->parameters()[Trk::qOverP]; + m_truth_phi0 = generatedTrackPerigee->parameters()[Trk::phi0]; + m_truth_d0 = generatedTrackPerigee->parameters()[Trk::d0]; + m_truth_z0 = generatedTrackPerigee->parameters()[Trk::z0]; + m_truth_theta = generatedTrackPerigee->parameters()[Trk::theta]; + m_truth_eta = generatedTrackPerigee->eta(); + m_truth_prod_x = genparptr->production_vertex()->position().x(); + m_truth_prod_y = genparptr->production_vertex()->position().y(); + m_truth_prod_z = genparptr->production_vertex()->position().z(); + + delete generatedTrackPerigee; + m_truth_pt = 1. / std::abs(m_truth_qoverpt); + m_truth_charge = 1; + if (m_truth_qoverpt < 0) m_truth_charge = -1; + if (m_truth_phi0 < 0) m_truth_phi0 += 2 * M_PI; + ATH_MSG_DEBUG("Found matched truth track with phi, PT = " << m_truth_phi0 << ", " << m_truth_pt); } } } diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/CscClusterization/ICscClusterFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/CscClusterization/ICscClusterFitter.h index a5d62225b9db693b23e40af5d3a71a66cb1e0cdf..650fec5ac0ad6ca53df70ccddbee73bda3018ffe 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/CscClusterization/ICscClusterFitter.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/CscClusterization/ICscClusterFitter.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ // ICscClusterFitter.h @@ -74,11 +74,11 @@ public: // Embedded class. DataMap dataMap; // Extra data Result(int stat = 0, Muon::CscClusterStatus cstat = Muon::CscStatusUndefined, - Muon::CscTimeStatus tstat = Muon::CscTimeStatusUndefined) { - fitStatus = stat; - clusterStatus = cstat; - timeStatus = tstat; - } + Muon::CscTimeStatus tstat = Muon::CscTimeStatusUndefined) : + fitStatus(stat), + clusterStatus(cstat), + timeStatus(tstat) + {} Result(const Result&) = default; ~Result() = default; }; diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/CscClusterization/ICscStripFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/CscClusterization/ICscStripFitter.h index 95d40bd56d1392cad25a654d042c1bb621799802..1a2b0fd2958bb4ef02c160a8bdec4a8804535475 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/CscClusterization/ICscStripFitter.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/CscClusterization/ICscStripFitter.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #ifndef ICscStripFitter_H #define ICscStripFitter_H @@ -42,10 +42,10 @@ public: // Embedded class. double charge_beforeGainCorr{0.}; // Time (ns) of the peak. without t0 correction double charge_beforeBPCorr{0.}; // Time (ns) of the peak. without t0 correction Muon::CscTimeStatus timeStatus{Muon::CscTimeStatusUndefined}; - Result(Muon::CscStripStatus sstat = Muon::CscStrStatUndefined, Muon::CscTimeStatus tstat = Muon::CscTimeStatusUndefined) { - stripStatus = sstat; - timeStatus = tstat; - } + Result(Muon::CscStripStatus sstat = Muon::CscStrStatUndefined, Muon::CscTimeStatus tstat = Muon::CscTimeStatusUndefined) : + stripStatus(sstat), + timeStatus(tstat) + {} Result(const Result&) = default; ~Result() = default; }; diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkLLP/DerivationFrameworkLLP/RCJetSubstructureAug.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkLLP/DerivationFrameworkLLP/RCJetSubstructureAug.h index bb4b3a02e25afba5910420d32f1426720ce29af2..9ccc7108ea015f3432eebd1d0449ddf1196fec87 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkLLP/DerivationFrameworkLLP/RCJetSubstructureAug.h +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkLLP/DerivationFrameworkLLP/RCJetSubstructureAug.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////// @@ -62,7 +62,7 @@ namespace DerivationFramework { // Struct to hold all decorators struct moments_t; - moments_t* m_moments; + moments_t* m_moments{}; // The filter object that will apply the grooming std::unique_ptr<fastjet::Filter> m_trimmer; diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/MSVVariablesFactory.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/MSVVariablesFactory.cxx index 74c4e36d1d59691da402fad095003405c94d9773..79abf9b6aba454c9fb728764af64f0adadee2847 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/MSVVariablesFactory.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/MSVVariablesFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////////////////////////////////////////// @@ -121,8 +121,8 @@ namespace Analysis { std::vector<const xAOD::Vertex*> vecVtxHolder; vecVtxHolder.push_back(vertex); - ATH_MSG_DEBUG("Factory PVX x = " << priVtx->x() << " y = " << priVtx->y() << " z = " << priVtx->z()); if (priVtx) { + ATH_MSG_DEBUG("Factory PVX x = " << priVtx->x() << " y = " << priVtx->y() << " z = " << priVtx->z()); localdistnrm = get3DSignificance(priVtx, vecVtxHolder, jet_V3); } else { ATH_MSG_WARNING("#BTAG# Tagging requested, but no primary vertex supplied."); diff --git a/Reconstruction/Jet/BoostedJetTaggers/BoostedJetTaggers/JSSMLTool.h b/Reconstruction/Jet/BoostedJetTaggers/BoostedJetTaggers/JSSMLTool.h index d53ea35004c12bac111708563caa6de81735aaff..d6f84676471a6c1a076787dcd25c6134398308e9 100644 --- a/Reconstruction/Jet/BoostedJetTaggers/BoostedJetTaggers/JSSMLTool.h +++ b/Reconstruction/Jet/BoostedJetTaggers/BoostedJetTaggers/JSSMLTool.h @@ -1,5 +1,5 @@ // Dear emacs, this is -*- c++ -*- -// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration #ifndef BOOSTEDJETTAGGERS_JSSMLTOOL_H #define BOOSTEDJETTAGGERS_JSSMLTOOL_H @@ -87,7 +87,7 @@ class JSSMLTool // output node info std::vector<int64_t> m_output_node_dims; - size_t m_num_output_nodes; + size_t m_num_output_nodes{}; std::vector<const char*> m_output_node_names; // some configs diff --git a/Reconstruction/Jet/JetRec/JetRec/FastJetInterfaceTool.h b/Reconstruction/Jet/JetRec/JetRec/FastJetInterfaceTool.h index 4d57d7f63353e190a7c722a44ad39e945720d3c5..946e5bac677a96594f3c2476fa04af039b8d55d5 100644 --- a/Reconstruction/Jet/JetRec/JetRec/FastJetInterfaceTool.h +++ b/Reconstruction/Jet/JetRec/JetRec/FastJetInterfaceTool.h @@ -1,7 +1,7 @@ // -*- c++ -*- /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #ifndef JETREC_FASTJETINTERFACETOOL_H @@ -206,6 +206,7 @@ public: * * The string returned cannot be modified by client. */ + // cppcheck-suppress returnByReference; do not expose internals const std::string getAreaDefinitionType() const; /*! @brief Get known jet algorithms */ diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.h b/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.h index 5b5ea9c0fb344a17007c6b4018c2673d8b463492..aa7ecfb51189d625d5aca5c8dbdec34525074b2b 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.h +++ b/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #ifndef ISF_SERVICES_TRUTHSVC_H @@ -97,7 +97,7 @@ namespace ISF { Gaudi::Property<std::vector<unsigned int> > m_forceEndVtxRegionsVec{this, "ForceEndVtxInRegions", {}, ""}; //!< property containing AtlasRegions for which // to write end-vtx - std::array<bool, AtlasDetDescr::fNumAtlasRegions> m_forceEndVtx; //!< attach end vertex to + std::array<bool, AtlasDetDescr::fNumAtlasRegions> m_forceEndVtx{}; //!< attach end vertex to // all parent particles if they die Gaudi::Property<bool> m_quasiStableParticlesIncluded{this, "QuasiStableParticlesIncluded", false, ""}; //!< does this job simulate quasi-stable particles.