From e5cddc86bf86fe20badb59ff85cdbb258f560bbc Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 27 Jun 2024 12:55:04 +0200 Subject: [PATCH 1/2] Switch to new vertex functionality --- .../include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp | 2 +- tests/src/CompareEDM4hepLCIO.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp index c488122..be7192b 100644 --- a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp +++ b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp @@ -419,7 +419,7 @@ std::unique_ptr convertVertices(const edm4hep::VertexColl for (const auto& edm_vertex : (*edmCollection)) { if (edm_vertex.isAvailable()) { auto* lcio_vertex = new lcio::VertexImpl(); - lcio_vertex->setPrimary(edm_vertex.getPrimary()); + lcio_vertex->setPrimary(edm_vertex.isPrimary()); lcio_vertex->setAlgorithmType(std::to_string(edm_vertex.getAlgorithmType())); lcio_vertex->setChi2(edm_vertex.getChi2()); lcio_vertex->setProbability(TMath::Prob(edm_vertex.getChi2(), edm_vertex.getNdf())); diff --git a/tests/src/CompareEDM4hepLCIO.cc b/tests/src/CompareEDM4hepLCIO.cc index 7c61b26..ec2bf2d 100644 --- a/tests/src/CompareEDM4hepLCIO.cc +++ b/tests/src/CompareEDM4hepLCIO.cc @@ -3,6 +3,8 @@ #include "IMPL/TrackerHitImpl.h" +#include "edm4hep/EDM4hepVersion.h" + #include #include "TMath.h" @@ -408,8 +410,7 @@ bool compare(const lcio::LCCollection* lcioCollection, const edm4hep::TrackerHit // ================= Vertex ================ bool compare(const EVENT::Vertex* lcioElem, const edm4hep::Vertex& edm4hepElem, const ObjectMappings& objectMaps) { - // LCIO has isPrimary (bool), EDM4hep has getPrimary (int32_t) - ASSERT_COMPARE_VALS(lcioElem->isPrimary(), edm4hepElem.getPrimary(), "primary in Vertex"); + ASSERT_COMPARE(lcioElem, edm4hepElem, isPrimary, "primary in Vertex"); ASSERT_COMPARE(lcioElem, edm4hepElem, getChi2, "chi2 in Vertex"); ASSERT_COMPARE_VALS_FLOAT(lcioElem->getProbability(), TMath::Prob(edm4hepElem.getChi2(), edm4hepElem.getNdf()), 1e-6, "probability in Vertex"); From 973faf48c6c863fe9575b502b33ce1d73dcc27df Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Thu, 27 Jun 2024 12:58:53 +0200 Subject: [PATCH 2/2] Remove unnecessary header --- tests/src/CompareEDM4hepLCIO.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/src/CompareEDM4hepLCIO.cc b/tests/src/CompareEDM4hepLCIO.cc index ec2bf2d..a95c146 100644 --- a/tests/src/CompareEDM4hepLCIO.cc +++ b/tests/src/CompareEDM4hepLCIO.cc @@ -3,8 +3,6 @@ #include "IMPL/TrackerHitImpl.h" -#include "edm4hep/EDM4hepVersion.h" - #include #include "TMath.h"