From 69b1323e35aa24a778991eb86cb37b58c6bb4d28 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 2 Jul 2024 10:56:46 +0200 Subject: [PATCH 1/2] Delete the version checks for Podio before 1.0 --- .../k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.h | 5 ---- .../k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp | 30 ------------------- standalone/lcio2edm4hep.cpp | 8 ----- tests/compare_contents.cpp | 8 ----- 4 files changed, 51 deletions(-) diff --git a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.h b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.h index 2a3b9d3..d6ad3a0 100644 --- a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.h +++ b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.h @@ -37,7 +37,6 @@ using TrackerHit3D = edm4hep::TrackerHit; #include #include "podio/Frame.h" -#include "podio/podioVersion.h" // LCIO #include @@ -76,11 +75,7 @@ using ObjectMapT = k4EDM4hep2LcioConv::VecMapT; template using vec_pair [[deprecated("Use a more descriptive alias")]] = ObjectMapT; -#if PODIO_BUILD_VERSION > PODIO_VERSION(0, 99, 0) using CellIDStrType = const std::optional; -#else -using CellIDStrType = const std::string; -#endif struct CollectionsPairVectors { ObjectMapT tracks{}; diff --git a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp index ed8fe4c..7ec024c 100644 --- a/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp +++ b/k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp @@ -77,15 +77,9 @@ std::unique_ptr convertTrackerHits(const edm4hep::Tracker TrackerHitMapT& trackerHitMap) { auto trackerhits = std::make_unique(lcio::LCIO::TRACKERHIT); -#if PODIO_BUILD_VERSION > PODIO_VERSION(0, 99, 0) if (cellIDstr.has_value()) { lcio::CellIDEncoder idEnc(cellIDstr.value(), trackerhits.get()); } -#else - if (!cellIDstr.empty()) { - lcio::CellIDEncoder idEnc(cellIDstr, trackerhits.get()); - } -#endif // Loop over EDM4hep trackerhits converting them to lcio trackerhits for (const auto& edm_trh : (*edmColection)) { @@ -122,15 +116,9 @@ convertTrackerHitPlanes(const edm4hep::TrackerHitPlaneCollection* const edmColle TrackerHitPlaneMapT& trackerHitsMap) { auto trackerHitPlanes = std::make_unique(lcio::LCIO::TRACKERHITPLANE); -#if PODIO_BUILD_VERSION > PODIO_VERSION(0, 99, 0) if (cellIDstr.has_value()) { lcio::CellIDEncoder idEnc(cellIDstr.value(), trackerHitPlanes.get()); } -#else - if (!cellIDstr.empty()) { - lcio::CellIDEncoder idEnc(cellIDstr, trackerHitPlanes.get()); - } -#endif for (const auto& edm_trh : (*edmCollection)) { if (edm_trh.isAvailable()) { @@ -172,15 +160,9 @@ convertSimTrackerHits(const edm4hep::SimTrackerHitCollection* const edmCollectio SimTrHitMapT& simTrHitMap) { auto simtrackerhits = std::make_unique(lcio::LCIO::SIMTRACKERHIT); -#if PODIO_BUILD_VERSION > PODIO_VERSION(0, 99, 0) if (cellIDstr.has_value()) { lcio::CellIDEncoder idEnc(cellIDstr.value(), simtrackerhits.get()); } -#else - if (!cellIDstr.empty()) { - lcio::CellIDEncoder idEnc(cellIDstr, simtrackerhits.get()); - } -#endif // Loop over EDM4hep simtrackerhits converting them to LCIO simtrackerhits for (const auto& edm_strh : (*edmCollection)) { @@ -222,15 +204,9 @@ convertCalorimeterHits(const edm4hep::CalorimeterHitCollection* const edmCollect CaloHitMapT& caloHitMap) { auto calohits = std::make_unique(lcio::LCIO::CALORIMETERHIT); -#if PODIO_BUILD_VERSION > PODIO_VERSION(0, 99, 0) if (cellIDstr.has_value()) { lcio::CellIDEncoder idEnc(cellIDstr.value(), calohits.get()); } -#else - if (!cellIDstr.empty()) { - lcio::CellIDEncoder idEnc(cellIDstr, calohits.get()); - } -#endif for (const auto& edm_calohit : (*edmCollection)) { if (edm_calohit.isAvailable()) { @@ -296,15 +272,9 @@ convertSimCalorimeterHits(const edm4hep::SimCalorimeterHitCollection* const edmC const CellIDStrType& cellIDstr, SimCaloHitMapT& simCaloHitMap) { auto simcalohits = std::make_unique(lcio::LCIO::SIMCALORIMETERHIT); -#if PODIO_BUILD_VERSION > PODIO_VERSION(0, 99, 0) if (cellIDstr.has_value()) { lcio::CellIDEncoder idEnc(cellIDstr.value(), simcalohits.get()); } -#else - if (!cellIDstr.empty()) { - lcio::CellIDEncoder idEnc(cellIDstr, simcalohits.get()); - } -#endif for (const auto& edm_sim_calohit : (*edmCollection)) { if (edm_sim_calohit.isAvailable()) { diff --git a/standalone/lcio2edm4hep.cpp b/standalone/lcio2edm4hep.cpp index 8479311..78c4722 100644 --- a/standalone/lcio2edm4hep.cpp +++ b/standalone/lcio2edm4hep.cpp @@ -6,15 +6,7 @@ #include -#include "podio/podioVersion.h" -#if PODIO_BUILD_VERSION >= PODIO_VERSION(0, 99, 0) #include "podio/ROOTWriter.h" -#else -#include "podio/ROOTFrameWriter.h" -namespace podio { -using ROOTWriter = podio::ROOTFrameWriter; -} -#endif #include #include diff --git a/tests/compare_contents.cpp b/tests/compare_contents.cpp index 6fc480c..67d5bc3 100644 --- a/tests/compare_contents.cpp +++ b/tests/compare_contents.cpp @@ -1,15 +1,7 @@ #include "CompareEDM4hepLCIO.h" #include "ObjectMapping.h" -#include "podio/podioVersion.h" -#if PODIO_BUILD_VERSION >= PODIO_VERSION(0, 99, 0) #include "podio/ROOTReader.h" -#else -#include "podio/ROOTFrameReader.h" -namespace podio { -using ROOTReader = podio::ROOTFrameReader; -} -#endif #include "podio/Frame.h" From ac496849495ac06f958d1b0d336708b361d3837f Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Sat, 10 Aug 2024 18:56:59 +0200 Subject: [PATCH 2/2] Add a requirement for podio 1.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 559e957..0068a08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ include(cmake/build_flags.cmake) k4edm4hep2lcioconv_set_compiler_flags() find_package(LCIO 2.20.1 REQUIRED) -find_package(podio REQUIRED) +find_package(podio 1.0 REQUIRED) find_package(EDM4HEP 0.99 REQUIRED) find_package(ROOT REQUIRED COMPONENTS MathCore)