Skip to content

Commit

Permalink
Merge branch 'main' into particleid-reversal
Browse files Browse the repository at this point in the history
  • Loading branch information
hegner authored May 1, 2024
2 parents 4f907aa + a3dc779 commit ab48dd8
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions tests/src/ComparisonUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
#include "edm4hep/Vector2i.h"
#include "edm4hep/Vector3d.h"
#include "edm4hep/Vector3f.h"
#if __has_include("edm4hep/CovMatrix3f.h")
#include <edm4hep/CovMatrix3f.h>
#include <edm4hep/CovMatrix2f.h>
#include <edm4hep/CovMatrix4f.h>
#include <edm4hep/CovMatrix6f.h>
#endif

#include "UTIL/LCIterator.h"
#include "EVENT/LCCollection.h"
Expand Down Expand Up @@ -74,9 +80,22 @@ constexpr bool isAnyOf = (std::is_same_v<T, Ts> || ...);
template<typename LCIO, typename EDM4hepT>
bool compareValuesNanSafe(LCIO lcioV, EDM4hepT edm4hepV, const std::string& msg)
{
constexpr auto isVectorLike =
has_size_method<EDM4hepT>::value ||
isAnyOf<EDM4hepT, edm4hep::Vector3f, edm4hep::Vector3d, edm4hep::Vector2f, edm4hep::Vector2i>;
constexpr auto isVectorLike = has_size_method<EDM4hepT>::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 {
Expand Down

0 comments on commit ab48dd8

Please sign in to comment.