diff --git a/DDDigi/io/DigiEdm4hepInput.cpp b/DDDigi/io/DigiEdm4hepInput.cpp index cc18acb62..45f2acd4d 100644 --- a/DDDigi/io/DigiEdm4hepInput.cpp +++ b/DDDigi/io/DigiEdm4hepInput.cpp @@ -16,12 +16,16 @@ #include "DigiIO.h" // podio/edm4hep include files -#include -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) +#include +#if PODIO_BUILD_VERSION >= PODIO_VERSION(0, 99, 0) #include #else #include +namespace podio { + using ROOTReader = podio::ROOTFrameReader; +} #endif +#include #include #include @@ -51,11 +55,7 @@ namespace dd4hep { const podio::CollectionBase* get(const std::string& nam) const { return frame.get(nam); } }; -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) using reader_t = podio::ROOTReader; -#else - using reader_t = podio::ROOTFrameReader; -#endif using frame_t = edm4hep_read_frame_t; /// EDM4HEP Digi input reader: Collection descriptor definition diff --git a/DDDigi/io/DigiEdm4hepOutput.cpp b/DDDigi/io/DigiEdm4hepOutput.cpp index 477ae16c9..591f34324 100644 --- a/DDDigi/io/DigiEdm4hepOutput.cpp +++ b/DDDigi/io/DigiEdm4hepOutput.cpp @@ -20,11 +20,14 @@ #include "DigiIO.h" /// edm4hep include files -#include -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) +#include +#if PODIO_BUILD_VERSION >= PODIO_VERSION(0, 99, 0) #include #else #include +namespace podio { + using ROOTWriter = podio::ROOTFrameWriter; +} #endif #include #include @@ -53,11 +56,7 @@ namespace dd4hep { using headercollection_t = std::pair >; DigiEdm4hepOutput* m_parent { nullptr }; /// Reference to podio writer -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) std::unique_ptr m_writer { }; -#else - std::unique_ptr m_writer { }; -#endif /// edm4hep event header collection headercollection_t m_header { }; /// MC particle collection @@ -197,11 +196,7 @@ namespace dd4hep { clear(); m_writer.reset(); std::string fname = m_parent->next_stream_name(); -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) m_writer = std::make_unique(fname); -#else - m_writer = std::make_unique(fname); -#endif m_parent->info("+++ Opened EDM4HEP output file %s", fname.c_str()); } diff --git a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp index 7745bab06..228531d66 100644 --- a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp +++ b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp @@ -26,13 +26,16 @@ #include #include /// podio include files +#include #include -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) +#if PODIO_BUILD_VERSION >= PODIO_VERSION(0, 99, 0) #include #else #include +namespace podio { + using ROOTWriter = podio::ROOTFrameWriter; +} #endif -#include /// Namespace for the AIDA detector description toolkit namespace dd4hep { @@ -52,11 +55,7 @@ namespace dd4hep { */ class Geant4Output2EDM4hep : public Geant4OutputAction { protected: -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) using writer_t = podio::ROOTWriter; -#else - using writer_t = podio::ROOTFrameWriter; -#endif using stringmap_t = std::map< std::string, std::string >; using trackermap_t = std::map< std::string, edm4hep::SimTrackerHitCollection >; using calorimeterpair_t = std::pair< edm4hep::SimCalorimeterHitCollection, edm4hep::CaloHitContributionCollection >; @@ -246,11 +245,7 @@ void Geant4Output2EDM4hep::beginRun(const G4Run* run) { } } if ( !fname.empty() ) { -#if PODIO_VERSION_MAJOR > 0 || (PODIO_VERSION_MAJOR == 0 && PODIO_VERSION_MINOR >= 99) m_file = std::make_unique(fname); -#else - m_file = std::make_unique(fname); -#endif if ( !m_file ) { fatal("+++ Failed to open output file: %s", fname.c_str()); }