From 1fb0396847c4ff1ff1abc90432de51d2247efab8 Mon Sep 17 00:00:00 2001 From: Jakob Blomer Date: Fri, 23 Feb 2024 15:11:25 +0100 Subject: [PATCH] Fixes for latest RNTuple changes (#285) * adjust RNTuple benchmarks to latest interface changes * use RC2 RNTuple data file --- root/tree/dataframe/CMakeLists.txt | 2 +- root/tree/dataframe/RNTupleDSBenchmarks.cxx | 6 +++--- root/tree/tree/CMakeLists.txt | 2 +- root/tree/tree/RNTupleH1Benchmarks.cxx | 9 +++------ root/tree/tree/RNTupleLHCBBenchmarks.cxx | 4 ++-- root/tree/tree/gen_h1.cxx | 5 ++--- 6 files changed, 12 insertions(+), 16 deletions(-) diff --git a/root/tree/dataframe/CMakeLists.txt b/root/tree/dataframe/CMakeLists.txt index 3c7be022b..019506ffb 100644 --- a/root/tree/dataframe/CMakeLists.txt +++ b/root/tree/dataframe/CMakeLists.txt @@ -63,7 +63,7 @@ if(rootbench-datafiles) RB_ADD_GBENCHMARK(RNTupleDSBenchmarks RNTupleDSBenchmarks.cxx LIBRARIES Core Hist RIO TreePlayer ROOTNTuple ROOTDataFrame - DOWNLOAD_DATAFILES B2HHH~none.ntuple + DOWNLOAD_DATAFILES B2HHH~none.rc2.ntuple LABEL short) endif() endif() diff --git a/root/tree/dataframe/RNTupleDSBenchmarks.cxx b/root/tree/dataframe/RNTupleDSBenchmarks.cxx index 300ea90e7..057daaa42 100644 --- a/root/tree/dataframe/RNTupleDSBenchmarks.cxx +++ b/root/tree/dataframe/RNTupleDSBenchmarks.cxx @@ -1,5 +1,5 @@ -#include #include +#include #include #include @@ -58,10 +58,10 @@ auto Dataframe(DF &frame) static void BM_RNTupleDS_LHCB(benchmark::State &state) { - auto ntuple = ROOT::Experimental::RNTupleReader::Open("DecayTree", RB::GetDataDir() + "/B2HHH~none.ntuple"); + auto ntuple = ROOT::Experimental::RNTupleReader::Open("DecayTree", RB::GetDataDir() + "/B2HHH~none.rc2.ntuple"); const Long64_t nEntries = ntuple->GetNEntries() * (state.range(0) / 100.); - auto df = ROOT::RDF::Experimental::FromRNTuple("DecayTree", RB::GetDataDir() + "/B2HHH~none.ntuple"); + ROOT::RDataFrame df(RB::GetDataDir() + "/B2HHH~none.rc2.ntuple", "DecayTree"); auto df2 = df.Range(nEntries); auto h_ptr = Dataframe(df2); for (auto _ : state) diff --git a/root/tree/tree/CMakeLists.txt b/root/tree/tree/CMakeLists.txt index 551539d06..7dcf434f8 100644 --- a/root/tree/tree/CMakeLists.txt +++ b/root/tree/tree/CMakeLists.txt @@ -37,5 +37,5 @@ if(ROOT_root7_FOUND AND rootbench-datafiles) RNTupleLHCBBenchmarks.cxx LABEL short LIBRARIES Core Hist MathCore RIO Tree ROOTNTuple - DOWNLOAD_DATAFILES B2HHH~none.ntuple) + DOWNLOAD_DATAFILES B2HHH~none.rc2.ntuple) endif(ROOT_root7_FOUND AND rootbench-datafiles) diff --git a/root/tree/tree/RNTupleH1Benchmarks.cxx b/root/tree/tree/RNTupleH1Benchmarks.cxx index 8e17719e6..565fe3b10 100644 --- a/root/tree/tree/RNTupleH1Benchmarks.cxx +++ b/root/tree/tree/RNTupleH1Benchmarks.cxx @@ -1,10 +1,7 @@ #include #include -#include -#include -#include -#include +#include #include #include @@ -40,13 +37,13 @@ static void BM_RNTuple_H1(benchmark::State &state, const std::string &comprAlgor auto ipiView = ntuple->GetView("event.ipi"); auto ipisView = ntuple->GetView("event.ipis"); auto md0_dView = ntuple->GetView("event.md0_d"); - auto trackView = ntuple->GetViewCollection("event.tracks"); + auto trackView = ntuple->GetCollectionView("event.tracks"); auto nhitrpView = ntuple->GetView("event.tracks._0.nhitrp"); auto rstartView = ntuple->GetView("event.tracks._0.rstart"); auto rendView = ntuple->GetView("event.tracks._0.rend"); auto nlhkView = ntuple->GetView("event.tracks._0.nlhk"); auto nlhpiView = ntuple->GetView("event.tracks._0.nlhpi"); - auto njetsView = ntuple->GetViewCollection("event.jets"); + auto njetsView = ntuple->GetCollectionView("event.jets"); // Check print info (minitest) std::ostringstream os; ntuple->PrintInfo(ROOT::Experimental::ENTupleInfo::kSummary, os); diff --git a/root/tree/tree/RNTupleLHCBBenchmarks.cxx b/root/tree/tree/RNTupleLHCBBenchmarks.cxx index e25565399..0e2e97eb5 100644 --- a/root/tree/tree/RNTupleLHCBBenchmarks.cxx +++ b/root/tree/tree/RNTupleLHCBBenchmarks.cxx @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -22,7 +22,7 @@ static void BM_RNTuple_LHCB(benchmark::State &state) { using RNTupleReader = ROOT::Experimental::RNTupleReader; - auto ntuple = RNTupleReader::Open("DecayTree", RB::GetDataDir() + "/B2HHH~none.ntuple"); + auto ntuple = RNTupleReader::Open("DecayTree", RB::GetDataDir() + "/B2HHH~none.rc2.ntuple"); auto viewH1IsMuon = ntuple->GetView("H1_isMuon"); auto viewH2IsMuon = ntuple->GetView("H2_isMuon"); auto viewH3IsMuon = ntuple->GetView("H3_isMuon"); diff --git a/root/tree/tree/gen_h1.cxx b/root/tree/tree/gen_h1.cxx index c0f7424e9..a31d301e3 100644 --- a/root/tree/tree/gen_h1.cxx +++ b/root/tree/tree/gen_h1.cxx @@ -1,7 +1,6 @@ -#include -#include #include -#include +#include +#include #include #include