Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparently introduce CovMatrix components #56

Merged
merged 1 commit into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading