From bd7474978bf51e3afdaab71df8541dee9f513c63 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 2 May 2024 21:14:01 +0200 Subject: [PATCH 1/5] Fix narrowing from int to float in Cov3f --- k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp b/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp index d49ede8..2691a5c 100644 --- a/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp +++ b/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp @@ -36,12 +36,12 @@ namespace LCIO2EDM4hepConv { covMatrix[12], covMatrix[13], covMatrix[14], - 0, - 0, - 0, - 0, - 0, - 0}; + 0.f, + 0.f, + 0.f, + 0.f, + 0.f, + 0.f}; return edmtrackState; } From 672c4182633c7550b26d23ba5385a585c1cc559c Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 2 May 2024 21:14:17 +0200 Subject: [PATCH 2/5] Fix warnings --- k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp | 2 +- tests/src/ComparisonUtils.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp b/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp index 2691a5c..85fd53c 100644 --- a/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp +++ b/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp @@ -76,7 +76,7 @@ namespace LCIO2EDM4hepConv { std::vector getPIDMetaInfo(const EVENT::LCCollection* recoColl) { std::vector pidInfos {}; - const auto pidHandler = UTIL::PIDHandler(recoColl); + auto pidHandler = UTIL::PIDHandler(recoColl); for (const auto id : pidHandler.getAlgorithmIDs()) { pidInfos.emplace_back(pidHandler.getAlgorithmName(id), id, pidHandler.getParameterNames(id)); } diff --git a/tests/src/ComparisonUtils.h b/tests/src/ComparisonUtils.h index 2454c4a..8ab5596 100644 --- a/tests/src/ComparisonUtils.h +++ b/tests/src/ComparisonUtils.h @@ -98,7 +98,7 @@ bool compareValuesNanSafe(LCIO lcioV, EDM4hepT edm4hepV, const std::string& msg) >; if constexpr (isVectorLike) { - const auto vecSize = [&edm4hepV]() -> std::size_t { + const auto vecSize = [](EDM4hepT& edm4hepV) -> std::size_t { if constexpr (has_size_method::value) { return edm4hepV.size(); } @@ -109,7 +109,7 @@ bool compareValuesNanSafe(LCIO lcioV, EDM4hepT edm4hepV, const std::string& msg) return 2; } return 0; - }(); + }(edm4hepV); for (size_t i = 0; i < vecSize; ++i) { if (!nanSafeComp(lcioV[i], edm4hepV[i])) { std::cerr << msg << " at index " << i << ": (LCIO: " << (lcioV) << ", EDM4hep: " << (edm4hepV) << ")" From b0ce3e2e4afe7016e791a3f7a4b0fa4c5d262b1e Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 2 May 2024 21:23:18 +0200 Subject: [PATCH 3/5] Fix style --- .../include/k4EDM4hep2LcioConv/MappingUtils.h | 6 ++--- k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp | 24 +++---------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/MappingUtils.h b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/MappingUtils.h index 6e60d84..b91db47 100644 --- a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/MappingUtils.h +++ b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/MappingUtils.h @@ -58,8 +58,7 @@ namespace k4EDM4hep2LcioConv { /// Helper struct to determine the key and mapped types for map-like types or /// maps template>> - struct map_t_helper { - }; + struct map_t_helper {}; template struct map_t_helper> { @@ -89,8 +88,7 @@ namespace k4EDM4hep2LcioConv { /// Helper struct to determine the Mutable type for a user facing type /// NOTE: Not SFINAE safe for anything that is not a podio generated class template>> - struct mutable_t_helper { - }; + struct mutable_t_helper {}; template struct mutable_t_helper> { diff --git a/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp b/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp index 85fd53c..b778a32 100644 --- a/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp +++ b/k4EDM4hep2LcioConv/src/k4Lcio2EDM4hepConv.cpp @@ -21,27 +21,9 @@ namespace LCIO2EDM4hepConv { edmtrackState.referencePoint = Vector3fFrom({refPoint[0], refPoint[1], refPoint[2]}); const auto& covMatrix = trackState->getCovMatrix(); edmtrackState.covMatrix = { - covMatrix[0], - covMatrix[1], - covMatrix[2], - covMatrix[3], - covMatrix[4], - covMatrix[5], - covMatrix[6], - covMatrix[7], - covMatrix[8], - covMatrix[9], - covMatrix[10], - covMatrix[11], - covMatrix[12], - covMatrix[13], - covMatrix[14], - 0.f, - 0.f, - 0.f, - 0.f, - 0.f, - 0.f}; + covMatrix[0], covMatrix[1], covMatrix[2], covMatrix[3], covMatrix[4], covMatrix[5], covMatrix[6], + covMatrix[7], covMatrix[8], covMatrix[9], covMatrix[10], covMatrix[11], covMatrix[12], covMatrix[13], + covMatrix[14], 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; return edmtrackState; } From fc55469041c7a82a3dbb2c2e151cc16488e42026 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Fri, 3 May 2024 09:29:06 +0200 Subject: [PATCH 4/5] Avoid forward declaration to make CI work --- tests/src/ObjectMapping.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/src/ObjectMapping.h b/tests/src/ObjectMapping.h index 9e472f1..0f36276 100644 --- a/tests/src/ObjectMapping.h +++ b/tests/src/ObjectMapping.h @@ -1,9 +1,12 @@ #ifndef K4EDM4HEP2LCIOCONV_TEST_OBJECTMAPPINGS_H #define K4EDM4HEP2LCIOCONV_TEST_OBJECTMAPPINGS_H -#include +#include + #include "podio/ObjectID.h" +#include + namespace EVENT { class Track; class TrackerHit; @@ -25,10 +28,6 @@ namespace podio { class Frame; } // namespace podio -namespace edm4hep { - class ParticleID; -} - struct ObjectMappings { template using Map = std::unordered_map; @@ -46,7 +45,7 @@ struct ObjectMappings { Map tpcHits {}; Map vertices {}; - std::unordered_map particleIDs; + std::unordered_map particleIDs {}; static ObjectMappings fromEvent(EVENT::LCEvent* lcEvt, const podio::Frame& edmEvt); }; From e9aaeef49be35e5ea46eb7d7f0a14c2d469217cd Mon Sep 17 00:00:00 2001 From: tmadlener Date: Fri, 3 May 2024 09:31:08 +0200 Subject: [PATCH 5/5] Fix style --- .../include/k4EDM4hep2LcioConv/MappingUtils.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/MappingUtils.h b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/MappingUtils.h index b91db47..6e60d84 100644 --- a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/MappingUtils.h +++ b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/MappingUtils.h @@ -58,7 +58,8 @@ namespace k4EDM4hep2LcioConv { /// Helper struct to determine the key and mapped types for map-like types or /// maps template>> - struct map_t_helper {}; + struct map_t_helper { + }; template struct map_t_helper> { @@ -88,7 +89,8 @@ namespace k4EDM4hep2LcioConv { /// Helper struct to determine the Mutable type for a user facing type /// NOTE: Not SFINAE safe for anything that is not a podio generated class template>> - struct mutable_t_helper {}; + struct mutable_t_helper { + }; template struct mutable_t_helper> {