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 0000000..43e1418 Binary files /dev/null and b/src/skhep_testdata/data/test_ntuple_index_multicluster.root differ