From 579be5a0abe430dcf64a1c012f751b52e6ab5d26 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Wed, 29 May 2024 01:13:55 +0200
Subject: [PATCH] JetToolHelpers: fixed clang warnings

- Missing destructor
- Missing override keyword
- Adding 'const int' to a string does not append to the string
---
 .../Jet/JetToolHelpers/JetToolHelpers/InputVariable.h        | 5 ++++-
 Reconstruction/Jet/JetToolHelpers/JetToolHelpers/VarTool.h   | 2 +-
 Reconstruction/Jet/JetToolHelpers/Root/HistoInputBase.cpp    | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Reconstruction/Jet/JetToolHelpers/JetToolHelpers/InputVariable.h b/Reconstruction/Jet/JetToolHelpers/JetToolHelpers/InputVariable.h
index 532807d0c563..efa92f1598cb 100644
--- a/Reconstruction/Jet/JetToolHelpers/JetToolHelpers/InputVariable.h
+++ b/Reconstruction/Jet/JetToolHelpers/JetToolHelpers/InputVariable.h
@@ -34,13 +34,16 @@ class InputVariable : public IInputVariable
             const bool isJetVar
         );
 
-        // Constructors
+        /// Constructors
         InputVariable(const std::string& name): m_name{name}, m_scale{1.} {}
         InputVariable(
             const std::string& name, 
             std::function<float(const xAOD::Jet& jet, const JetContext& jc)> func
         );
 
+        /// Default destructor
+        virtual ~InputVariable() = default;
+
         /// return the value of the variable choose by the user
         [[nodiscard]] float getValue(const xAOD::Jet& jet, const JetContext& jc) const override {
             return m_scale * getValue_prot(jet, jc);
diff --git a/Reconstruction/Jet/JetToolHelpers/JetToolHelpers/VarTool.h b/Reconstruction/Jet/JetToolHelpers/JetToolHelpers/VarTool.h
index f48bb88d3de6..2d1d0d60c255 100644
--- a/Reconstruction/Jet/JetToolHelpers/JetToolHelpers/VarTool.h
+++ b/Reconstruction/Jet/JetToolHelpers/JetToolHelpers/VarTool.h
@@ -33,7 +33,7 @@ class VarTool : public asg::AsgTool, virtual public IVarTool
         /// Constructor for standalone usage
         VarTool(const std::string& name);
         /// Function initialising the tool
-        virtual StatusCode initialize();
+        virtual StatusCode initialize() override;
         /// return the InputVariable ready to be use 
         const InputVariable * getvar() const {return m_v.get();};
         /// return either xAOD or context variable values
diff --git a/Reconstruction/Jet/JetToolHelpers/Root/HistoInputBase.cpp b/Reconstruction/Jet/JetToolHelpers/Root/HistoInputBase.cpp
index 618d5b434919..dbbf80a49c1a 100644
--- a/Reconstruction/Jet/JetToolHelpers/Root/HistoInputBase.cpp
+++ b/Reconstruction/Jet/JetToolHelpers/Root/HistoInputBase.cpp
@@ -91,7 +91,7 @@ double HistoInputBase::readFromHisto(const double X, const double Y, const doubl
     else if (nDim == 3)
         return m_hist->Interpolate(X,Y,Z);
     // Shouldn't reach here due to previous checks
-    throw std::runtime_error("Unexpected number of dimensions of histogram: " + nDim);
+    throw std::runtime_error("Unexpected number of dimensions of histogram: " + std::to_string(nDim));
     return 0;
 }
 } // namespace JetHelper
-- 
GitLab