Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ROOTMaster] Fix include for RNTuple* (redo of #44256) #44328

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Alignment/OfflineValidation/bin/DiMuonVmerge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "TString.h"
#include "TASImage.h"
#include "TGraph.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After root-project/root#14891 TGraph.h is not incuded any more through TRatioPlot.h, indirectly included here with the inclusion of Alignment/OfflineValidation/macros/loopAndPlot.C.

However, also in Alignment/OfflineValidation/macros/loopAndPlot.C itself the inclusion of TGraph.h is now needed, for the same reason. I would therefore profit of this PR to fix also Alignment/OfflineValidation/macros/loopAndPlot.C


#include "Alignment/OfflineValidation/macros/loopAndPlot.C"
#include "Alignment/OfflineValidation/interface/TkAlStyle.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@

#include <ROOT/RNTuple.hxx>
#include <ROOT/RNTupleModel.hxx>
#include <ROOT/RNTupleOptions.hxx>
#include <ROOT/RPageStorageFile.hxx>
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<RNTupleWriter>
#include <ROOT/RNTupleOptions.hxx>
#else
using ROOT::Experimental::Internal::RPageSinkFile;
#define MakeRNTupleWriter ROOT::Experimental::Internal::CreateRNTupleWriter
#include <ROOT/RNTupleWriteOptions.hxx>
#endif
using ROOT::Experimental::RNTupleWriteOptions;

#include "TObjString.h"

Expand Down
8 changes: 5 additions & 3 deletions PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTuples.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@

#include <ROOT/RNTuple.hxx>
#include <ROOT/RNTupleModel.hxx>
#include <ROOT/RNTupleOptions.hxx>
#include <ROOT/RPageStorageFile.hxx>
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<RNTupleWriter>
#include <ROOT/RNTupleOptions.hxx>
#else
using ROOT::Experimental::Internal::RPageSinkFile;
#define MakeRNTupleWriter ROOT::Experimental::Internal::CreateRNTupleWriter
#include <ROOT/RNTupleWriteOptions.hxx>
#endif
using ROOT::Experimental::RNTupleWriteOptions;

#include "RNTupleFieldPtr.h"
#include "SummaryTableOutputFields.h"
Expand Down
14 changes: 14 additions & 0 deletions PhysicsTools/NanoAOD/plugins/rntuple/NanoAODRNTuples.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@

#include "TFile.h"
#include <ROOT/RNTuple.hxx>
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0)
using ROOT::Experimental::RCollectionNTupleWriter;
#else
#include <ROOT/RNTupleWriter.hxx>
#include <ROOT/RNTupleCollectionWriter.hxx>
using ROOT::Experimental::RNTupleCollectionWriter;
#endif
using ROOT::Experimental::RNTupleWriter;

#include "EventStringOutputFields.h"
Expand Down Expand Up @@ -64,7 +70,11 @@ class PSetNTuple {
// https://github.com/root-project/root/issues/7861
// RNTupleFieldPtr<edm::ParameterSetID> m_psetId;
// RNTupleFieldPtr<edm::ParameterSetBlob> m_psetBlob;
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0)
std::shared_ptr<RCollectionNTupleWriter> m_collection;
#else
std::shared_ptr<RNTupleCollectionWriter> m_collection;
#endif
RNTupleFieldPtr<std::string> m_psetId;
RNTupleFieldPtr<std::string> m_psetBlob;
std::unique_ptr<RNTupleWriter> m_ntuple;
Expand All @@ -78,7 +88,11 @@ class MetadataNTuple {

private:
void createFields(TFile& file);
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0)
std::shared_ptr<RCollectionNTupleWriter> m_procHist;
#else
std::shared_ptr<RNTupleCollectionWriter> m_procHist;
#endif

RNTupleFieldPtr<std::string> m_phId;
std::unique_ptr<RNTupleWriter> m_ntuple;
Expand Down
9 changes: 9 additions & 0 deletions PhysicsTools/NanoAOD/plugins/rntuple/TableOutputFields.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@

#include <ROOT/RNTuple.hxx>
#include <ROOT/RNTupleModel.hxx>
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0)
using ROOT::Experimental::RCollectionNTupleWriter;
#else
#include <ROOT/RNTupleCollectionWriter.hxx>
using ROOT::Experimental::RNTupleCollectionWriter;
#endif
using ROOT::Experimental::RNTupleModel;
using ROOT::Experimental::RNTupleWriter;

Expand Down Expand Up @@ -110,7 +115,11 @@ class TableCollection {

private:
std::string m_collectionName;
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0)
std::shared_ptr<RCollectionNTupleWriter> m_collection;
#else
std::shared_ptr<RNTupleCollectionWriter> m_collection;
#endif
TableOutputFields m_main;
std::vector<TableOutputFields> m_extensions;
};
Expand Down