Skip to content

Commit

Permalink
Merge pull request cms-sw#44328 from iarspider/redo-44256
Browse files Browse the repository at this point in the history
[ROOTMaster] Fix include for RNTuple* (redo of cms-sw#44256)
  • Loading branch information
cmsbuild authored Mar 13, 2024
2 parents 9df6fad + dc416f2 commit 980274e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
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"

#include "Alignment/OfflineValidation/macros/loopAndPlot.C"
#include "Alignment/OfflineValidation/interface/TkAlStyle.h"
Expand Down
1 change: 1 addition & 0 deletions Alignment/OfflineValidation/macros/loopAndPlot.C
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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

0 comments on commit 980274e

Please sign in to comment.