From b8f4523a44831da9262f20952f1653e5c3df366f Mon Sep 17 00:00:00 2001 From: Andres Rios Tascon Date: Thu, 12 Sep 2024 13:29:36 -0400 Subject: [PATCH] Added new RNTuple test file (#159) --- dev/make-root/rntuple_index_multicluster.C | 34 ++++++++++++++++++ .../data/test_ntuple_index_multicluster.root | Bin 0 -> 2261 bytes 2 files changed, 34 insertions(+) create mode 100644 dev/make-root/rntuple_index_multicluster.C create mode 100644 src/skhep_testdata/data/test_ntuple_index_multicluster.root diff --git a/dev/make-root/rntuple_index_multicluster.C b/dev/make-root/rntuple_index_multicluster.C new file mode 100644 index 0000000..5f317c3 --- /dev/null +++ b/dev/make-root/rntuple_index_multicluster.C @@ -0,0 +1,34 @@ +/* https://root.cern/doc/master/ntpl001__staff_8C.html */ + +#include + +R__LOAD_LIBRARY(ROOTNTuple) +#include +#include +#include +#include +#include +#include + +using RNTupleModel = ROOT::Experimental::RNTupleModel; +using RNTupleWriter = ROOT::Experimental::RNTupleWriter; +using RNTupleWriteOptions = ROOT::Experimental::RNTupleWriteOptions; + +void rntuple_index_multicluster() { + auto options = RNTupleWriteOptions(); + options.SetApproxUnzippedPageSize(512); + options.SetApproxZippedClusterSize(1000); + options.SetMaxUnzippedClusterSize(1024); + + std::string rootFileName{"test_ntuple_index_multicluster.root"}; + auto model = RNTupleModel::Create(); + auto int_vector = model->MakeField>("int_vector"); + auto ntuple = + RNTupleWriter::Recreate(std::move(model), "ntuple", rootFileName, options); + for(int16_t j=0; j<2; j++){ + for(int16_t i=0; i<100; i++){ + *int_vector = {i, static_cast(i+j)}; + ntuple->Fill(); + } + } +} diff --git a/src/skhep_testdata/data/test_ntuple_index_multicluster.root b/src/skhep_testdata/data/test_ntuple_index_multicluster.root new file mode 100644 index 0000000000000000000000000000000000000000..43e14182500631e0ea106b6149f601bbb7ee3f5d GIT binary patch literal 2261 zcmd5;YfO_@7(QQVYaxgYRxDR*1yn8tsaC86Dgng8xRi>OaVhW>DfWWx2P-0s5LAXm z5s@)e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