Skip to content

Commit 1fb0396

Browse files
authored
Fixes for latest RNTuple changes (#285)
* adjust RNTuple benchmarks to latest interface changes * use RC2 RNTuple data file
1 parent 61211af commit 1fb0396

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

root/tree/dataframe/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if(rootbench-datafiles)
6363
RB_ADD_GBENCHMARK(RNTupleDSBenchmarks
6464
RNTupleDSBenchmarks.cxx
6565
LIBRARIES Core Hist RIO TreePlayer ROOTNTuple ROOTDataFrame
66-
DOWNLOAD_DATAFILES B2HHH~none.ntuple
66+
DOWNLOAD_DATAFILES B2HHH~none.rc2.ntuple
6767
LABEL short)
6868
endif()
6969
endif()

root/tree/dataframe/RNTupleDSBenchmarks.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include <ROOT/RNTuple.hxx>
21
#include <ROOT/RNTupleDS.hxx>
2+
#include <ROOT/RNTupleReader.hxx>
33
#include <ROOT/RDataFrame.hxx>
44

55
#include <benchmark/benchmark.h>
@@ -58,10 +58,10 @@ auto Dataframe(DF &frame)
5858

5959
static void BM_RNTupleDS_LHCB(benchmark::State &state)
6060
{
61-
auto ntuple = ROOT::Experimental::RNTupleReader::Open("DecayTree", RB::GetDataDir() + "/B2HHH~none.ntuple");
61+
auto ntuple = ROOT::Experimental::RNTupleReader::Open("DecayTree", RB::GetDataDir() + "/B2HHH~none.rc2.ntuple");
6262
const Long64_t nEntries = ntuple->GetNEntries() * (state.range(0) / 100.);
6363

64-
auto df = ROOT::RDF::Experimental::FromRNTuple("DecayTree", RB::GetDataDir() + "/B2HHH~none.ntuple");
64+
ROOT::RDataFrame df(RB::GetDataDir() + "/B2HHH~none.rc2.ntuple", "DecayTree");
6565
auto df2 = df.Range(nEntries);
6666
auto h_ptr = Dataframe(df2);
6767
for (auto _ : state)

root/tree/tree/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ if(ROOT_root7_FOUND AND rootbench-datafiles)
3737
RNTupleLHCBBenchmarks.cxx
3838
LABEL short
3939
LIBRARIES Core Hist MathCore RIO Tree ROOTNTuple
40-
DOWNLOAD_DATAFILES B2HHH~none.ntuple)
40+
DOWNLOAD_DATAFILES B2HHH~none.rc2.ntuple)
4141
endif(ROOT_root7_FOUND AND rootbench-datafiles)

root/tree/tree/RNTupleH1Benchmarks.cxx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#include <benchmark/benchmark.h>
22

33
#include <ROOT/RDataFrame.hxx>
4-
#include <ROOT/RNTuple.hxx>
5-
#include <ROOT/RNTupleDS.hxx>
6-
#include <ROOT/RNTupleOptions.hxx>
7-
#include <ROOT/RNTupleView.hxx>
4+
#include <ROOT/RNTupleReader.hxx>
85

96
#include <TCanvas.h>
107
#include <TChain.h>
@@ -40,13 +37,13 @@ static void BM_RNTuple_H1(benchmark::State &state, const std::string &comprAlgor
4037
auto ipiView = ntuple->GetView<std::int32_t>("event.ipi");
4138
auto ipisView = ntuple->GetView<std::int32_t>("event.ipis");
4239
auto md0_dView = ntuple->GetView<float>("event.md0_d");
43-
auto trackView = ntuple->GetViewCollection("event.tracks");
40+
auto trackView = ntuple->GetCollectionView("event.tracks");
4441
auto nhitrpView = ntuple->GetView<std::int32_t>("event.tracks._0.nhitrp");
4542
auto rstartView = ntuple->GetView<float>("event.tracks._0.rstart");
4643
auto rendView = ntuple->GetView<float>("event.tracks._0.rend");
4744
auto nlhkView = ntuple->GetView<float>("event.tracks._0.nlhk");
4845
auto nlhpiView = ntuple->GetView<float>("event.tracks._0.nlhpi");
49-
auto njetsView = ntuple->GetViewCollection("event.jets");
46+
auto njetsView = ntuple->GetCollectionView("event.jets");
5047
// Check print info (minitest)
5148
std::ostringstream os;
5249
ntuple->PrintInfo(ROOT::Experimental::ENTupleInfo::kSummary, os);

root/tree/tree/RNTupleLHCBBenchmarks.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <ROOT/RNTuple.hxx>
1+
#include <ROOT/RNTupleReader.hxx>
22
#include <TH1D.h>
33
#include <benchmark/benchmark.h>
44
#include <rootbench/RBConfig.h>
@@ -22,7 +22,7 @@ static void BM_RNTuple_LHCB(benchmark::State &state)
2222
{
2323
using RNTupleReader = ROOT::Experimental::RNTupleReader;
2424

25-
auto ntuple = RNTupleReader::Open("DecayTree", RB::GetDataDir() + "/B2HHH~none.ntuple");
25+
auto ntuple = RNTupleReader::Open("DecayTree", RB::GetDataDir() + "/B2HHH~none.rc2.ntuple");
2626
auto viewH1IsMuon = ntuple->GetView<int>("H1_isMuon");
2727
auto viewH2IsMuon = ntuple->GetView<int>("H2_isMuon");
2828
auto viewH3IsMuon = ntuple->GetView<int>("H3_isMuon");

root/tree/tree/gen_h1.cxx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#include <ROOT/RField.hxx>
2-
#include <ROOT/RNTuple.hxx>
31
#include <ROOT/RNTupleModel.hxx>
4-
#include <ROOT/RNTupleOptions.hxx>
2+
#include <ROOT/RNTupleWriteOptions.hxx>
3+
#include <ROOT/RNTupleWriter.hxx>
54

65
#include <TBranch.h>
76
#include <TCanvas.h>

0 commit comments

Comments
 (0)