From 72644a26ecc363a97e0f955d0914d319f10c3bd8 Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:59:38 +0100 Subject: [PATCH] Fix warnings related to the ROOTFrameReader and ROOTFrameWriter (#180) --- k4FWCore/components/PodioOutput.cpp | 2 +- k4FWCore/components/PodioOutput.h | 10 +++++++++- k4FWCore/include/k4FWCore/PodioDataSvc.h | 10 +++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/k4FWCore/components/PodioOutput.cpp b/k4FWCore/components/PodioOutput.cpp index f5d55906..ea11fa68 100644 --- a/k4FWCore/components/PodioOutput.cpp +++ b/k4FWCore/components/PodioOutput.cpp @@ -38,7 +38,7 @@ StatusCode PodioOutput::initialize() { return StatusCode::FAILURE; } - m_framewriter = std::make_unique(m_filename); + m_framewriter = std::make_unique(m_filename); m_switch = KeepDropSwitch(m_outputCommands); return StatusCode::SUCCESS; diff --git a/k4FWCore/components/PodioOutput.h b/k4FWCore/components/PodioOutput.h index 16d40898..16066004 100644 --- a/k4FWCore/components/PodioOutput.h +++ b/k4FWCore/components/PodioOutput.h @@ -22,7 +22,15 @@ #include "GaudiAlg/GaudiAlgorithm.h" #include "k4FWCore/KeepDropSwitch.h" #include "podio/CollectionBase.h" +#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 @@ -56,7 +64,7 @@ class PodioOutput : public GaudiAlgorithm { KeepDropSwitch m_switch; PodioDataSvc* m_podioDataSvc; /// The actual ROOT frame writer - std::unique_ptr m_framewriter; + std::unique_ptr m_framewriter; /// The stored collections std::vector m_storedCollections; /// The collections to write out diff --git a/k4FWCore/include/k4FWCore/PodioDataSvc.h b/k4FWCore/include/k4FWCore/PodioDataSvc.h index d5030bed..e64b4626 100644 --- a/k4FWCore/include/k4FWCore/PodioDataSvc.h +++ b/k4FWCore/include/k4FWCore/PodioDataSvc.h @@ -26,7 +26,15 @@ #include "podio/CollectionBase.h" #include "podio/CollectionIDTable.h" #include "podio/Frame.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 // Forward declarations #include "k4FWCore/DataWrapper.h" class DataWrapperBase; @@ -95,7 +103,7 @@ class PodioDataSvc : public DataSvc { private: /// PODIO reader for ROOT files - podio::ROOTFrameReader m_reader; + podio::ROOTReader m_reader; /// PODIO Frame, used to initialise collections podio::Frame m_eventframe; /// PODIO Frame, used to store metadata