From b64d99125dd70b9db9203187c462c5abf5d0d7bb Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 22 Feb 2024 10:43:05 +0100 Subject: [PATCH] Use preprocessor macros and a typedef --- standalone/src/DelphesMain.h | 10 +++++----- tests/src/compare_delphes_converter_outputs.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/standalone/src/DelphesMain.h b/standalone/src/DelphesMain.h index 6f10334..b2369a0 100644 --- a/standalone/src/DelphesMain.h +++ b/standalone/src/DelphesMain.h @@ -3,10 +3,14 @@ #include "k4SimDelphes/DelphesEDM4HepOutputConfiguration.h" #include "podio/Frame.h" -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) +#include "podio/podioVersion.h" +#if PODIO_BUILD_VERSION >= PODIO_VERSION(0, 99, 0) #include "podio/ROOTReader.h" #else #include "podio/ROOTFrameWriter.h" +namespace podio { + using ROOTWriter = podio::ROOTFrameWriter; +} #endif #include "ExRootAnalysis/ExRootConfReader.h" @@ -20,11 +24,7 @@ static bool interrupted = false; void SignalHandler(int /*si*/) { interrupted = true; } -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) template int doit(int argc, char* argv[], DelphesInputReader& inputReader) { -#else -template int doit(int argc, char* argv[], DelphesInputReader& inputReader) { -#endif using namespace k4SimDelphes; // We can't make this a unique_ptr because it interferes with whatever ROOT is diff --git a/tests/src/compare_delphes_converter_outputs.cpp b/tests/src/compare_delphes_converter_outputs.cpp index c23a7c6..1fd4e53 100644 --- a/tests/src/compare_delphes_converter_outputs.cpp +++ b/tests/src/compare_delphes_converter_outputs.cpp @@ -6,10 +6,14 @@ #include "edm4hep/utils/kinematics.h" #include "podio/Frame.h" -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) +#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 "ExRootAnalysis/ExRootTreeBranch.h" @@ -333,11 +337,7 @@ void compareMET(const TClonesArray* delphesColl, const edm4hep::ReconstructedPar int main(int argc, char* argv[]) { // do the necessary setup work for podio and delphes first -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) podio::ROOTReader reader{}; -#else - podio::ROOTFrameReader reader{}; -#endif reader.openFile(argv[1]); auto chain = std::make_unique("Delphes");