From 9cc8c10eabfeaca9e725ccab1d6add4e76d9d396 Mon Sep 17 00:00:00 2001 From: Ivan Razumov Date: Wed, 6 Mar 2024 11:09:32 +0100 Subject: [PATCH 1/3] [ROOTMaster] Fix include for RNTuple* (redo of #44256) --- .../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; }; From eceb51cc76fbe3706e84ea9ff51e43ce16d3e364 Mon Sep 17 00:00:00 2001 From: iarspider Date: Mon, 11 Mar 2024 11:26:05 +0100 Subject: [PATCH 2/3] Update DiMuonVmerge.cc --- Alignment/OfflineValidation/bin/DiMuonVmerge.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/Alignment/OfflineValidation/bin/DiMuonVmerge.cc b/Alignment/OfflineValidation/bin/DiMuonVmerge.cc index 7f9d4575f1363..7c522b8472067 100644 --- a/Alignment/OfflineValidation/bin/DiMuonVmerge.cc +++ b/Alignment/OfflineValidation/bin/DiMuonVmerge.cc @@ -15,6 +15,7 @@ #include "TString.h" #include "TASImage.h" +#include "TGraph.h" #include "Alignment/OfflineValidation/macros/loopAndPlot.C" #include "Alignment/OfflineValidation/interface/TkAlStyle.h" From dc416f2152970a8e648e7a25ef6be3071672a07e Mon Sep 17 00:00:00 2001 From: iarspider Date: Tue, 12 Mar 2024 10:07:14 +0100 Subject: [PATCH 3/3] Update loopAndPlot.C --- Alignment/OfflineValidation/macros/loopAndPlot.C | 1 + 1 file changed, 1 insertion(+) diff --git a/Alignment/OfflineValidation/macros/loopAndPlot.C b/Alignment/OfflineValidation/macros/loopAndPlot.C index 9052ae3a41097..e75ecb8e903c5 100644 --- a/Alignment/OfflineValidation/macros/loopAndPlot.C +++ b/Alignment/OfflineValidation/macros/loopAndPlot.C @@ -4,6 +4,7 @@ #include "TDirectory.h" #include "TFile.h" #include "TGaxis.h" +#include "TGraph.h" #include "TH1.h" #include "TH2.h" #include "TKey.h"