From c730a32096f8fc739762bf8e2d30eeb4cae0609b Mon Sep 17 00:00:00 2001 From: Ivan Razumov Date: Wed, 28 Feb 2024 10:38:51 +0100 Subject: [PATCH] [ROOTMaster] Fix include for RNTupleWriterOptions after root-project/root#14799 --- .../plugins/rntuple/NanoAODRNTupleOutputModule.cc | 8 +++++--- .../NanoAOD/plugins/rntuple/NanoAODRNTuples.cc | 8 +++++--- .../NanoAOD/plugins/rntuple/NanoAODRNTuples.h | 14 ++++++++++++++ .../NanoAOD/plugins/rntuple/TableOutputFields.h | 9 +++++++++ 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTupleOutputModule.cc b/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTupleOutputModule.cc index 25b0c4e9c0768..ea56c81c17d64 100644 --- a/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTupleOutputModule.cc +++ b/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTupleOutputModule.cc @@ -15,17 +15,19 @@ #include #include -#include #include using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::Detail::RPageSinkFile; #if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0) using ROOT::Experimental::RNTupleWriter; +using ROOT::Experimental::Detail::RPageSinkFile; #define MakeRNTupleWriter std::make_unique +#include #else +using ROOT::Experimental::Internal::RPageSinkFile; #define MakeRNTupleWriter ROOT::Experimental::Internal::CreateRNTupleWriter +#include #endif +using ROOT::Experimental::RNTupleWriteOptions; #include "TObjString.h" diff --git a/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTuples.cc b/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTuples.cc index a98c146cb9a19..86c367bb95898 100644 --- a/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTuples.cc +++ b/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTuples.cc @@ -5,17 +5,19 @@ #include #include -#include #include using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::Detail::RPageSinkFile; #if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0) using ROOT::Experimental::RNTupleWriter; +using ROOT::Experimental::Detail::RPageSinkFile; #define MakeRNTupleWriter std::make_unique +#include #else +using ROOT::Experimental::Internal::RPageSinkFile; #define MakeRNTupleWriter ROOT::Experimental::Internal::CreateRNTupleWriter +#include #endif +using ROOT::Experimental::RNTupleWriteOptions; #include "RNTupleFieldPtr.h" #include "SummaryTableOutputFields.h" diff --git a/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTuples.h b/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTuples.h index d80b0ab59b0f2..65843adafe94c 100644 --- a/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTuples.h +++ b/PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTuples.h @@ -12,7 +12,13 @@ #include "TFile.h" #include +#if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0) using ROOT::Experimental::RCollectionNTupleWriter; +#else +#include +#include +using ROOT::Experimental::RNTupleCollectionWriter; +#endif using ROOT::Experimental::RNTupleWriter; #include "EventStringOutputFields.h" @@ -64,7 +70,11 @@ class PSetNTuple { // https://github.com/root-project/root/issues/7861 // RNTupleFieldPtr m_psetId; // RNTupleFieldPtr m_psetBlob; +#if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0) std::shared_ptr m_collection; +#else + std::shared_ptr m_collection; +#endif RNTupleFieldPtr m_psetId; RNTupleFieldPtr m_psetBlob; std::unique_ptr m_ntuple; @@ -78,7 +88,11 @@ class MetadataNTuple { private: void createFields(TFile& file); +#if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0) std::shared_ptr m_procHist; +#else + std::shared_ptr m_procHist; +#endif RNTupleFieldPtr m_phId; std::unique_ptr m_ntuple; diff --git a/PhysicsTools/NanoAOD/plugins/rntuple/TableOutputFields.h b/PhysicsTools/NanoAOD/plugins/rntuple/TableOutputFields.h index 5e907dce6b5ed..457e00991ff2d 100644 --- a/PhysicsTools/NanoAOD/plugins/rntuple/TableOutputFields.h +++ b/PhysicsTools/NanoAOD/plugins/rntuple/TableOutputFields.h @@ -11,7 +11,12 @@ #include #include +#if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0) using ROOT::Experimental::RCollectionNTupleWriter; +#else +#include +using ROOT::Experimental::RNTupleCollectionWriter; +#endif using ROOT::Experimental::RNTupleModel; using ROOT::Experimental::RNTupleWriter; @@ -110,7 +115,11 @@ class TableCollection { private: std::string m_collectionName; +#if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0) std::shared_ptr m_collection; +#else + std::shared_ptr m_collection; +#endif TableOutputFields m_main; std::vector m_extensions; };