From f002ceddaef7c7a3426aee0c2a164add79654e92 Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Fri, 13 Dec 2024 10:12:38 +0100 Subject: [PATCH 1/4] initialise member --- .../JetCalibTools/CalibrationMethods/JMSCorrection.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/CalibrationMethods/JMSCorrection.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/CalibrationMethods/JMSCorrection.h index dfa03a3c8158..a089da79f487 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/CalibrationMethods/JMSCorrection.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/CalibrationMethods/JMSCorrection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef JETCALIBTOOLS_JMSCORRECTION_H @@ -76,7 +76,7 @@ class JMSCorrection // Control the binning using a private class enum enum class BinningParam { pt_mass_eta, e_LOGmOe_eta, e_LOGmOet_eta, e_LOGmOpt_eta, et_LOGmOet_eta }; - BinningParam m_binParam; + BinningParam m_binParam = BinningParam::pt_mass_eta; // Check if we are reading 2D or 3D histograms // Defaults to false for backwards compatibility -- GitLab From 5c5f9a3b78148d722a688e4037902a3a8defb28b Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Fri, 13 Dec 2024 10:20:44 +0100 Subject: [PATCH 2/4] initialise members --- .../JetCalibTools/JetCalibrationTool.h | 40 +++++++++---------- .../JetCalibTools/Root/JetCalibrationTool.cxx | 5 +-- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h index e5c490b0daa5..048ed73927ce 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h @@ -1,7 +1,7 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // JetCalibrationTool.h @@ -75,42 +75,42 @@ private: std::string m_calibSeq; std::string m_calibAreaTag; std::string m_originScale; - bool m_devMode; - bool m_isData; - bool m_timeDependentCalib; - bool m_originCorrectedClusters; - bool m_useNjetInResidual; - float m_nJetThreshold; + bool m_devMode{}; + bool m_isData{true}; + bool m_timeDependentCalib{}; + bool m_originCorrectedClusters{}; + bool m_useNjetInResidual{}; + float m_nJetThreshold{}; std::string m_nJetContainerName; std::string m_dir; std::string m_eInfoName; std::vector<TString> m_timeDependentInsituConfigs; std::vector<double> m_runBins; - bool m_doSetDetectorEta; - bool m_insituCombMassCalib; + bool m_doSetDetectorEta{}; + bool m_insituCombMassCalib{}; std::vector<TString> m_insituCombMassConfig; //TEnv to hold the global text config - TEnv * m_globalConfig; + TEnv * m_globalConfig{}; std::vector<TEnv*> m_globalTimeDependentConfigs; std::vector<TEnv*> m_globalInsituCombMassConfig; //Bools/enums to avoid string comparisons at run time - jetScale m_jetScale; - bool m_doBcid; - bool m_doJetArea; - bool m_doResidual; - bool m_doOrigin; - bool m_doGSC; - bool m_doDNNCal; + jetScale m_jetScale = jetScale::EM; + bool m_doBcid{true}; + bool m_doJetArea{true}; + bool m_doResidual{true}; + bool m_doOrigin{true}; + bool m_doGSC{true}; + bool m_doDNNCal{}; - std::string m_gscDepth; // if not set then use the one defined in the config + std::string m_gscDepth("auto"); // if not set then use the one defined in the config std::vector<std::unique_ptr<JetCalibrationStep> > m_calibSteps; - int m_smearIndex; + int m_smearIndex{-1}; // Try to use jet-attribute-specified origin vertex for calibration - bool m_useOriginVertex; + bool m_useOriginVertex{}; }; #endif //> !JETCALIBTOOLS_APPLYJETCALIBRATION_H diff --git a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx index 77cdf541189a..03deca328f3e 100644 --- a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx +++ b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx @@ -25,10 +25,7 @@ #include "AthContainers/ConstAccessor.h" JetCalibrationTool::JetCalibrationTool(const std::string& name) - : asg::AsgTool( name ), - m_jetAlgo(""), m_config(""), m_calibSeq(""), m_calibAreaTag(""), m_originScale(""), m_devMode(false), - m_isData(true), m_timeDependentCalib(false), m_dir(""), m_eInfoName(""), m_globalConfig(nullptr), - m_doBcid(true), m_doJetArea(true), m_doResidual(true), m_doOrigin(true), m_doGSC(true), m_doDNNCal(false), m_gscDepth("auto"), m_smearIndex(-1), m_useOriginVertex(false) + : asg::AsgTool( name ) { declareProperty( "JetCollection", m_jetAlgo = "AntiKt4LCTopo" ); declareProperty( "ConfigFile", m_config = "" ); -- GitLab From d3f218572b0078f61273cbfcfb3f21fc119a6421 Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Fri, 13 Dec 2024 10:25:54 +0100 Subject: [PATCH 3/4] const ref argument --- .../Jet/JetCalibTools/JetCalibTools/SmearingCalibStep.h | 4 ++-- Reconstruction/Jet/JetCalibTools/src/SmearingCalibStep.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/SmearingCalibStep.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/SmearingCalibStep.h index 8868efc12cf0..1a3034046dab 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/SmearingCalibStep.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/SmearingCalibStep.h @@ -52,7 +52,7 @@ class SmearingCalibStep ToolHandle<JetHelper::IVarTool> m_histToolData {this, "HistoReaderData", "HistoInput2D", "Instance of HistoInput1D or HistoInput2D for reading histogram for data"}; // Helper methods - StatusCode getSigmaSmear(xAOD::Jet& jet, JetHelper::JetContext jc, double& sigmaSmear) const; + StatusCode getSigmaSmear(xAOD::Jet& jet, const JetHelper::JetContext & jc, double& sigmaSmear) const; StatusCode getNominalResolution(const xAOD::Jet& jet, JetHelper::JetContext jc, double& resolution) const; TRandom3* getTLSRandomGen(unsigned long seed) const; @@ -64,7 +64,7 @@ class SmearingCalibStep Mass, // Mass smearing (JMR) FourVec // Four-vector smearing (JER) }; - SmearType m_smearTypeClass; + SmearType m_smearTypeClass = SmearType::UNKNOWN; mutable boost::thread_specific_ptr<TRandom3> m_rand_tls; // thread-specific random number generator }; diff --git a/Reconstruction/Jet/JetCalibTools/src/SmearingCalibStep.cxx b/Reconstruction/Jet/JetCalibTools/src/SmearingCalibStep.cxx index a7d59deacfc4..464aab7d83a4 100644 --- a/Reconstruction/Jet/JetCalibTools/src/SmearingCalibStep.cxx +++ b/Reconstruction/Jet/JetCalibTools/src/SmearingCalibStep.cxx @@ -65,7 +65,7 @@ TRandom3* SmearingCalibStep::getTLSRandomGen(unsigned long seed) const return random; } -StatusCode SmearingCalibStep::getSigmaSmear(xAOD::Jet& jet, JetHelper::JetContext jc, double& sigmaSmear) const +StatusCode SmearingCalibStep::getSigmaSmear(xAOD::Jet& jet, const JetHelper::JetContext & jc, double& sigmaSmear) const { /* Nominal jet smearing @@ -118,7 +118,7 @@ StatusCode SmearingCalibStep::calibrate(xAOD::JetContainer& jets) const { JetHelper::JetContext jc; - for(const auto jet: jets){ + for(const auto * jet: jets){ const xAOD::JetFourMom_t jetStartP4 = jet->jetP4(); -- GitLab From 5417fd1df523ef7f3f26467fbf618a8aaaf66733 Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Fri, 13 Dec 2024 10:31:20 +0100 Subject: [PATCH 4/4] fix compiler errors --- .../Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h | 2 +- Reconstruction/Jet/JetCalibTools/src/SmearingCalibStep.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h index 048ed73927ce..c2bb29941f94 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h @@ -104,7 +104,7 @@ private: bool m_doGSC{true}; bool m_doDNNCal{}; - std::string m_gscDepth("auto"); // if not set then use the one defined in the config + std::string m_gscDepth{"auto"}; // if not set then use the one defined in the config std::vector<std::unique_ptr<JetCalibrationStep> > m_calibSteps; int m_smearIndex{-1}; diff --git a/Reconstruction/Jet/JetCalibTools/src/SmearingCalibStep.cxx b/Reconstruction/Jet/JetCalibTools/src/SmearingCalibStep.cxx index 464aab7d83a4..f34e13b7eee5 100644 --- a/Reconstruction/Jet/JetCalibTools/src/SmearingCalibStep.cxx +++ b/Reconstruction/Jet/JetCalibTools/src/SmearingCalibStep.cxx @@ -118,7 +118,7 @@ StatusCode SmearingCalibStep::calibrate(xAOD::JetContainer& jets) const { JetHelper::JetContext jc; - for(const auto * jet: jets){ + for(const auto jet: jets){ const xAOD::JetFourMom_t jetStartP4 = jet->jetP4(); -- GitLab