From 1a9b301dbbb0c070b15183a7e1ea537fe922110e Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 14 Mar 2024 17:14:44 +0100 Subject: [PATCH] Transparently introduce CovMatrix components --- tests/src/ComparisonUtils.h | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/src/ComparisonUtils.h b/tests/src/ComparisonUtils.h index 267d36d5..51933ad7 100644 --- a/tests/src/ComparisonUtils.h +++ b/tests/src/ComparisonUtils.h @@ -7,6 +7,12 @@ #include "edm4hep/Vector2i.h" #include "edm4hep/Vector3d.h" #include "edm4hep/Vector3f.h" +#if __has_include("edm4hep/CovMatrix3f.h") +#include +#include +#include +#include +#endif #include "UTIL/LCIterator.h" #include "EVENT/LCCollection.h" @@ -74,9 +80,21 @@ constexpr bool isAnyOf = (std::is_same_v || ...); template bool compareValuesNanSafe(LCIO lcioV, EDM4hepT edm4hepV, const std::string& msg) { - constexpr auto isVectorLike = - has_size_method::value || - isAnyOf; + constexpr auto isVectorLike = has_size_method::value || isAnyOf< + EDM4hepT, + edm4hep::Vector3f, + edm4hep::Vector3d, + edm4hep::Vector2f, + edm4hep::Vector2i, +#if __has_include("edm4hep/CovMatrix3f.h") + // These also effectively behave like vectors for + // the purposes of this function + edm4hep::CovMatrix2f, + edm4hep::CovMatrix3f, + edm4hep::CovMatrix4f, + edm4hep::CovMatrix6f +#endif + >; if constexpr (isVectorLike) { const auto vecSize = [&edm4hepV]() -> std::size_t {