From a113c634408127d848cecdc6f01aeed7601e92b9 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Mon, 30 Mar 2026 13:51:20 +0200 Subject: [PATCH 1/6] Switch to stable API in ROOT 6.36 In a first step, change all using declarations to the ROOT namespace, rename EColumnType -> ENTupleColumnType, and update method calls from GetSubFields() to GetMutableSubfields(). structure/feature_flag/write.C needs some additional changes because it uses the Internal API. --- .github/workflows/root.yml | 6 +-- README.md | 7 ++-- compression/algorithms/write_algorithm.hxx | 10 ++--- compression/block/big/write.C | 10 ++--- compression/block/short/write.C | 10 ++--- compression/read_compression.hxx | 4 +- projections/cardinality/read.C | 4 +- projections/cardinality/write.C | 20 +++++----- projections/collection/read.C | 4 +- projections/collection/write.C | 8 ++-- projections/leaf/read.C | 4 +- projections/leaf/write.C | 8 ++-- projections/nested/read.C | 4 +- projections/nested/write.C | 8 ++-- structure/cluster_groups/write.C | 6 +-- structure/clusters/write.C | 6 +-- structure/empty/write.C | 6 +-- structure/feature_flag/write.C | 20 +++++----- structure/read_structure.hxx | 4 +- types/RVec/fundamental/read.C | 4 +- types/RVec/fundamental/write.C | 20 +++++----- types/RVec/nested/read.C | 4 +- types/RVec/nested/write.C | 22 +++++------ types/array/read.C | 4 +- types/array/write.C | 6 +-- types/atomic/read.C | 4 +- types/atomic/write.C | 6 +-- types/bitset/read.C | 4 +- types/bitset/write.C | 6 +-- types/fundamental/integer/read.C | 4 +- types/fundamental/integer/write.C | 40 ++++++++++---------- types/fundamental/misc/read.C | 4 +- types/fundamental/misc/write.C | 18 ++++----- types/fundamental/real/read.C | 4 +- types/fundamental/real/write.C | 28 +++++++------- types/fundamental/real32quant/read.C | 4 +- types/fundamental/real32quant/write.C | 9 ++--- types/fundamental/real32trunc/read.C | 4 +- types/fundamental/real32trunc/write.C | 10 ++--- types/map/fundamental/read.C | 4 +- types/map/fundamental/write.C | 20 +++++----- types/map/nested/read.C | 4 +- types/map/nested/write.C | 25 ++++++------ types/multimap/fundamental/read.C | 4 +- types/multimap/fundamental/write.C | 20 +++++----- types/multimap/nested/read.C | 4 +- types/multimap/nested/write.C | 25 ++++++------ types/multiset/fundamental/read.C | 4 +- types/multiset/fundamental/write.C | 20 +++++----- types/multiset/nested/read.C | 4 +- types/multiset/nested/write.C | 22 +++++------ types/optional/read.C | 4 +- types/optional/write.C | 20 +++++----- types/pair/read.C | 4 +- types/pair/write.C | 6 +-- types/set/fundamental/read.C | 4 +- types/set/fundamental/write.C | 20 +++++----- types/set/nested/read.C | 4 +- types/set/nested/write.C | 22 +++++------ types/string/read.C | 4 +- types/string/write.C | 22 +++++------ types/tuple/read.C | 4 +- types/tuple/write.C | 6 +-- types/unique_ptr/read.C | 4 +- types/unique_ptr/write.C | 20 +++++----- types/unordered_map/fundamental/read.C | 4 +- types/unordered_map/fundamental/write.C | 20 +++++----- types/unordered_map/nested/read.C | 4 +- types/unordered_map/nested/write.C | 25 ++++++------ types/unordered_multimap/fundamental/read.C | 4 +- types/unordered_multimap/fundamental/write.C | 20 +++++----- types/unordered_multimap/nested/read.C | 4 +- types/unordered_multimap/nested/write.C | 25 ++++++------ types/unordered_multiset/fundamental/read.C | 4 +- types/unordered_multiset/fundamental/write.C | 20 +++++----- types/unordered_multiset/nested/read.C | 4 +- types/unordered_multiset/nested/write.C | 22 +++++------ types/unordered_set/fundamental/read.C | 4 +- types/unordered_set/fundamental/write.C | 20 +++++----- types/unordered_set/nested/read.C | 4 +- types/unordered_set/nested/write.C | 22 +++++------ types/user/class/read.C | 4 +- types/user/class/write.C | 6 +-- types/user/enum/read.C | 4 +- types/user/enum/write.C | 6 +-- types/variant/read.C | 4 +- types/variant/write.C | 6 +-- types/vector/fundamental/read.C | 4 +- types/vector/fundamental/write.C | 20 +++++----- types/vector/nested/read.C | 4 +- types/vector/nested/write.C | 22 +++++------ 91 files changed, 471 insertions(+), 469 deletions(-) diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml index 91360c1..89c8d69 100644 --- a/.github/workflows/root.yml +++ b/.github/workflows/root.yml @@ -5,10 +5,10 @@ on: pull_request: jobs: - root-v634: - name: ROOT 6.34 + root-v636: + name: ROOT 6.36 runs-on: ubuntu-latest - container: rootproject/root:6.34.00-ubuntu24.04 + container: rootproject/root:6.36.00-ubuntu25.04 steps: - name: Check out repository uses: actions/checkout@v5 diff --git a/README.md b/README.md index dbd36f3..b13bff5 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,9 @@ More tests are planned in the future, please [consult the list of issues](https: ## Reference Implementation This repository also contains a reference implementation with ROOT macros. -They currently target ROOT v6.34 with the first official version of the RNTuple on-disk binary format. -In this release, the API is not yet finalized and all classes are in the `ROOT::Experimental` namespace. -We rely on this version to produce a first set of reference files that can be used to test backwards compatibility. -Afterwards, the implementation will be updated for the stable API (available since ROOT v6.36). +They target the stable API released with ROOT v6.36 and should work on newer versions. +Compatibility with ROOT v6.34 can be tested with version v1.0 of the RNTuple Validation Suite. +It was the first official version of the RNTuple on-disk binary format, but the API was not yet finalized and all classes were in the `ROOT::Experimental` namespace. ### How to Run diff --git a/compression/algorithms/write_algorithm.hxx b/compression/algorithms/write_algorithm.hxx index 177f64b..85c372d 100644 --- a/compression/algorithms/write_algorithm.hxx +++ b/compression/algorithms/write_algorithm.hxx @@ -3,10 +3,10 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -17,7 +17,7 @@ void write_algorithm(std::string_view filename, std::uint32_t compression) { auto Int64 = model->MakeField("Int64"); model->GetMutableField("Int64").SetColumnRepresentatives( - {{EColumnType::kSplitInt64}}); + {{ENTupleColumnType::kSplitInt64}}); RNTupleWriteOptions options; options.SetCompression(compression); diff --git a/compression/block/big/write.C b/compression/block/big/write.C index 79152da..bdd5b85 100644 --- a/compression/block/big/write.C +++ b/compression/block/big/write.C @@ -3,10 +3,10 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -17,7 +17,7 @@ void write(std::string_view filename = "compression.block.big.root") { auto Int64 = model->MakeField("Int64"); model->GetMutableField("Int64").SetColumnRepresentatives( - {{EColumnType::kSplitInt64}}); + {{ENTupleColumnType::kSplitInt64}}); RNTupleWriteOptions options; // Crank up the zstd compression level to reduce the output file size by diff --git a/compression/block/short/write.C b/compression/block/short/write.C index e262002..97c2a24 100644 --- a/compression/block/short/write.C +++ b/compression/block/short/write.C @@ -3,10 +3,10 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -17,7 +17,7 @@ void write(std::string_view filename = "compression.block.short.root") { auto Int64 = model->MakeField("Int64"); model->GetMutableField("Int64").SetColumnRepresentatives( - {{EColumnType::kSplitInt64}}); + {{ENTupleColumnType::kSplitInt64}}); RNTupleWriteOptions options; options.SetCompression(505); diff --git a/compression/read_compression.hxx b/compression/read_compression.hxx index 141d031..0a1e7fe 100644 --- a/compression/read_compression.hxx +++ b/compression/read_compression.hxx @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/projections/cardinality/read.C b/projections/cardinality/read.C index 573e611..8079386 100644 --- a/projections/cardinality/read.C +++ b/projections/cardinality/read.C @@ -2,8 +2,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/projections/cardinality/write.C b/projections/cardinality/write.C index 146878d..edb2a8c 100644 --- a/projections/cardinality/write.C +++ b/projections/cardinality/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -20,7 +20,7 @@ using Vector = std::vector; static std::shared_ptr MakeVectorField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -41,14 +41,14 @@ void write(std::string_view filename = "projections.cardinality.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeVectorField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeVectorField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeVectorField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeVectorField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeVectorField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeVectorField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeVectorField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeVectorField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); // Create RNTupleCardinality projections AddProjectedCardinalityField(*model, "Index32Cardinality", diff --git a/projections/collection/read.C b/projections/collection/read.C index 25ebea5..9c2152e 100644 --- a/projections/collection/read.C +++ b/projections/collection/read.C @@ -2,8 +2,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/projections/collection/write.C b/projections/collection/write.C index e7a96b8..a2b7e22 100644 --- a/projections/collection/write.C +++ b/projections/collection/write.C @@ -4,10 +4,10 @@ #include #include -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/projections/leaf/read.C b/projections/leaf/read.C index 6abb391..8140b0f 100644 --- a/projections/leaf/read.C +++ b/projections/leaf/read.C @@ -2,8 +2,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/projections/leaf/write.C b/projections/leaf/write.C index 905e4f2..7e3fc0c 100644 --- a/projections/leaf/write.C +++ b/projections/leaf/write.C @@ -3,10 +3,10 @@ #include #include -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/projections/nested/read.C b/projections/nested/read.C index 2395788..fceb13b 100644 --- a/projections/nested/read.C +++ b/projections/nested/read.C @@ -2,8 +2,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/projections/nested/write.C b/projections/nested/write.C index 39ae6e5..400af7b 100644 --- a/projections/nested/write.C +++ b/projections/nested/write.C @@ -4,10 +4,10 @@ #include #include -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/structure/cluster_groups/write.C b/structure/cluster_groups/write.C index a066b5d..a7aec5a 100644 --- a/structure/cluster_groups/write.C +++ b/structure/cluster_groups/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/structure/clusters/write.C b/structure/clusters/write.C index ddaa34c..fe969e8 100644 --- a/structure/clusters/write.C +++ b/structure/clusters/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/structure/empty/write.C b/structure/empty/write.C index 055d33c..600fe2a 100644 --- a/structure/empty/write.C +++ b/structure/empty/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/structure/feature_flag/write.C b/structure/feature_flag/write.C index efcdf1e..3fddb4f 100644 --- a/structure/feature_flag/write.C +++ b/structure/feature_flag/write.C @@ -8,13 +8,13 @@ #include #include -using ROOT::Experimental::RFieldZero; -using ROOT::Experimental::RNTupleDescriptor; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::Internal::RFieldDescriptorBuilder; -using ROOT::Experimental::Internal::RNTupleDescriptorBuilder; -using ROOT::Experimental::Internal::RNTupleFileWriter; -using ROOT::Experimental::Internal::RNTupleSerializer; +using ROOT::RFieldZero; +using ROOT::RNTupleDescriptor; +using ROOT::RNTupleWriteOptions; +using ROOT::Internal::RFieldDescriptorBuilder; +using ROOT::Internal::RNTupleDescriptorBuilder; +using ROOT::Internal::RNTupleFileWriter; +using ROOT::Internal::RNTupleSerializer; void write(std::string_view filename = "structure.feature_flag.root") { // Note that we are writing a file with a so-far unused feature flag. This @@ -40,13 +40,13 @@ void write(std::string_view filename = "structure.feature_flag.root") { RNTupleSerializer serializer; - auto ctx = serializer.SerializeHeader(nullptr, descriptor); + auto ctx = serializer.SerializeHeader(nullptr, descriptor).Unwrap(); auto buffer = std::make_unique(ctx.GetHeaderSize()); - ctx = serializer.SerializeHeader(buffer.get(), descriptor); + ctx = serializer.SerializeHeader(buffer.get(), descriptor).Unwrap(); writer->WriteNTupleHeader(buffer.get(), ctx.GetHeaderSize(), ctx.GetHeaderSize()); - auto szFooter = serializer.SerializeFooter(nullptr, descriptor, ctx); + auto szFooter = serializer.SerializeFooter(nullptr, descriptor, ctx).Unwrap(); buffer = std::make_unique(szFooter); serializer.SerializeFooter(buffer.get(), descriptor, ctx); writer->WriteNTupleFooter(buffer.get(), szFooter, szFooter); diff --git a/structure/read_structure.hxx b/structure/read_structure.hxx index dff1d2c..896c168 100644 --- a/structure/read_structure.hxx +++ b/structure/read_structure.hxx @@ -2,8 +2,8 @@ #include #include -using ROOT::Experimental::RException; -using ROOT::Experimental::RNTupleReader; +using ROOT::RException; +using ROOT::RNTupleReader; #include #include diff --git a/types/RVec/fundamental/read.C b/types/RVec/fundamental/read.C index f1d4400..7004fbd 100644 --- a/types/RVec/fundamental/read.C +++ b/types/RVec/fundamental/read.C @@ -2,8 +2,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/RVec/fundamental/write.C b/types/RVec/fundamental/write.C index a7ae7bd..05c7989 100644 --- a/types/RVec/fundamental/write.C +++ b/types/RVec/fundamental/write.C @@ -5,11 +5,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,7 +19,7 @@ using Vector = ROOT::RVec; static std::shared_ptr MakeVectorField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -30,14 +30,14 @@ void write(std::string_view filename = "types.RVec.fundamental.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeVectorField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeVectorField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeVectorField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeVectorField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeVectorField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeVectorField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeVectorField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeVectorField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/RVec/nested/read.C b/types/RVec/nested/read.C index 7a0977a..1c74ded 100644 --- a/types/RVec/nested/read.C +++ b/types/RVec/nested/read.C @@ -2,8 +2,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/RVec/nested/write.C b/types/RVec/nested/write.C index 6cbbc9e..ed23687 100644 --- a/types/RVec/nested/write.C +++ b/types/RVec/nested/write.C @@ -5,11 +5,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -20,10 +20,10 @@ using Vector = ROOT::RVec; static std::shared_ptr MakeVectorField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); - field->GetSubFields()[0]->SetColumnRepresentatives({{indexType}}); + field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -32,14 +32,14 @@ void write(std::string_view filename = "types.RVec.nested.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeVectorField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeVectorField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeVectorField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeVectorField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeVectorField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeVectorField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeVectorField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeVectorField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/array/read.C b/types/array/read.C index 6c0a72a..003ff1a 100644 --- a/types/array/read.C +++ b/types/array/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/array/write.C b/types/array/write.C index 68be78d..3c89807 100644 --- a/types/array/write.C +++ b/types/array/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/types/atomic/read.C b/types/atomic/read.C index 4cafc1c..e7eb2e6 100644 --- a/types/atomic/read.C +++ b/types/atomic/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include // for std::byte diff --git a/types/atomic/write.C b/types/atomic/write.C index aaaab14..1283220 100644 --- a/types/atomic/write.C +++ b/types/atomic/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include // for std::byte diff --git a/types/bitset/read.C b/types/bitset/read.C index 2000714..f71a21b 100644 --- a/types/bitset/read.C +++ b/types/bitset/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/bitset/write.C b/types/bitset/write.C index 3e81e23..9279d1e 100644 --- a/types/bitset/write.C +++ b/types/bitset/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/types/fundamental/integer/read.C b/types/fundamental/integer/read.C index 39c96a7..eecf00d 100644 --- a/types/fundamental/integer/read.C +++ b/types/fundamental/integer/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/fundamental/integer/write.C b/types/fundamental/integer/write.C index ebd3100..1a9a869 100644 --- a/types/fundamental/integer/write.C +++ b/types/fundamental/integer/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -18,7 +18,7 @@ using ROOT::Experimental::RNTupleWriter; template static std::shared_ptr MakeFundamentalField(RNTupleModel &model, std::string_view name, - EColumnType type) { + ENTupleColumnType type) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{type}}); model.AddField(std::move(field)); @@ -29,37 +29,37 @@ void write(std::string_view filename = "types.fundamental.integer.root") { auto model = RNTupleModel::Create(); auto Int8 = - MakeFundamentalField(*model, "Int8", EColumnType::kInt8); + MakeFundamentalField(*model, "Int8", ENTupleColumnType::kInt8); auto UInt8 = - MakeFundamentalField(*model, "UInt8", EColumnType::kUInt8); + MakeFundamentalField(*model, "UInt8", ENTupleColumnType::kUInt8); // Non-split integer encoding auto Int16 = - MakeFundamentalField(*model, "Int16", EColumnType::kInt16); + MakeFundamentalField(*model, "Int16", ENTupleColumnType::kInt16); auto UInt16 = MakeFundamentalField(*model, "UInt16", - EColumnType::kUInt16); + ENTupleColumnType::kUInt16); auto Int32 = - MakeFundamentalField(*model, "Int32", EColumnType::kInt32); + MakeFundamentalField(*model, "Int32", ENTupleColumnType::kInt32); auto UInt32 = MakeFundamentalField(*model, "UInt32", - EColumnType::kUInt32); + ENTupleColumnType::kUInt32); auto Int64 = - MakeFundamentalField(*model, "Int64", EColumnType::kInt64); + MakeFundamentalField(*model, "Int64", ENTupleColumnType::kInt64); auto UInt64 = MakeFundamentalField(*model, "UInt64", - EColumnType::kUInt64); + ENTupleColumnType::kUInt64); // Split integer encoding auto SplitInt16 = MakeFundamentalField( - *model, "SplitInt16", EColumnType::kSplitInt16); + *model, "SplitInt16", ENTupleColumnType::kSplitInt16); auto SplitUInt16 = MakeFundamentalField( - *model, "SplitUInt16", EColumnType::kSplitUInt16); + *model, "SplitUInt16", ENTupleColumnType::kSplitUInt16); auto SplitInt32 = MakeFundamentalField( - *model, "SplitInt32", EColumnType::kSplitInt32); + *model, "SplitInt32", ENTupleColumnType::kSplitInt32); auto SplitUInt32 = MakeFundamentalField( - *model, "SplitUInt32", EColumnType::kSplitUInt32); + *model, "SplitUInt32", ENTupleColumnType::kSplitUInt32); auto SplitInt64 = MakeFundamentalField( - *model, "SplitInt64", EColumnType::kSplitInt64); + *model, "SplitInt64", ENTupleColumnType::kSplitInt64); auto SplitUInt64 = MakeFundamentalField( - *model, "SplitUInt64", EColumnType::kSplitUInt64); + *model, "SplitUInt64", ENTupleColumnType::kSplitUInt64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/fundamental/misc/read.C b/types/fundamental/misc/read.C index d86bbcd..f6fa108 100644 --- a/types/fundamental/misc/read.C +++ b/types/fundamental/misc/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include // for std::byte #include diff --git a/types/fundamental/misc/write.C b/types/fundamental/misc/write.C index 45450c5..6149c30 100644 --- a/types/fundamental/misc/write.C +++ b/types/fundamental/misc/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include // for std::byte #include @@ -18,7 +18,7 @@ using ROOT::Experimental::RNTupleWriter; template static std::shared_ptr MakeFundamentalField(RNTupleModel &model, std::string_view name, - EColumnType type) { + ENTupleColumnType type) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{type}}); model.AddField(std::move(field)); @@ -28,10 +28,10 @@ static std::shared_ptr MakeFundamentalField(RNTupleModel &model, void write(std::string_view filename = "types.fundamental.misc.root") { auto model = RNTupleModel::Create(); - auto Bit = MakeFundamentalField(*model, "Bit", EColumnType::kBit); + auto Bit = MakeFundamentalField(*model, "Bit", ENTupleColumnType::kBit); auto Byte = - MakeFundamentalField(*model, "Byte", EColumnType::kByte); - auto Char = MakeFundamentalField(*model, "Char", EColumnType::kChar); + MakeFundamentalField(*model, "Byte", ENTupleColumnType::kByte); + auto Char = MakeFundamentalField(*model, "Char", ENTupleColumnType::kChar); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/fundamental/real/read.C b/types/fundamental/real/read.C index a9c4793..7fa843c 100644 --- a/types/fundamental/real/read.C +++ b/types/fundamental/real/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/fundamental/real/write.C b/types/fundamental/real/write.C index 33e0728..96ee8ef 100644 --- a/types/fundamental/real/write.C +++ b/types/fundamental/real/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -17,7 +17,7 @@ using ROOT::Experimental::RNTupleWriter; template static std::shared_ptr MakeFundamentalField(RNTupleModel &model, std::string_view name, - EColumnType type) { + ENTupleColumnType type) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{type}}); model.AddField(std::move(field)); @@ -29,24 +29,24 @@ void write(std::string_view filename = "types.fundamental.real.root") { // Non-split float encoding auto FloatReal16 = - MakeFundamentalField(*model, "FloatReal16", EColumnType::kReal16); + MakeFundamentalField(*model, "FloatReal16", ENTupleColumnType::kReal16); auto FloatReal32 = - MakeFundamentalField(*model, "FloatReal32", EColumnType::kReal32); + MakeFundamentalField(*model, "FloatReal32", ENTupleColumnType::kReal32); auto DoubleReal16 = MakeFundamentalField(*model, "DoubleReal16", - EColumnType::kReal16); + ENTupleColumnType::kReal16); auto DoubleReal32 = MakeFundamentalField(*model, "DoubleReal32", - EColumnType::kReal32); + ENTupleColumnType::kReal32); auto DoubleReal64 = MakeFundamentalField(*model, "DoubleReal64", - EColumnType::kReal64); + ENTupleColumnType::kReal64); // Split float encoding // NB there is no kSplitReal16 auto FloatSplitReal32 = MakeFundamentalField( - *model, "FloatSplitReal32", EColumnType::kSplitReal32); + *model, "FloatSplitReal32", ENTupleColumnType::kSplitReal32); auto DoubleSplitReal32 = MakeFundamentalField( - *model, "DoubleSplitReal32", EColumnType::kSplitReal32); + *model, "DoubleSplitReal32", ENTupleColumnType::kSplitReal32); auto DoubleSplitReal64 = MakeFundamentalField( - *model, "DoubleSplitReal64", EColumnType::kSplitReal64); + *model, "DoubleSplitReal64", ENTupleColumnType::kSplitReal64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/fundamental/real32quant/read.C b/types/fundamental/real32quant/read.C index 1180ddf..7aea019 100644 --- a/types/fundamental/real32quant/read.C +++ b/types/fundamental/real32quant/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/fundamental/real32quant/write.C b/types/fundamental/real32quant/write.C index 395b734..e17012f 100644 --- a/types/fundamental/real32quant/write.C +++ b/types/fundamental/real32quant/write.C @@ -4,11 +4,10 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/types/fundamental/real32trunc/read.C b/types/fundamental/real32trunc/read.C index 16a7d94..138285e 100644 --- a/types/fundamental/real32trunc/read.C +++ b/types/fundamental/real32trunc/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/fundamental/real32trunc/write.C b/types/fundamental/real32trunc/write.C index de03250..9a75465 100644 --- a/types/fundamental/real32trunc/write.C +++ b/types/fundamental/real32trunc/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/types/map/fundamental/read.C b/types/map/fundamental/read.C index 6197876..91d0cda 100644 --- a/types/map/fundamental/read.C +++ b/types/map/fundamental/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/map/fundamental/write.C b/types/map/fundamental/write.C index 5447f7b..213d6b2 100644 --- a/types/map/fundamental/write.C +++ b/types/map/fundamental/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,7 +19,7 @@ using Map = std::map; static std::shared_ptr MakeMapField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -30,14 +30,14 @@ void write(std::string_view filename = "types.map.fundamental.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMapField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeMapField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeMapField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeMapField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeMapField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeMapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeMapField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeMapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/map/nested/read.C b/types/map/nested/read.C index bd72266..3ac64d0 100644 --- a/types/map/nested/read.C +++ b/types/map/nested/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include diff --git a/types/map/nested/write.C b/types/map/nested/write.C index b63a83f..a7360cb 100644 --- a/types/map/nested/write.C +++ b/types/map/nested/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include @@ -22,11 +22,12 @@ using Map = std::map>; static std::shared_ptr MakeMapField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); - field->GetSubFields()[0]->GetSubFields()[1]->SetColumnRepresentatives( - {{indexType}}); + field->GetMutableSubfields()[0] + ->GetMutableSubfields()[1] + ->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -39,14 +40,14 @@ void write(std::string_view filename = "types.map.nested.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMapField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeMapField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeMapField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeMapField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeMapField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeMapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeMapField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeMapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/multimap/fundamental/read.C b/types/multimap/fundamental/read.C index 441940c..1ec64ee 100644 --- a/types/multimap/fundamental/read.C +++ b/types/multimap/fundamental/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/multimap/fundamental/write.C b/types/multimap/fundamental/write.C index 3ace02e..dc240d4 100644 --- a/types/multimap/fundamental/write.C +++ b/types/multimap/fundamental/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,7 +19,7 @@ using Multimap = std::multimap; static std::shared_ptr MakeMultimapField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -30,14 +30,14 @@ void write(std::string_view filename = "types.multimap.fundamental.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMultimapField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeMultimapField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeMultimapField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeMultimapField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeMultimapField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeMultimapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeMultimapField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeMultimapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/multimap/nested/read.C b/types/multimap/nested/read.C index 74c4580..04989b0 100644 --- a/types/multimap/nested/read.C +++ b/types/multimap/nested/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include diff --git a/types/multimap/nested/write.C b/types/multimap/nested/write.C index 144dabb..6337055 100644 --- a/types/multimap/nested/write.C +++ b/types/multimap/nested/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include @@ -23,11 +23,12 @@ using Multimap = static std::shared_ptr MakeMultimapField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); - field->GetSubFields()[0]->GetSubFields()[1]->SetColumnRepresentatives( - {{indexType}}); + field->GetMutableSubfields()[0] + ->GetMutableSubfields()[1] + ->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -40,14 +41,14 @@ void write(std::string_view filename = "types.multimap.nested.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMultimapField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeMultimapField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeMultimapField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeMultimapField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeMultimapField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeMultimapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeMultimapField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeMultimapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/multiset/fundamental/read.C b/types/multiset/fundamental/read.C index 9e24295..8d064ba 100644 --- a/types/multiset/fundamental/read.C +++ b/types/multiset/fundamental/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/multiset/fundamental/write.C b/types/multiset/fundamental/write.C index 0654e7f..ba264f8 100644 --- a/types/multiset/fundamental/write.C +++ b/types/multiset/fundamental/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,7 +19,7 @@ using Multiset = std::multiset; static std::shared_ptr MakeMultisetField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -30,14 +30,14 @@ void write(std::string_view filename = "types.multiset.fundamental.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMultisetField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeMultisetField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeMultisetField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeMultisetField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeMultisetField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeMultisetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeMultisetField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeMultisetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/multiset/nested/read.C b/types/multiset/nested/read.C index b19ffb7..f46a339 100644 --- a/types/multiset/nested/read.C +++ b/types/multiset/nested/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include diff --git a/types/multiset/nested/write.C b/types/multiset/nested/write.C index 710787b..b72b632 100644 --- a/types/multiset/nested/write.C +++ b/types/multiset/nested/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include @@ -22,10 +22,10 @@ using Multiset = std::multiset>; static std::shared_ptr MakeMultisetField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); - field->GetSubFields()[0]->SetColumnRepresentatives({{indexType}}); + field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -38,14 +38,14 @@ void write(std::string_view filename = "types.multiset.nested.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMultisetField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeMultisetField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeMultisetField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeMultisetField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeMultisetField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeMultisetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeMultisetField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeMultisetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/optional/read.C b/types/optional/read.C index fdf939d..8a4321b 100644 --- a/types/optional/read.C +++ b/types/optional/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/optional/write.C b/types/optional/write.C index 36e037e..91e7ba9 100644 --- a/types/optional/write.C +++ b/types/optional/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -24,7 +24,7 @@ using VectorInt32Ty = std::vector; static std::shared_ptr MakeIntField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -35,14 +35,14 @@ void write(std::string_view filename = "types.optional.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeIntField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeIntField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeIntField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeIntField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeIntField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeIntField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeIntField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeIntField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); auto String = model->MakeField>("String"); auto Variant = model->MakeField>("Variant"); diff --git a/types/pair/read.C b/types/pair/read.C index ab5e2b4..c3b3d7b 100644 --- a/types/pair/read.C +++ b/types/pair/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/pair/write.C b/types/pair/write.C index 8c25f11..0a16280 100644 --- a/types/pair/write.C +++ b/types/pair/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/types/set/fundamental/read.C b/types/set/fundamental/read.C index e9da3a7..8a777d7 100644 --- a/types/set/fundamental/read.C +++ b/types/set/fundamental/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/set/fundamental/write.C b/types/set/fundamental/write.C index 662d354..d2c884f 100644 --- a/types/set/fundamental/write.C +++ b/types/set/fundamental/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,7 +19,7 @@ using Set = std::set; static std::shared_ptr MakeSetField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -30,14 +30,14 @@ void write(std::string_view filename = "types.set.fundamental.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeSetField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeSetField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeSetField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeSetField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeSetField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeSetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeSetField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeSetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/set/nested/read.C b/types/set/nested/read.C index 30ba4d2..0c990ab 100644 --- a/types/set/nested/read.C +++ b/types/set/nested/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include diff --git a/types/set/nested/write.C b/types/set/nested/write.C index f93b38b..609cac0 100644 --- a/types/set/nested/write.C +++ b/types/set/nested/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include @@ -22,10 +22,10 @@ using Set = std::set>; static std::shared_ptr MakeSetField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); - field->GetSubFields()[0]->SetColumnRepresentatives({{indexType}}); + field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -38,14 +38,14 @@ void write(std::string_view filename = "types.set.nested.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeSetField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeSetField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeSetField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeSetField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeSetField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeSetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeSetField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeSetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/string/read.C b/types/string/read.C index e18ac27..faf7ed4 100644 --- a/types/string/read.C +++ b/types/string/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/string/write.C b/types/string/write.C index bbdd3ea..efe592f 100644 --- a/types/string/write.C +++ b/types/string/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -16,9 +16,9 @@ using ROOT::Experimental::RNTupleWriter; static std::shared_ptr MakeStringField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); - field->SetColumnRepresentatives({{indexType, EColumnType::kChar}}); + field->SetColumnRepresentatives({{indexType, ENTupleColumnType::kChar}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -27,14 +27,14 @@ void write(std::string_view filename = "types.string.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeStringField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeStringField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeStringField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeStringField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeStringField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeStringField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeStringField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeStringField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/tuple/read.C b/types/tuple/read.C index 854753a..416a153 100644 --- a/types/tuple/read.C +++ b/types/tuple/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/tuple/write.C b/types/tuple/write.C index 9005211..cde5df7 100644 --- a/types/tuple/write.C +++ b/types/tuple/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/types/unique_ptr/read.C b/types/unique_ptr/read.C index 2cc9468..fb8a6e9 100644 --- a/types/unique_ptr/read.C +++ b/types/unique_ptr/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/unique_ptr/write.C b/types/unique_ptr/write.C index cca10a9..9e82bb0 100644 --- a/types/unique_ptr/write.C +++ b/types/unique_ptr/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -23,7 +23,7 @@ using VectorInt32Ty = std::vector; static std::shared_ptr MakeIntField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -34,14 +34,14 @@ void write(std::string_view filename = "types.unique_ptr.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeIntField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeIntField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeIntField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeIntField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeIntField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeIntField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeIntField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeIntField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); auto String = model->MakeField>("String"); auto Variant = model->MakeField>("Variant"); diff --git a/types/unordered_map/fundamental/read.C b/types/unordered_map/fundamental/read.C index 9df571f..a9cbbaa 100644 --- a/types/unordered_map/fundamental/read.C +++ b/types/unordered_map/fundamental/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/unordered_map/fundamental/write.C b/types/unordered_map/fundamental/write.C index 58f102a..a621c76 100644 --- a/types/unordered_map/fundamental/write.C +++ b/types/unordered_map/fundamental/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,7 +19,7 @@ using UnorderedMap = std::unordered_map; static std::shared_ptr MakeMapField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -30,14 +30,14 @@ void write(std::string_view filename = "types.unordered_map.fundamental.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMapField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeMapField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeMapField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeMapField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeMapField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeMapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeMapField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeMapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/unordered_map/nested/read.C b/types/unordered_map/nested/read.C index 585dfc8..2542d90 100644 --- a/types/unordered_map/nested/read.C +++ b/types/unordered_map/nested/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include diff --git a/types/unordered_map/nested/write.C b/types/unordered_map/nested/write.C index 2e53014..fec67ac 100644 --- a/types/unordered_map/nested/write.C +++ b/types/unordered_map/nested/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include @@ -23,11 +23,12 @@ using UnorderedMap = std::unordered_map MakeUnorderedMapField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); - field->GetSubFields()[0]->GetSubFields()[1]->SetColumnRepresentatives( - {{indexType}}); + field->GetMutableSubfields()[0] + ->GetMutableSubfields()[1] + ->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -40,14 +41,14 @@ void write(std::string_view filename = "types.unordered_map.nested.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeUnorderedMapField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeUnorderedMapField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeUnorderedMapField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeUnorderedMapField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeUnorderedMapField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeUnorderedMapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeUnorderedMapField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeUnorderedMapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/unordered_multimap/fundamental/read.C b/types/unordered_multimap/fundamental/read.C index 0f3feaa..cf4a66e 100644 --- a/types/unordered_multimap/fundamental/read.C +++ b/types/unordered_multimap/fundamental/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/unordered_multimap/fundamental/write.C b/types/unordered_multimap/fundamental/write.C index bdebb90..bf3fc16 100644 --- a/types/unordered_multimap/fundamental/write.C +++ b/types/unordered_multimap/fundamental/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,7 +19,7 @@ using UnorderedMultimap = std::unordered_multimap; static std::shared_ptr MakeMultimapField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -30,14 +30,14 @@ void write(std::string_view filename = "types.unordered_multimap.fundamental.roo auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMultimapField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeMultimapField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeMultimapField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeMultimapField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeMultimapField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeMultimapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeMultimapField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeMultimapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/unordered_multimap/nested/read.C b/types/unordered_multimap/nested/read.C index e5c085f..3499c20 100644 --- a/types/unordered_multimap/nested/read.C +++ b/types/unordered_multimap/nested/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include diff --git a/types/unordered_multimap/nested/write.C b/types/unordered_multimap/nested/write.C index 74c54b5..adba533 100644 --- a/types/unordered_multimap/nested/write.C +++ b/types/unordered_multimap/nested/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include @@ -23,11 +23,12 @@ using UnorderedMultimap = std::unordered_multimap MakeUnorderedMultimapField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); - field->GetSubFields()[0]->GetSubFields()[1]->SetColumnRepresentatives( - {{indexType}}); + field->GetMutableSubfields()[0] + ->GetMutableSubfields()[1] + ->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -40,14 +41,14 @@ void write(std::string_view filename = "types.unordered_multimap.nested.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeUnorderedMultimapField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeUnorderedMultimapField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeUnorderedMultimapField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeUnorderedMultimapField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeUnorderedMultimapField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeUnorderedMultimapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeUnorderedMultimapField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeUnorderedMultimapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/unordered_multiset/fundamental/read.C b/types/unordered_multiset/fundamental/read.C index 8b4b422..3771b88 100644 --- a/types/unordered_multiset/fundamental/read.C +++ b/types/unordered_multiset/fundamental/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/unordered_multiset/fundamental/write.C b/types/unordered_multiset/fundamental/write.C index 2363242..794121f 100644 --- a/types/unordered_multiset/fundamental/write.C +++ b/types/unordered_multiset/fundamental/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,7 +19,7 @@ using UnorderedMultiSet = std::unordered_multiset; static std::shared_ptr MakeUnorderedMultiSetField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -32,15 +32,15 @@ void write( // Non-split index encoding auto Index32 = - MakeUnorderedMultiSetField(*model, "Index32", EColumnType::kIndex32); + MakeUnorderedMultiSetField(*model, "Index32", ENTupleColumnType::kIndex32); auto Index64 = - MakeUnorderedMultiSetField(*model, "Index64", EColumnType::kIndex64); + MakeUnorderedMultiSetField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = MakeUnorderedMultiSetField(*model, "SplitIndex32", - EColumnType::kSplitIndex32); + ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = MakeUnorderedMultiSetField(*model, "SplitIndex64", - EColumnType::kSplitIndex64); + ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/unordered_multiset/nested/read.C b/types/unordered_multiset/nested/read.C index 36de48b..3c7444e 100644 --- a/types/unordered_multiset/nested/read.C +++ b/types/unordered_multiset/nested/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include diff --git a/types/unordered_multiset/nested/write.C b/types/unordered_multiset/nested/write.C index 62e5866..bf8f965 100644 --- a/types/unordered_multiset/nested/write.C +++ b/types/unordered_multiset/nested/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include @@ -25,10 +25,10 @@ using UnorderedMultiset = static std::shared_ptr MakeUnorderedMultisetField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); - field->GetSubFields()[0]->SetColumnRepresentatives({{indexType}}); + field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -42,15 +42,15 @@ void write(std::string_view filename = "types.unordered_multiset.nested.root") { // Non-split index encoding auto Index32 = - MakeUnorderedMultisetField(*model, "Index32", EColumnType::kIndex32); + MakeUnorderedMultisetField(*model, "Index32", ENTupleColumnType::kIndex32); auto Index64 = - MakeUnorderedMultisetField(*model, "Index64", EColumnType::kIndex64); + MakeUnorderedMultisetField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = MakeUnorderedMultisetField(*model, "SplitIndex32", - EColumnType::kSplitIndex32); + ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = MakeUnorderedMultisetField(*model, "SplitIndex64", - EColumnType::kSplitIndex64); + ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/unordered_set/fundamental/read.C b/types/unordered_set/fundamental/read.C index daf2502..d077eaa 100644 --- a/types/unordered_set/fundamental/read.C +++ b/types/unordered_set/fundamental/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/unordered_set/fundamental/write.C b/types/unordered_set/fundamental/write.C index 1233983..c74154a 100644 --- a/types/unordered_set/fundamental/write.C +++ b/types/unordered_set/fundamental/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,7 +19,7 @@ using UnorderedSet = std::unordered_set; static std::shared_ptr MakeUnorderedSetField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -31,15 +31,15 @@ void write(std::string_view filename = "types.unordered_set.fundamental.root") { // Non-split index encoding auto Index32 = - MakeUnorderedSetField(*model, "Index32", EColumnType::kIndex32); + MakeUnorderedSetField(*model, "Index32", ENTupleColumnType::kIndex32); auto Index64 = - MakeUnorderedSetField(*model, "Index64", EColumnType::kIndex64); + MakeUnorderedSetField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeUnorderedSetField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeUnorderedSetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeUnorderedSetField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeUnorderedSetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/unordered_set/nested/read.C b/types/unordered_set/nested/read.C index 65f0361..41f8421 100644 --- a/types/unordered_set/nested/read.C +++ b/types/unordered_set/nested/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include diff --git a/types/unordered_set/nested/write.C b/types/unordered_set/nested/write.C index e0afbcb..bb7e6bf 100644 --- a/types/unordered_set/nested/write.C +++ b/types/unordered_set/nested/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include @@ -24,10 +24,10 @@ using UnorderedSet = std::unordered_set>; static std::shared_ptr MakeUnorderedSetField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); - field->GetSubFields()[0]->SetColumnRepresentatives({{indexType}}); + field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -41,15 +41,15 @@ void write(std::string_view filename = "types.unordered_set.nested.root") { // Non-split index encoding auto Index32 = - MakeUnorderedSetField(*model, "Index32", EColumnType::kIndex32); + MakeUnorderedSetField(*model, "Index32", ENTupleColumnType::kIndex32); auto Index64 = - MakeUnorderedSetField(*model, "Index64", EColumnType::kIndex64); + MakeUnorderedSetField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeUnorderedSetField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeUnorderedSetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeUnorderedSetField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeUnorderedSetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/user/class/read.C b/types/user/class/read.C index 94e793e..957751a 100644 --- a/types/user/class/read.C +++ b/types/user/class/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include diff --git a/types/user/class/write.C b/types/user/class/write.C index 5ead06c..db84961 100644 --- a/types/user/class/write.C +++ b/types/user/class/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include diff --git a/types/user/enum/read.C b/types/user/enum/read.C index 541c321..dffc12a 100644 --- a/types/user/enum/read.C +++ b/types/user/enum/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include diff --git a/types/user/enum/write.C b/types/user/enum/write.C index 57240e6..941cfe0 100644 --- a/types/user/enum/write.C +++ b/types/user/enum/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include diff --git a/types/variant/read.C b/types/variant/read.C index e98b093..34b1798 100644 --- a/types/variant/read.C +++ b/types/variant/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/variant/write.C b/types/variant/write.C index eed506a..7a7181a 100644 --- a/types/variant/write.C +++ b/types/variant/write.C @@ -2,9 +2,9 @@ #include #include -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include diff --git a/types/vector/fundamental/read.C b/types/vector/fundamental/read.C index ff2eeb3..7430554 100644 --- a/types/vector/fundamental/read.C +++ b/types/vector/fundamental/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/vector/fundamental/write.C b/types/vector/fundamental/write.C index f8a2c2a..19962ee 100644 --- a/types/vector/fundamental/write.C +++ b/types/vector/fundamental/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,7 +19,7 @@ using Vector = std::vector; static std::shared_ptr MakeVectorField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -30,14 +30,14 @@ void write(std::string_view filename = "types.vector.fundamental.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeVectorField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeVectorField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeVectorField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeVectorField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeVectorField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeVectorField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeVectorField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeVectorField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); diff --git a/types/vector/nested/read.C b/types/vector/nested/read.C index dea0cc8..0251e8f 100644 --- a/types/vector/nested/read.C +++ b/types/vector/nested/read.C @@ -1,8 +1,8 @@ #include #include -using ROOT::Experimental::REntry; -using ROOT::Experimental::RNTupleReader; +using ROOT::REntry; +using ROOT::RNTupleReader; #include #include diff --git a/types/vector/nested/write.C b/types/vector/nested/write.C index a83d2ea..40bf241 100644 --- a/types/vector/nested/write.C +++ b/types/vector/nested/write.C @@ -4,11 +4,11 @@ #include #include -using ROOT::Experimental::EColumnType; -using ROOT::Experimental::RField; -using ROOT::Experimental::RNTupleModel; -using ROOT::Experimental::RNTupleWriteOptions; -using ROOT::Experimental::RNTupleWriter; +using ROOT::ENTupleColumnType; +using ROOT::RField; +using ROOT::RNTupleModel; +using ROOT::RNTupleWriteOptions; +using ROOT::RNTupleWriter; #include #include @@ -19,10 +19,10 @@ using Vector = std::vector>; static std::shared_ptr MakeVectorField(RNTupleModel &model, std::string_view name, - EColumnType indexType) { + ENTupleColumnType indexType) { auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); - field->GetSubFields()[0]->SetColumnRepresentatives({{indexType}}); + field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } @@ -31,14 +31,14 @@ void write(std::string_view filename = "types.vector.nested.root") { auto model = RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeVectorField(*model, "Index32", EColumnType::kIndex32); - auto Index64 = MakeVectorField(*model, "Index64", EColumnType::kIndex64); + auto Index32 = MakeVectorField(*model, "Index32", ENTupleColumnType::kIndex32); + auto Index64 = MakeVectorField(*model, "Index64", ENTupleColumnType::kIndex64); // Split index encoding auto SplitIndex32 = - MakeVectorField(*model, "SplitIndex32", EColumnType::kSplitIndex32); + MakeVectorField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); auto SplitIndex64 = - MakeVectorField(*model, "SplitIndex64", EColumnType::kSplitIndex64); + MakeVectorField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); RNTupleWriteOptions options; options.SetCompression(0); From 2da497a24245b6c5f1bdf2b177ad3c5d1be00ffd Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Wed, 22 Apr 2026 10:40:20 +0200 Subject: [PATCH 2/6] Replace using declarations for stable API The only exceptions are alias declarations (to shorten type names) and structure/feature_flag/write.C, which uses the Internal API. --- compression/algorithms/write_algorithm.hxx | 15 ++--- compression/block/big/write.C | 15 ++--- compression/block/short/write.C | 15 ++--- compression/read_compression.hxx | 5 +- projections/cardinality/read.C | 9 +-- projections/cardinality/write.C | 41 ++++++------- projections/collection/read.C | 10 ++- projections/collection/write.C | 15 ++--- projections/leaf/read.C | 9 +-- projections/leaf/write.C | 17 ++---- projections/nested/read.C | 7 +-- projections/nested/write.C | 17 ++---- structure/cluster_groups/write.C | 12 ++-- structure/clusters/write.C | 12 ++-- structure/empty/write.C | 12 ++-- structure/feature_flag/write.C | 9 +-- structure/read_structure.hxx | 9 +-- types/RVec/fundamental/read.C | 7 +-- types/RVec/fundamental/write.C | 36 +++++------ types/RVec/nested/read.C | 10 ++- types/RVec/nested/write.C | 36 +++++------ types/array/read.C | 12 ++-- types/array/write.C | 12 ++-- types/atomic/read.C | 9 +-- types/atomic/write.C | 16 ++--- types/bitset/read.C | 7 +-- types/bitset/write.C | 12 ++-- types/fundamental/integer/read.C | 7 +-- types/fundamental/integer/write.C | 64 +++++++++----------- types/fundamental/misc/read.C | 7 +-- types/fundamental/misc/write.C | 30 ++++----- types/fundamental/real/read.C | 7 +-- types/fundamental/real/write.C | 46 ++++++-------- types/fundamental/real32quant/read.C | 7 +-- types/fundamental/real32quant/write.C | 20 +++--- types/fundamental/real32trunc/read.C | 7 +-- types/fundamental/real32trunc/write.C | 18 ++---- types/map/fundamental/read.C | 7 +-- types/map/fundamental/write.C | 34 +++++------ types/map/nested/read.C | 10 ++- types/map/nested/write.C | 34 +++++------ types/multimap/fundamental/read.C | 9 +-- types/multimap/fundamental/write.C | 36 +++++------ types/multimap/nested/read.C | 10 ++- types/multimap/nested/write.C | 36 +++++------ types/multiset/fundamental/read.C | 7 +-- types/multiset/fundamental/write.C | 36 +++++------ types/multiset/nested/read.C | 10 ++- types/multiset/nested/write.C | 36 +++++------ types/optional/read.C | 12 ++-- types/optional/write.C | 36 +++++------ types/pair/read.C | 12 ++-- types/pair/write.C | 12 ++-- types/set/fundamental/read.C | 7 +-- types/set/fundamental/write.C | 34 +++++------ types/set/nested/read.C | 10 ++- types/set/nested/write.C | 34 +++++------ types/string/read.C | 7 +-- types/string/write.C | 39 ++++++------ types/tuple/read.C | 16 +++-- types/tuple/write.C | 12 ++-- types/unique_ptr/read.C | 15 +++-- types/unique_ptr/write.C | 36 +++++------ types/unordered_map/fundamental/read.C | 7 +-- types/unordered_map/fundamental/write.C | 36 +++++------ types/unordered_map/nested/read.C | 7 +-- types/unordered_map/nested/write.C | 36 +++++------ types/unordered_multimap/fundamental/read.C | 7 +-- types/unordered_multimap/fundamental/write.C | 36 +++++------ types/unordered_multimap/nested/read.C | 7 +-- types/unordered_multimap/nested/write.C | 36 +++++------ types/unordered_multiset/fundamental/read.C | 7 +-- types/unordered_multiset/fundamental/write.C | 36 +++++------ types/unordered_multiset/nested/read.C | 7 +-- types/unordered_multiset/nested/write.C | 36 +++++------ types/unordered_set/fundamental/read.C | 10 ++- types/unordered_set/fundamental/write.C | 36 +++++------ types/unordered_set/nested/read.C | 7 +-- types/unordered_set/nested/write.C | 36 +++++------ types/user/class/read.C | 9 +-- types/user/class/write.C | 12 ++-- types/user/enum/read.C | 7 +-- types/user/enum/write.C | 12 ++-- types/variant/read.C | 9 +-- types/variant/write.C | 12 ++-- types/vector/fundamental/read.C | 7 +-- types/vector/fundamental/write.C | 36 +++++------ types/vector/nested/read.C | 10 ++- types/vector/nested/write.C | 36 +++++------ 89 files changed, 663 insertions(+), 980 deletions(-) diff --git a/compression/algorithms/write_algorithm.hxx b/compression/algorithms/write_algorithm.hxx index 85c372d..f3dabbb 100644 --- a/compression/algorithms/write_algorithm.hxx +++ b/compression/algorithms/write_algorithm.hxx @@ -3,26 +3,21 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include void write_algorithm(std::string_view filename, std::uint32_t compression) { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Int64 = model->MakeField("Int64"); model->GetMutableField("Int64").SetColumnRepresentatives( - {{ENTupleColumnType::kSplitInt64}}); + {{ROOT::ENTupleColumnType::kSplitInt64}}); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(compression); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // Write 32 entries to make sure the compression block is not too small. for (int i = 0; i < 32; i++) { diff --git a/compression/block/big/write.C b/compression/block/big/write.C index bdd5b85..8b90071 100644 --- a/compression/block/big/write.C +++ b/compression/block/big/write.C @@ -3,31 +3,26 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include void write(std::string_view filename = "compression.block.big.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Int64 = model->MakeField("Int64"); model->GetMutableField("Int64").SetColumnRepresentatives( - {{ENTupleColumnType::kSplitInt64}}); + {{ROOT::ENTupleColumnType::kSplitInt64}}); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; // Crank up the zstd compression level to reduce the output file size by // approximately a factor 6 (from 76K with 505 to 12K). options.SetCompression(509); // Increase the maximum unzipped page size to make it bigger than the maximum // size of a compression block, which is 16 MiB. options.SetMaxUnzippedPageSize(128 * 1024 * 1024); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // Write 40 MiB of entries that will be split into three compression blocks. static constexpr int Entries = 40 * 1024 * 1024 / sizeof(std::int64_t); diff --git a/compression/block/short/write.C b/compression/block/short/write.C index 97c2a24..dc99397 100644 --- a/compression/block/short/write.C +++ b/compression/block/short/write.C @@ -3,26 +3,21 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include void write(std::string_view filename = "compression.block.short.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Int64 = model->MakeField("Int64"); model->GetMutableField("Int64").SetColumnRepresentatives( - {{ENTupleColumnType::kSplitInt64}}); + {{ROOT::ENTupleColumnType::kSplitInt64}}); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(505); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // Write only 2 entries to make sure the compression block is small and // actually stored uncompressed. diff --git a/compression/read_compression.hxx b/compression/read_compression.hxx index 0a1e7fe..d2d7a94 100644 --- a/compression/read_compression.hxx +++ b/compression/read_compression.hxx @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -11,7 +8,7 @@ using ROOT::RNTupleReader; #include void read_compression(std::string_view input, std::string_view output) { - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto Int64 = reader->GetModel().GetDefaultEntry().GetPtr("Int64"); std::int64_t sum = 0; diff --git a/projections/cardinality/read.C b/projections/cardinality/read.C index 8079386..5e0a29f 100644 --- a/projections/cardinality/read.C +++ b/projections/cardinality/read.C @@ -2,9 +2,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -14,7 +11,7 @@ using ROOT::RNTupleReader; using Vector = std::vector; -static void PrintVectorValue(const REntry &entry, std::string_view name, +static void PrintVectorValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { Vector &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; @@ -38,7 +35,7 @@ static void PrintVectorValue(const REntry &entry, std::string_view name, } template -static void PrintCardinality(const REntry &entry, std::string_view name, +static void PrintCardinality(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { T value = *entry.GetPtr>(name); os << " \"" << name << "\": " << value; @@ -53,7 +50,7 @@ void read(std::string_view input = "projections.cardinality.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/projections/cardinality/write.C b/projections/cardinality/write.C index edb2a8c..49e34d6 100644 --- a/projections/cardinality/write.C +++ b/projections/cardinality/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -18,37 +12,40 @@ using ROOT::RNTupleWriter; using Vector = std::vector; -static std::shared_ptr MakeVectorField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeVectorField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } template -static void AddProjectedCardinalityField(RNTupleModel &model, +static void AddProjectedCardinalityField(ROOT::RNTupleModel &model, std::string_view name, std::string_view source) { - auto field = std::make_unique>>(name); + auto field = + std::make_unique>>(name); model.AddProjectedField(std::move(field), [&source](const std::string &) { return std::string{source}; }); } void write(std::string_view filename = "projections.cardinality.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeVectorField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeVectorField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeVectorField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeVectorField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeVectorField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeVectorField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeVectorField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeVectorField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); // Create RNTupleCardinality projections AddProjectedCardinalityField(*model, "Index32Cardinality", @@ -60,10 +57,10 @@ void write(std::string_view filename = "projections.cardinality.root") { AddProjectedCardinalityField(*model, "SplitIndex64Cardinality", "SplitIndex64"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element vectors, with ascending values *Index32 = {1}; diff --git a/projections/collection/read.C b/projections/collection/read.C index 9c2152e..895aa8c 100644 --- a/projections/collection/read.C +++ b/projections/collection/read.C @@ -2,9 +2,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,8 +10,9 @@ using ROOT::RNTupleReader; #include template -static void PrintCollectionValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintCollectionValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { C &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; bool first = true; @@ -41,7 +39,7 @@ void read(std::string_view input = "projections.collection.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/projections/collection/write.C b/projections/collection/write.C index a2b7e22..e5e6cb4 100644 --- a/projections/collection/write.C +++ b/projections/collection/write.C @@ -4,11 +4,6 @@ #include #include -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -16,11 +11,11 @@ using ROOT::RNTupleWriter; #include void write(std::string_view filename = "projections.collection.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Vector = model->MakeField>("Vector"); auto Projected = - std::make_unique>>("Projected"); + std::make_unique>>("Projected"); model->AddProjectedField(std::move(Projected), [](const std::string &fieldName) { if (fieldName == "Projected") { @@ -30,10 +25,10 @@ void write(std::string_view filename = "projections.collection.root") { } }); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: ascending values *Vector = {1, 2}; diff --git a/projections/leaf/read.C b/projections/leaf/read.C index 8140b0f..e510d4e 100644 --- a/projections/leaf/read.C +++ b/projections/leaf/read.C @@ -2,9 +2,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -23,7 +20,7 @@ template <> void PrintValue(const float &value, std::ostream &os) { } template -static void PrintPairValue(const REntry &entry, std::string_view name, +static void PrintPairValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &value = *entry.GetPtr>(name); os << " \"" << name << "\": [\n"; @@ -41,7 +38,7 @@ static void PrintPairValue(const REntry &entry, std::string_view name, } template -static void PrintValue(const REntry &entry, std::string_view name, +static void PrintValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { T value = *entry.GetPtr(name); os << " \"" << name << "\": "; @@ -59,7 +56,7 @@ void read(std::string_view input = "projections.leaf.root", os << std::hexfloat; os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/projections/leaf/write.C b/projections/leaf/write.C index 7e3fc0c..a1be2bb 100644 --- a/projections/leaf/write.C +++ b/projections/leaf/write.C @@ -3,11 +3,6 @@ #include #include -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -15,25 +10,25 @@ using ROOT::RNTupleWriter; #include template -static void AddProjectedField(RNTupleModel &model, std::string_view name, +static void AddProjectedField(ROOT::RNTupleModel &model, std::string_view name, std::string_view source) { - auto field = std::make_unique>(name); + auto field = std::make_unique>(name); model.AddProjectedField(std::move(field), [&source](const std::string &) { return std::string{source}; }); } void write(std::string_view filename = "projections.leaf.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Pair = model->MakeField>("Pair"); AddProjectedField(*model, "Int32", "Pair._0"); AddProjectedField(*model, "Float", "Pair._1"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: ascending values *Pair = {1, 2.0}; diff --git a/projections/nested/read.C b/projections/nested/read.C index fceb13b..43a87c0 100644 --- a/projections/nested/read.C +++ b/projections/nested/read.C @@ -2,9 +2,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -36,7 +33,7 @@ void PrintValue(const std::pair &value, std::ostream &os) { } template -static void PrintVectorValue(const REntry &entry, std::string_view name, +static void PrintVectorValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &value = *entry.GetPtr>(name); os << " \"" << name << "\": ["; @@ -67,7 +64,7 @@ void read(std::string_view input = "projections.nested.root", os << std::hexfloat; os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/projections/nested/write.C b/projections/nested/write.C index 400af7b..383ef95 100644 --- a/projections/nested/write.C +++ b/projections/nested/write.C @@ -4,11 +4,6 @@ #include #include -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -17,9 +12,9 @@ using ROOT::RNTupleWriter; #include template -static void AddProjectedField(RNTupleModel &model, std::string_view name, +static void AddProjectedField(ROOT::RNTupleModel &model, std::string_view name, std::string_view source) { - auto field = std::make_unique>>(name); + auto field = std::make_unique>>(name); model.AddProjectedField(std::move(field), [&name, &source](const std::string &fieldName) { if (fieldName == name) { @@ -31,7 +26,7 @@ static void AddProjectedField(RNTupleModel &model, std::string_view name, } void write(std::string_view filename = "projections.nested.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto VectorPair = model->MakeField>>( @@ -39,10 +34,10 @@ void write(std::string_view filename = "projections.nested.root") { AddProjectedField(*model, "VectorInt", "_0"); AddProjectedField(*model, "VectorFloat", "_1"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: ascending values VectorPair->emplace_back(1, 2.0); diff --git a/structure/cluster_groups/write.C b/structure/cluster_groups/write.C index a7aec5a..bde75b4 100644 --- a/structure/cluster_groups/write.C +++ b/structure/cluster_groups/write.C @@ -2,22 +2,18 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include void write(std::string_view filename = "structure.cluster_groups.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Int32 = model->MakeField("Int32"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); *Int32 = 1; writer->Fill(); diff --git a/structure/clusters/write.C b/structure/clusters/write.C index fe969e8..3f86810 100644 --- a/structure/clusters/write.C +++ b/structure/clusters/write.C @@ -2,22 +2,18 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include void write(std::string_view filename = "structure.clusters.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Int32 = model->MakeField("Int32"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); *Int32 = 1; writer->Fill(); diff --git a/structure/empty/write.C b/structure/empty/write.C index 600fe2a..e19a0cf 100644 --- a/structure/empty/write.C +++ b/structure/empty/write.C @@ -2,22 +2,18 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include void write(std::string_view filename = "structure.empty.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Int32 = model->MakeField("Int32"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // Destruct the writer / commit the dataset without filling an entry. writer.reset(); diff --git a/structure/feature_flag/write.C b/structure/feature_flag/write.C index 3fddb4f..0e03e6e 100644 --- a/structure/feature_flag/write.C +++ b/structure/feature_flag/write.C @@ -8,9 +8,6 @@ #include #include -using ROOT::RFieldZero; -using ROOT::RNTupleDescriptor; -using ROOT::RNTupleWriteOptions; using ROOT::Internal::RFieldDescriptorBuilder; using ROOT::Internal::RNTupleDescriptorBuilder; using ROOT::Internal::RNTupleFileWriter; @@ -25,14 +22,14 @@ void write(std::string_view filename = "structure.feature_flag.root") { // The following line will be required as of ROOT v6.36 // descBuilder.SetVersionForWriting(); descBuilder.SetNTuple("ntpl", ""); - descBuilder.SetFeature(RNTupleDescriptor::kFeatureFlagTest); - descBuilder.AddField(RFieldDescriptorBuilder::FromField(RFieldZero()) + descBuilder.SetFeature(ROOT::RNTupleDescriptor::kFeatureFlagTest); + descBuilder.AddField(RFieldDescriptorBuilder::FromField(ROOT::RFieldZero()) .FieldId(0) .MakeDescriptor() .Unwrap()); auto descriptor = descBuilder.MoveDescriptor(); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); auto writer = RNTupleFileWriter::Recreate( "ntpl", filename, RNTupleFileWriter::EContainerFormat::kTFile, diff --git a/structure/read_structure.hxx b/structure/read_structure.hxx index 896c168..ef04b6d 100644 --- a/structure/read_structure.hxx +++ b/structure/read_structure.hxx @@ -2,9 +2,6 @@ #include #include -using ROOT::RException; -using ROOT::RNTupleReader; - #include #include #include @@ -14,10 +11,10 @@ using ROOT::RNTupleReader; void read_structure(std::string_view input, std::string_view output) { std::ofstream os(std::string{output}); - std::unique_ptr reader; + std::unique_ptr reader; try { - reader = RNTupleReader::Open("ntpl", input); - } catch (const RException &e) { + reader = ROOT::RNTupleReader::Open("ntpl", input); + } catch (const ROOT::RException &e) { std::string msgWithoutStacktrace; std::getline(std::istringstream(e.what()), msgWithoutStacktrace); os << "{\n"; diff --git a/types/RVec/fundamental/read.C b/types/RVec/fundamental/read.C index 7004fbd..cda1944 100644 --- a/types/RVec/fundamental/read.C +++ b/types/RVec/fundamental/read.C @@ -2,9 +2,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,7 +10,7 @@ using ROOT::RNTupleReader; using Vector = ROOT::RVec; -static void PrintVectorValue(const REntry &entry, std::string_view name, +static void PrintVectorValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { Vector &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; @@ -41,7 +38,7 @@ void read(std::string_view input = "types.RVec.fundamental.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/RVec/fundamental/write.C b/types/RVec/fundamental/write.C index 05c7989..9ff7913 100644 --- a/types/RVec/fundamental/write.C +++ b/types/RVec/fundamental/write.C @@ -5,44 +5,40 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include using Vector = ROOT::RVec; -static std::shared_ptr MakeVectorField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeVectorField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.RVec.fundamental.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeVectorField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeVectorField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeVectorField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeVectorField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeVectorField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeVectorField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeVectorField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeVectorField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element vectors, with ascending values *Index32 = {1}; diff --git a/types/RVec/nested/read.C b/types/RVec/nested/read.C index 1c74ded..abb016f 100644 --- a/types/RVec/nested/read.C +++ b/types/RVec/nested/read.C @@ -2,9 +2,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,8 +10,9 @@ using ROOT::RNTupleReader; using Vector = ROOT::RVec>; -static void PrintNestedVectorValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintNestedVectorValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { Vector &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; bool outerFirst = true; @@ -54,7 +52,7 @@ void read(std::string_view input = "types.RVec.nested.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/RVec/nested/write.C b/types/RVec/nested/write.C index ed23687..b125486 100644 --- a/types/RVec/nested/write.C +++ b/types/RVec/nested/write.C @@ -5,12 +5,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -18,10 +12,10 @@ using ROOT::RNTupleWriter; using Inner = ROOT::RVec; using Vector = ROOT::RVec; -static std::shared_ptr MakeVectorField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeVectorField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -29,22 +23,24 @@ static std::shared_ptr MakeVectorField(RNTupleModel &model, } void write(std::string_view filename = "types.RVec.nested.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeVectorField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeVectorField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeVectorField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeVectorField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeVectorField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeVectorField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeVectorField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeVectorField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element vectors, with ascending values *Index32 = {{1}}; diff --git a/types/array/read.C b/types/array/read.C index 003ff1a..905112d 100644 --- a/types/array/read.C +++ b/types/array/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -54,7 +51,7 @@ template <> void PrintValue(const VectorInt32 &value, std::ostream &os) { } template -static void PrintArrayValue(const REntry &entry, std::string_view name, +static void PrintArrayValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &value = *entry.GetPtr>(name); os << " \"" << name << "\": ["; @@ -76,8 +73,9 @@ static void PrintArrayValue(const REntry &entry, std::string_view name, os << "\n"; } -static void PrintArrayArrayValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintArrayArrayValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { auto &value = *entry.GetPtr, 3>>(name); os << " \"" << name << "\": ["; bool first = true; @@ -112,7 +110,7 @@ void read(std::string_view input = "types.array.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/array/write.C b/types/array/write.C index 3c89807..4d1d70f 100644 --- a/types/array/write.C +++ b/types/array/write.C @@ -2,10 +2,6 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -20,7 +16,7 @@ using Variant = std::variant; using VectorInt32 = std::vector; void write(std::string_view filename = "types.array.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Array_Int32 = model->MakeField("Array_Int32"); auto Array_Array = model->MakeField>("Array_Array"); @@ -31,10 +27,10 @@ void write(std::string_view filename = "types.array.root") { auto Array_Vector = model->MakeField>("Array_Vector"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: simple values *Array_Int32 = {1, 2}; diff --git a/types/atomic/read.C b/types/atomic/read.C index e7eb2e6..2fada49 100644 --- a/types/atomic/read.C +++ b/types/atomic/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include // for std::byte #include @@ -13,7 +10,7 @@ using ROOT::RNTupleReader; #include template -static void PrintIntegerValue(const REntry &entry, std::string_view name, +static void PrintIntegerValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { T value = *entry.GetPtr>(name); os << " \"" << name << "\": "; @@ -27,7 +24,7 @@ static void PrintIntegerValue(const REntry &entry, std::string_view name, } template -static void PrintRealValue(const REntry &entry, std::string_view name, +static void PrintRealValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { T value = *entry.GetPtr>(name); os << " \"" << name << "\": \"" << value << "\""; @@ -44,7 +41,7 @@ void read(std::string_view input = "types.atomic.root", os << std::hexfloat; os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/atomic/write.C b/types/atomic/write.C index 1283220..6dc2137 100644 --- a/types/atomic/write.C +++ b/types/atomic/write.C @@ -2,10 +2,6 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include // for std::byte #include @@ -13,13 +9,13 @@ using ROOT::RNTupleWriter; #include template -static std::shared_ptr> MakeAtomicField(RNTupleModel &model, - std::string_view name) { +static std::shared_ptr> +MakeAtomicField(ROOT::RNTupleModel &model, std::string_view name) { return model.MakeField>(name); } void write(std::string_view filename = "types.atomic.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Bit = MakeAtomicField(*model, "Bit"); auto Byte = MakeAtomicField(*model, "Byte"); @@ -37,10 +33,10 @@ void write(std::string_view filename = "types.atomic.root") { auto Real32 = MakeAtomicField(*model, "Real32"); auto Real64 = MakeAtomicField(*model, "Real64"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: ascending values *Bit = 1; diff --git a/types/bitset/read.C b/types/bitset/read.C index f71a21b..7affa5c 100644 --- a/types/bitset/read.C +++ b/types/bitset/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -12,7 +9,7 @@ using ROOT::RNTupleReader; #include template -static void PrintBitsetValue(const REntry &entry, std::string_view name, +static void PrintBitsetValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &value = *entry.GetPtr>(name); os << " \"" << name << "\": \"" << value.to_string() << "\""; @@ -27,7 +24,7 @@ void read(std::string_view input = "types.bitset.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/bitset/write.C b/types/bitset/write.C index 9279d1e..d82b034 100644 --- a/types/bitset/write.C +++ b/types/bitset/write.C @@ -2,25 +2,21 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include void write(std::string_view filename = "types.bitset.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Bitset1 = model->MakeField>("Bitset1"); auto Bitset64 = model->MakeField>("Bitset64"); auto Bitset65 = model->MakeField>("Bitset65"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: ascending bits set Bitset1->set(0); diff --git a/types/fundamental/integer/read.C b/types/fundamental/integer/read.C index eecf00d..e586371 100644 --- a/types/fundamental/integer/read.C +++ b/types/fundamental/integer/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -11,7 +8,7 @@ using ROOT::RNTupleReader; #include template -static void PrintIntegerValue(const REntry &entry, std::string_view name, +static void PrintIntegerValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { T value = *entry.GetPtr(name); os << " \"" << name << "\": "; @@ -29,7 +26,7 @@ void read(std::string_view input = "types.fundamental.integer.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/fundamental/integer/write.C b/types/fundamental/integer/write.C index 1a9a869..6ce3036 100644 --- a/types/fundamental/integer/write.C +++ b/types/fundamental/integer/write.C @@ -4,67 +4,61 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include #include template -static std::shared_ptr MakeFundamentalField(RNTupleModel &model, +static std::shared_ptr MakeFundamentalField(ROOT::RNTupleModel &model, std::string_view name, - ENTupleColumnType type) { - auto field = std::make_unique>(name); + ROOT::ENTupleColumnType type) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{type}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.fundamental.integer.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); - auto Int8 = - MakeFundamentalField(*model, "Int8", ENTupleColumnType::kInt8); - auto UInt8 = - MakeFundamentalField(*model, "UInt8", ENTupleColumnType::kUInt8); + auto Int8 = MakeFundamentalField(*model, "Int8", + ROOT::ENTupleColumnType::kInt8); + auto UInt8 = MakeFundamentalField( + *model, "UInt8", ROOT::ENTupleColumnType::kUInt8); // Non-split integer encoding - auto Int16 = - MakeFundamentalField(*model, "Int16", ENTupleColumnType::kInt16); - auto UInt16 = MakeFundamentalField(*model, "UInt16", - ENTupleColumnType::kUInt16); - auto Int32 = - MakeFundamentalField(*model, "Int32", ENTupleColumnType::kInt32); - auto UInt32 = MakeFundamentalField(*model, "UInt32", - ENTupleColumnType::kUInt32); - auto Int64 = - MakeFundamentalField(*model, "Int64", ENTupleColumnType::kInt64); - auto UInt64 = MakeFundamentalField(*model, "UInt64", - ENTupleColumnType::kUInt64); + auto Int16 = MakeFundamentalField( + *model, "Int16", ROOT::ENTupleColumnType::kInt16); + auto UInt16 = MakeFundamentalField( + *model, "UInt16", ROOT::ENTupleColumnType::kUInt16); + auto Int32 = MakeFundamentalField( + *model, "Int32", ROOT::ENTupleColumnType::kInt32); + auto UInt32 = MakeFundamentalField( + *model, "UInt32", ROOT::ENTupleColumnType::kUInt32); + auto Int64 = MakeFundamentalField( + *model, "Int64", ROOT::ENTupleColumnType::kInt64); + auto UInt64 = MakeFundamentalField( + *model, "UInt64", ROOT::ENTupleColumnType::kUInt64); // Split integer encoding auto SplitInt16 = MakeFundamentalField( - *model, "SplitInt16", ENTupleColumnType::kSplitInt16); + *model, "SplitInt16", ROOT::ENTupleColumnType::kSplitInt16); auto SplitUInt16 = MakeFundamentalField( - *model, "SplitUInt16", ENTupleColumnType::kSplitUInt16); + *model, "SplitUInt16", ROOT::ENTupleColumnType::kSplitUInt16); auto SplitInt32 = MakeFundamentalField( - *model, "SplitInt32", ENTupleColumnType::kSplitInt32); + *model, "SplitInt32", ROOT::ENTupleColumnType::kSplitInt32); auto SplitUInt32 = MakeFundamentalField( - *model, "SplitUInt32", ENTupleColumnType::kSplitUInt32); + *model, "SplitUInt32", ROOT::ENTupleColumnType::kSplitUInt32); auto SplitInt64 = MakeFundamentalField( - *model, "SplitInt64", ENTupleColumnType::kSplitInt64); + *model, "SplitInt64", ROOT::ENTupleColumnType::kSplitInt64); auto SplitUInt64 = MakeFundamentalField( - *model, "SplitUInt64", ENTupleColumnType::kSplitUInt64); + *model, "SplitUInt64", ROOT::ENTupleColumnType::kSplitUInt64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: ascending values *Int8 = 1; diff --git a/types/fundamental/misc/read.C b/types/fundamental/misc/read.C index f6fa108..e68563e 100644 --- a/types/fundamental/misc/read.C +++ b/types/fundamental/misc/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include // for std::byte #include #include @@ -11,7 +8,7 @@ using ROOT::RNTupleReader; #include template -static void PrintIntegerValue(const REntry &entry, std::string_view name, +static void PrintIntegerValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { T value = *entry.GetPtr(name); os << " \"" << name << "\": "; @@ -29,7 +26,7 @@ void read(std::string_view input = "types.fundamental.misc.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/fundamental/misc/write.C b/types/fundamental/misc/write.C index 6149c30..86b83ec 100644 --- a/types/fundamental/misc/write.C +++ b/types/fundamental/misc/write.C @@ -4,39 +4,35 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include // for std::byte #include #include #include template -static std::shared_ptr MakeFundamentalField(RNTupleModel &model, +static std::shared_ptr MakeFundamentalField(ROOT::RNTupleModel &model, std::string_view name, - ENTupleColumnType type) { - auto field = std::make_unique>(name); + ROOT::ENTupleColumnType type) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{type}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.fundamental.misc.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); - auto Bit = MakeFundamentalField(*model, "Bit", ENTupleColumnType::kBit); - auto Byte = - MakeFundamentalField(*model, "Byte", ENTupleColumnType::kByte); - auto Char = MakeFundamentalField(*model, "Char", ENTupleColumnType::kChar); + auto Bit = + MakeFundamentalField(*model, "Bit", ROOT::ENTupleColumnType::kBit); + auto Byte = MakeFundamentalField(*model, "Byte", + ROOT::ENTupleColumnType::kByte); + auto Char = MakeFundamentalField(*model, "Char", + ROOT::ENTupleColumnType::kChar); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: ascending values *Bit = 1; diff --git a/types/fundamental/real/read.C b/types/fundamental/real/read.C index 7fa843c..c941dc4 100644 --- a/types/fundamental/real/read.C +++ b/types/fundamental/real/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -11,7 +8,7 @@ using ROOT::RNTupleReader; #include template -static void PrintRealValue(const REntry &entry, std::string_view name, +static void PrintRealValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { T value = *entry.GetPtr(name); os << " \"" << name << "\": \"" << value << "\""; @@ -28,7 +25,7 @@ void read(std::string_view input = "types.fundamental.real.root", os << std::hexfloat; os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/fundamental/real/write.C b/types/fundamental/real/write.C index 96ee8ef..ac2fd2e 100644 --- a/types/fundamental/real/write.C +++ b/types/fundamental/real/write.C @@ -4,54 +4,48 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include template -static std::shared_ptr MakeFundamentalField(RNTupleModel &model, +static std::shared_ptr MakeFundamentalField(ROOT::RNTupleModel &model, std::string_view name, - ENTupleColumnType type) { - auto field = std::make_unique>(name); + ROOT::ENTupleColumnType type) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{type}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.fundamental.real.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split float encoding - auto FloatReal16 = - MakeFundamentalField(*model, "FloatReal16", ENTupleColumnType::kReal16); - auto FloatReal32 = - MakeFundamentalField(*model, "FloatReal32", ENTupleColumnType::kReal32); - auto DoubleReal16 = MakeFundamentalField(*model, "DoubleReal16", - ENTupleColumnType::kReal16); - auto DoubleReal32 = MakeFundamentalField(*model, "DoubleReal32", - ENTupleColumnType::kReal32); - auto DoubleReal64 = MakeFundamentalField(*model, "DoubleReal64", - ENTupleColumnType::kReal64); + auto FloatReal16 = MakeFundamentalField( + *model, "FloatReal16", ROOT::ENTupleColumnType::kReal16); + auto FloatReal32 = MakeFundamentalField( + *model, "FloatReal32", ROOT::ENTupleColumnType::kReal32); + auto DoubleReal16 = MakeFundamentalField( + *model, "DoubleReal16", ROOT::ENTupleColumnType::kReal16); + auto DoubleReal32 = MakeFundamentalField( + *model, "DoubleReal32", ROOT::ENTupleColumnType::kReal32); + auto DoubleReal64 = MakeFundamentalField( + *model, "DoubleReal64", ROOT::ENTupleColumnType::kReal64); // Split float encoding // NB there is no kSplitReal16 auto FloatSplitReal32 = MakeFundamentalField( - *model, "FloatSplitReal32", ENTupleColumnType::kSplitReal32); + *model, "FloatSplitReal32", ROOT::ENTupleColumnType::kSplitReal32); auto DoubleSplitReal32 = MakeFundamentalField( - *model, "DoubleSplitReal32", ENTupleColumnType::kSplitReal32); + *model, "DoubleSplitReal32", ROOT::ENTupleColumnType::kSplitReal32); auto DoubleSplitReal64 = MakeFundamentalField( - *model, "DoubleSplitReal64", ENTupleColumnType::kSplitReal64); + *model, "DoubleSplitReal64", ROOT::ENTupleColumnType::kSplitReal64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: ascending values *FloatReal16 = 1.0f; diff --git a/types/fundamental/real32quant/read.C b/types/fundamental/real32quant/read.C index 7aea019..2c0c892 100644 --- a/types/fundamental/real32quant/read.C +++ b/types/fundamental/real32quant/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -11,7 +8,7 @@ using ROOT::RNTupleReader; #include template -static void PrintRealValue(const REntry &entry, std::string_view name, +static void PrintRealValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { T value = *entry.GetPtr(name); os << " \"" << name << "\": \"" << value << "\""; @@ -28,7 +25,7 @@ void read(std::string_view input = "types.fundamental.real32quant.root", os << std::hexfloat; os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/fundamental/real32quant/write.C b/types/fundamental/real32quant/write.C index e17012f..b89090e 100644 --- a/types/fundamental/real32quant/write.C +++ b/types/fundamental/real32quant/write.C @@ -4,11 +4,6 @@ #include #include -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -16,19 +11,19 @@ using ROOT::RNTupleWriter; static constexpr double pi = 3.14159265358979323846; template -static std::shared_ptr MakeFieldReal32Quant(RNTupleModel &model, - std::string_view name, - int nBits, double min, double max) { +static std::shared_ptr MakeFieldReal32Quant(ROOT::RNTupleModel &model, + std::string_view name, int nBits, + double min, double max) { assert(nBits >= 1 && nBits <= 32); assert(max > min); - auto field = std::make_unique>(name); + auto field = std::make_unique>(name); field->SetQuantized(min, max, nBits); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.fundamental.real32quant.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto FloatReal32Quant1 = MakeFieldReal32Quant(*model, "FloatReal32Quant1", 1, -1, 1); @@ -43,9 +38,10 @@ void write(std::string_view filename = "types.fundamental.real32quant.root") { auto DoubleReal32Quant32 = MakeFieldReal32Quant(*model, "DoubleReal32Quant32", 32, -100, 25); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: ascending values *FloatReal32Quant1 = -1.0f; diff --git a/types/fundamental/real32trunc/read.C b/types/fundamental/real32trunc/read.C index 138285e..6400879 100644 --- a/types/fundamental/real32trunc/read.C +++ b/types/fundamental/real32trunc/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -11,7 +8,7 @@ using ROOT::RNTupleReader; #include template -static void PrintRealValue(const REntry &entry, std::string_view name, +static void PrintRealValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { T value = *entry.GetPtr(name); os << " \"" << name << "\": \"" << value << "\""; @@ -28,7 +25,7 @@ void read(std::string_view input = "types.fundamental.real32trunc.root", os << std::hexfloat; os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/fundamental/real32trunc/write.C b/types/fundamental/real32trunc/write.C index 9a75465..8c4ad29 100644 --- a/types/fundamental/real32trunc/write.C +++ b/types/fundamental/real32trunc/write.C @@ -4,29 +4,23 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include template -static std::shared_ptr MakeFieldReal32Trunc(RNTupleModel &model, +static std::shared_ptr MakeFieldReal32Trunc(ROOT::RNTupleModel &model, std::string_view name, int nBits) { assert(nBits >= 10 && nBits < 32); - auto field = std::make_unique>(name); + auto field = std::make_unique>(name); field->SetTruncated(nBits); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.fundamental.real32trunc.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto FloatReal32Trunc10 = MakeFieldReal32Trunc(*model, "FloatReal32Trunc10", 10); @@ -41,10 +35,10 @@ void write(std::string_view filename = "types.fundamental.real32trunc.root") { auto DoubleReal32Trunc31 = MakeFieldReal32Trunc(*model, "DoubleReal32Trunc31", 31); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: ascending values *FloatReal32Trunc10 = 1.0f; diff --git a/types/map/fundamental/read.C b/types/map/fundamental/read.C index 91d0cda..3dd7231 100644 --- a/types/map/fundamental/read.C +++ b/types/map/fundamental/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,7 +10,7 @@ using ROOT::RNTupleReader; using Map = std::map; -static void PrintMapValue(const REntry &entry, std::string_view name, +static void PrintMapValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { Map &item = *entry.GetPtr(name); os << " \"" << name << "\": {"; @@ -41,7 +38,7 @@ void read(std::string_view input = "types.map.fundamental.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/map/fundamental/write.C b/types/map/fundamental/write.C index 213d6b2..835f99d 100644 --- a/types/map/fundamental/write.C +++ b/types/map/fundamental/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -17,32 +11,34 @@ using ROOT::RNTupleWriter; using Map = std::map; -static std::shared_ptr MakeMapField(RNTupleModel &model, +static std::shared_ptr MakeMapField(ROOT::RNTupleModel &model, std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.map.fundamental.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMapField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeMapField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeMapField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeMapField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeMapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeMapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeMapField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeMapField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element maps, with ascending values *Index32 = {{"a", 1}}; diff --git a/types/map/nested/read.C b/types/map/nested/read.C index 3ac64d0..ad9435e 100644 --- a/types/map/nested/read.C +++ b/types/map/nested/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include @@ -16,8 +13,9 @@ using ROOT::RNTupleReader; using Map = std::map>; -static void PrintNestedMapValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintNestedMapValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { Map &item = *entry.GetPtr(name); os << " \"" << name << "\": {"; bool outerFirst = true; @@ -61,7 +59,7 @@ void read(std::string_view input = "types.map.nested.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/map/nested/write.C b/types/map/nested/write.C index a7360cb..7a18cfc 100644 --- a/types/map/nested/write.C +++ b/types/map/nested/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include @@ -20,10 +14,10 @@ using ROOT::RNTupleWriter; using Map = std::map>; -static std::shared_ptr MakeMapField(RNTupleModel &model, +static std::shared_ptr MakeMapField(ROOT::RNTupleModel &model, std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); field->GetMutableSubfields()[0] ->GetMutableSubfields()[1] @@ -37,22 +31,24 @@ void write(std::string_view filename = "types.map.nested.root") { throw std::runtime_error("could not find the required ROOT dictionaries, " "please make sure to run `make` first"); - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMapField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeMapField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeMapField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeMapField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeMapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeMapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeMapField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeMapField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element maps, with ascending values *Index32 = {{"a", {{"aa", 1}}}}; diff --git a/types/multimap/fundamental/read.C b/types/multimap/fundamental/read.C index 1ec64ee..6fb2683 100644 --- a/types/multimap/fundamental/read.C +++ b/types/multimap/fundamental/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,8 +10,8 @@ using ROOT::RNTupleReader; using Multimap = std::multimap; -static void PrintMultimapValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintMultimapValue(const ROOT::REntry &entry, std::string_view name, + std::ostream &os, bool last = false) { Multimap &item = *entry.GetPtr(name); os << " \"" << name << "\": {"; bool first = true; @@ -41,7 +38,7 @@ void read(std::string_view input = "types.multimap.fundamental.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/multimap/fundamental/write.C b/types/multimap/fundamental/write.C index dc240d4..7cb3b23 100644 --- a/types/multimap/fundamental/write.C +++ b/types/multimap/fundamental/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -17,32 +11,34 @@ using ROOT::RNTupleWriter; using Multimap = std::multimap; -static std::shared_ptr MakeMultimapField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeMultimapField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.multimap.fundamental.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMultimapField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeMultimapField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeMultimapField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeMultimapField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeMultimapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeMultimapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeMultimapField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeMultimapField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element maps, with ascending values *Index32 = {{"a", 1}}; diff --git a/types/multimap/nested/read.C b/types/multimap/nested/read.C index 04989b0..0a6cca5 100644 --- a/types/multimap/nested/read.C +++ b/types/multimap/nested/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include @@ -17,8 +14,9 @@ using ROOT::RNTupleReader; using Multimap = std::multimap>; -static void PrintNestedMultimapValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintNestedMultimapValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { Multimap &item = *entry.GetPtr(name); os << " \"" << name << "\": {"; bool outerFirst = true; @@ -62,7 +60,7 @@ void read(std::string_view input = "types.multimap.nested.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/multimap/nested/write.C b/types/multimap/nested/write.C index 6337055..c20ee76 100644 --- a/types/multimap/nested/write.C +++ b/types/multimap/nested/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include @@ -21,10 +15,10 @@ using ROOT::RNTupleWriter; using Multimap = std::multimap>; -static std::shared_ptr MakeMultimapField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeMultimapField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); field->GetMutableSubfields()[0] ->GetMutableSubfields()[1] @@ -38,22 +32,24 @@ void write(std::string_view filename = "types.multimap.nested.root") { throw std::runtime_error("could not find the required ROOT dictionaries, " "please make sure to run `make` first"); - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMultimapField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeMultimapField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeMultimapField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeMultimapField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeMultimapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeMultimapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeMultimapField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeMultimapField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element maps, with ascending values *Index32 = {{"a", {{"aa", 1}}}}; diff --git a/types/multiset/fundamental/read.C b/types/multiset/fundamental/read.C index 8d064ba..65cfec9 100644 --- a/types/multiset/fundamental/read.C +++ b/types/multiset/fundamental/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,7 +10,7 @@ using ROOT::RNTupleReader; using Multiset = std::multiset; -static void PrintMultisetValue(const REntry &entry, std::string_view name, +static void PrintMultisetValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { Multiset &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; @@ -41,7 +38,7 @@ void read(std::string_view input = "types.multiset.fundamental.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/multiset/fundamental/write.C b/types/multiset/fundamental/write.C index ba264f8..7ba2289 100644 --- a/types/multiset/fundamental/write.C +++ b/types/multiset/fundamental/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -17,32 +11,34 @@ using ROOT::RNTupleWriter; using Multiset = std::multiset; -static std::shared_ptr MakeMultisetField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeMultisetField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.multiset.fundamental.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMultisetField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeMultisetField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeMultisetField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeMultisetField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeMultisetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeMultisetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeMultisetField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeMultisetField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element sets, with ascending values *Index32 = {1}; diff --git a/types/multiset/nested/read.C b/types/multiset/nested/read.C index f46a339..bf1967f 100644 --- a/types/multiset/nested/read.C +++ b/types/multiset/nested/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include @@ -16,8 +13,9 @@ using ROOT::RNTupleReader; using Multiset = std::multiset>; -static void PrintNestedMultisetValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintNestedMultisetValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { Multiset &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; bool outerFirst = true; @@ -61,7 +59,7 @@ void read(std::string_view input = "types.multiset.nested.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/multiset/nested/write.C b/types/multiset/nested/write.C index b72b632..7181562 100644 --- a/types/multiset/nested/write.C +++ b/types/multiset/nested/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include @@ -20,10 +14,10 @@ using ROOT::RNTupleWriter; using Multiset = std::multiset>; -static std::shared_ptr MakeMultisetField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeMultisetField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -35,22 +29,24 @@ void write(std::string_view filename = "types.multiset.nested.root") { throw std::runtime_error("could not find the required ROOT dictionaries, " "please make sure to run `make` first"); - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMultisetField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeMultisetField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeMultisetField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeMultisetField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeMultisetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeMultisetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeMultisetField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeMultisetField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element sets, with ascending values *Index32 = {{1}}; diff --git a/types/optional/read.C b/types/optional/read.C index 8a4321b..4ab3c1d 100644 --- a/types/optional/read.C +++ b/types/optional/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -52,7 +49,7 @@ template <> void PrintValue(const VectorInt32Ty &value, std::ostream &os) { } template -static void PrintOptionalValue(const REntry &entry, std::string_view name, +static void PrintOptionalValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &value = *entry.GetPtr>(name); os << " \"" << name << "\": "; @@ -67,8 +64,9 @@ static void PrintOptionalValue(const REntry &entry, std::string_view name, os << "\n"; } -static void PrintVectorOptValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintVectorOptValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { auto &value = *entry.GetPtr>>(name); os << " \"" << name << "\": ["; bool first = true; @@ -100,7 +98,7 @@ void read(std::string_view input = "types.optional.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/optional/write.C b/types/optional/write.C index 91e7ba9..1a423b0 100644 --- a/types/optional/write.C +++ b/types/optional/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -22,27 +16,29 @@ using OptInt32Ty = std::optional; using VariantTy = std::variant; using VectorInt32Ty = std::vector; -static std::shared_ptr MakeIntField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeIntField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.optional.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeIntField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeIntField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeIntField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeIntField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeIntField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeIntField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeIntField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeIntField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); auto String = model->MakeField>("String"); auto Variant = model->MakeField>("Variant"); @@ -51,10 +47,10 @@ void write(std::string_view filename = "types.optional.root") { auto VectorOpt = model->MakeField>>("VectorOpt"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: simple values *Index32 = 1; diff --git a/types/pair/read.C b/types/pair/read.C index c3b3d7b..a832cf4 100644 --- a/types/pair/read.C +++ b/types/pair/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -60,7 +57,7 @@ template <> void PrintValue(const Pair_Int32_String &value, std::ostream &os) { } template -static void PrintPairValue(const REntry &entry, std::string_view name, +static void PrintPairValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &value = *entry.GetPtr>(name); os << " \"" << name << "\": [\n"; @@ -77,8 +74,9 @@ static void PrintPairValue(const REntry &entry, std::string_view name, os << "\n"; } -static void PrintVectorPairValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintVectorPairValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { auto &value = *entry.GetPtr>(name); os << " \"" << name << "\": ["; bool first = true; @@ -106,7 +104,7 @@ void read(std::string_view input = "types.pair.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/pair/write.C b/types/pair/write.C index 0a16280..1afba25 100644 --- a/types/pair/write.C +++ b/types/pair/write.C @@ -2,10 +2,6 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -19,7 +15,7 @@ using Variant = std::variant; using VectorInt32 = std::vector; void write(std::string_view filename = "types.pair.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Int32_String = model->MakeField("Int32_String"); auto Variant_Vector = @@ -29,10 +25,10 @@ void write(std::string_view filename = "types.pair.root") { auto VectorPair = model->MakeField>("VectorPair"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: simple values *Int32_String = {1, "abc"}; diff --git a/types/set/fundamental/read.C b/types/set/fundamental/read.C index 8a777d7..170c8a3 100644 --- a/types/set/fundamental/read.C +++ b/types/set/fundamental/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,7 +10,7 @@ using ROOT::RNTupleReader; using Set = std::set; -static void PrintSetValue(const REntry &entry, std::string_view name, +static void PrintSetValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { Set &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; @@ -41,7 +38,7 @@ void read(std::string_view input = "types.set.fundamental.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/set/fundamental/write.C b/types/set/fundamental/write.C index d2c884f..b60ca83 100644 --- a/types/set/fundamental/write.C +++ b/types/set/fundamental/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -17,32 +11,34 @@ using ROOT::RNTupleWriter; using Set = std::set; -static std::shared_ptr MakeSetField(RNTupleModel &model, +static std::shared_ptr MakeSetField(ROOT::RNTupleModel &model, std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.set.fundamental.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeSetField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeSetField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeSetField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeSetField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeSetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeSetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeSetField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeSetField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element sets, with ascending values *Index32 = {1}; diff --git a/types/set/nested/read.C b/types/set/nested/read.C index 0c990ab..e05ac9b 100644 --- a/types/set/nested/read.C +++ b/types/set/nested/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include @@ -16,8 +13,9 @@ using ROOT::RNTupleReader; using Set = std::set>; -static void PrintNestedSetValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintNestedSetValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { Set &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; bool outerFirst = true; @@ -61,7 +59,7 @@ void read(std::string_view input = "types.set.nested.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/set/nested/write.C b/types/set/nested/write.C index 609cac0..e609347 100644 --- a/types/set/nested/write.C +++ b/types/set/nested/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include @@ -20,10 +14,10 @@ using ROOT::RNTupleWriter; using Set = std::set>; -static std::shared_ptr MakeSetField(RNTupleModel &model, +static std::shared_ptr MakeSetField(ROOT::RNTupleModel &model, std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -35,22 +29,24 @@ void write(std::string_view filename = "types.set.nested.root") { throw std::runtime_error("could not find the required ROOT dictionaries, " "please make sure to run `make` first"); - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeSetField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeSetField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeSetField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeSetField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeSetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeSetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeSetField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeSetField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element sets, with ascending values *Index32 = {{1}}; diff --git a/types/string/read.C b/types/string/read.C index faf7ed4..9e9a53c 100644 --- a/types/string/read.C +++ b/types/string/read.C @@ -1,15 +1,12 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include #include -static void PrintStringValue(const REntry &entry, std::string_view name, +static void PrintStringValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { std::string &value = *entry.GetPtr(name); os << " \"" << name << "\": \"" << value << "\""; @@ -24,7 +21,7 @@ void read(std::string_view input = "types.string.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/string/write.C b/types/string/write.C index efe592f..5bdfb92 100644 --- a/types/string/write.C +++ b/types/string/write.C @@ -4,42 +4,39 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include -static std::shared_ptr MakeStringField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); - field->SetColumnRepresentatives({{indexType, ENTupleColumnType::kChar}}); +static std::shared_ptr +MakeStringField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); + field->SetColumnRepresentatives( + {{indexType, ROOT::ENTupleColumnType::kChar}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.string.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeStringField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeStringField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeStringField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeStringField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeStringField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeStringField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeStringField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeStringField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: one character strings, with ascending values *Index32 = "a"; diff --git a/types/tuple/read.C b/types/tuple/read.C index 416a153..6901aa3 100644 --- a/types/tuple/read.C +++ b/types/tuple/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -50,7 +47,7 @@ template <> void PrintValue(const Tuple_Int32_String &value, std::ostream &os) { os << " ]"; } -static void PrintTupleValue(const REntry &entry, std::string_view name, +static void PrintTupleValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &value = *entry.GetPtr>(name); @@ -71,7 +68,7 @@ static void PrintTupleValue(const REntry &entry, std::string_view name, os << "\n"; } -static void PrintVariantValue(const REntry &entry, std::string_view name, +static void PrintVariantValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &value = *entry.GetPtr>>(name); @@ -91,7 +88,7 @@ static void PrintVariantValue(const REntry &entry, std::string_view name, os << "\n"; } -static void PrintNestedValue(const REntry &entry, std::string_view name, +static void PrintNestedValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &value = *entry.GetPtr>(name); os << " \"" << name << "\": [\n"; @@ -105,8 +102,9 @@ static void PrintNestedValue(const REntry &entry, std::string_view name, os << "\n"; } -static void PrintVectorTupleValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintVectorTupleValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { auto &value = *entry.GetPtr>(name); os << " \"" << name << "\": ["; bool first = true; @@ -134,7 +132,7 @@ void read(std::string_view input = "types.tuple.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/tuple/write.C b/types/tuple/write.C index cde5df7..7a2c073 100644 --- a/types/tuple/write.C +++ b/types/tuple/write.C @@ -2,10 +2,6 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -18,7 +14,7 @@ using Tuple_Int32_String = std::tuple; using VectorInt32 = std::vector; void write(std::string_view filename = "types.tuple.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto Int32_String_Vector = model->MakeField>( @@ -30,10 +26,10 @@ void write(std::string_view filename = "types.tuple.root") { auto VectorTuple = model->MakeField>("VectorTuple"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: simple values *Int32_String_Vector = {1, "abc", {2, 3, 4}}; diff --git a/types/unique_ptr/read.C b/types/unique_ptr/read.C index fb8a6e9..1391681 100644 --- a/types/unique_ptr/read.C +++ b/types/unique_ptr/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -51,8 +48,9 @@ template <> void PrintValue(const VectorInt32Ty &value, std::ostream &os) { } template -static void PrintUniquePtrValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintUniquePtrValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { auto &value = *entry.GetPtr>(name); os << " \"" << name << "\": "; if (!value) { @@ -66,8 +64,9 @@ static void PrintUniquePtrValue(const REntry &entry, std::string_view name, os << "\n"; } -static void PrintVectorPtrValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintVectorPtrValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { auto &value = *entry.GetPtr>>(name); os << " \"" << name << "\": ["; bool first = true; @@ -99,7 +98,7 @@ void read(std::string_view input = "types.unique_ptr.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/unique_ptr/write.C b/types/unique_ptr/write.C index 9e82bb0..00240ea 100644 --- a/types/unique_ptr/write.C +++ b/types/unique_ptr/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -21,27 +15,29 @@ using PtrInt32Ty = std::unique_ptr; using VariantTy = std::variant; using VectorInt32Ty = std::vector; -static std::shared_ptr MakeIntField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeIntField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.unique_ptr.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeIntField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeIntField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeIntField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeIntField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeIntField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeIntField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeIntField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeIntField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); auto String = model->MakeField>("String"); auto Variant = model->MakeField>("Variant"); @@ -50,10 +46,10 @@ void write(std::string_view filename = "types.unique_ptr.root") { auto VectorPtr = model->MakeField>>("VectorPtr"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: simple values *Index32 = std::make_unique(1); diff --git a/types/unordered_map/fundamental/read.C b/types/unordered_map/fundamental/read.C index a9cbbaa..60d2f30 100644 --- a/types/unordered_map/fundamental/read.C +++ b/types/unordered_map/fundamental/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,7 +10,7 @@ using ROOT::RNTupleReader; using UnorderedMap = std::unordered_map; -static void PrintMapValue(const REntry &entry, std::string_view name, +static void PrintMapValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { UnorderedMap &item = *entry.GetPtr(name); @@ -45,7 +42,7 @@ void read(std::string_view input = "types.unordered_map.fundamental.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/unordered_map/fundamental/write.C b/types/unordered_map/fundamental/write.C index a621c76..17625a9 100644 --- a/types/unordered_map/fundamental/write.C +++ b/types/unordered_map/fundamental/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -17,32 +11,34 @@ using ROOT::RNTupleWriter; using UnorderedMap = std::unordered_map; -static std::shared_ptr MakeMapField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeMapField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.unordered_map.fundamental.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMapField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeMapField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeMapField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeMapField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeMapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeMapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeMapField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeMapField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element maps, with ascending values *Index32 = {{"a", 1}}; diff --git a/types/unordered_map/nested/read.C b/types/unordered_map/nested/read.C index 2542d90..d858997 100644 --- a/types/unordered_map/nested/read.C +++ b/types/unordered_map/nested/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include @@ -18,7 +15,7 @@ using UnorderedMap = std::unordered_map>; -static void PrintNestedUnorderedMapValue(const REntry &entry, +static void PrintNestedUnorderedMapValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { UnorderedMap &item = *entry.GetPtr(name); @@ -79,7 +76,7 @@ void read(std::string_view input = "types.unordered_map.nested.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/unordered_map/nested/write.C b/types/unordered_map/nested/write.C index fec67ac..670f9cc 100644 --- a/types/unordered_map/nested/write.C +++ b/types/unordered_map/nested/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include @@ -21,10 +15,10 @@ using ROOT::RNTupleWriter; using UnorderedMap = std::unordered_map>; -static std::shared_ptr MakeUnorderedMapField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeUnorderedMapField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); field->GetMutableSubfields()[0] ->GetMutableSubfields()[1] @@ -38,22 +32,24 @@ void write(std::string_view filename = "types.unordered_map.nested.root") { throw std::runtime_error("could not find the required ROOT dictionaries, " "please make sure to run `make` first"); - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeUnorderedMapField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeUnorderedMapField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = MakeUnorderedMapField(*model, "Index32", + ROOT::ENTupleColumnType::kIndex32); + auto Index64 = MakeUnorderedMapField(*model, "Index64", + ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeUnorderedMapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeUnorderedMapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeUnorderedMapField( + *model, "SplitIndex32", ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeUnorderedMapField( + *model, "SplitIndex64", ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element maps, with ascending values *Index32 = {{"a", {{"aa", 1}}}}; diff --git a/types/unordered_multimap/fundamental/read.C b/types/unordered_multimap/fundamental/read.C index cf4a66e..8e451ad 100644 --- a/types/unordered_multimap/fundamental/read.C +++ b/types/unordered_multimap/fundamental/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,7 +10,7 @@ using ROOT::RNTupleReader; using UnorderedMultimap = std::unordered_multimap; -static void PrintMultimapValue(const REntry &entry, std::string_view name, +static void PrintMultimapValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { UnorderedMultimap &item = *entry.GetPtr(name); @@ -48,7 +45,7 @@ void read( std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/unordered_multimap/fundamental/write.C b/types/unordered_multimap/fundamental/write.C index bf3fc16..d269de4 100644 --- a/types/unordered_multimap/fundamental/write.C +++ b/types/unordered_multimap/fundamental/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -17,32 +11,34 @@ using ROOT::RNTupleWriter; using UnorderedMultimap = std::unordered_multimap; -static std::shared_ptr MakeMultimapField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeMultimapField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.unordered_multimap.fundamental.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeMultimapField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeMultimapField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeMultimapField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeMultimapField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeMultimapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeMultimapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeMultimapField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeMultimapField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element maps, with ascending values *Index32 = {{"a", 1}}; diff --git a/types/unordered_multimap/nested/read.C b/types/unordered_multimap/nested/read.C index 3499c20..e4b74e3 100644 --- a/types/unordered_multimap/nested/read.C +++ b/types/unordered_multimap/nested/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include @@ -18,7 +15,7 @@ using UnorderedMultimap = std::unordered_multimap>; -static void PrintNestedUnorderedMultimapValue(const REntry &entry, +static void PrintNestedUnorderedMultimapValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { @@ -80,7 +77,7 @@ void read(std::string_view input = "types.unordered_multimap.nested.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/unordered_multimap/nested/write.C b/types/unordered_multimap/nested/write.C index adba533..6dd7199 100644 --- a/types/unordered_multimap/nested/write.C +++ b/types/unordered_multimap/nested/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include @@ -21,10 +15,10 @@ using ROOT::RNTupleWriter; using UnorderedMultimap = std::unordered_multimap>; -static std::shared_ptr MakeUnorderedMultimapField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeUnorderedMultimapField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); field->GetMutableSubfields()[0] ->GetMutableSubfields()[1] @@ -38,22 +32,24 @@ void write(std::string_view filename = "types.unordered_multimap.nested.root") { throw std::runtime_error("could not find the required ROOT dictionaries, " "please make sure to run `make` first"); - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeUnorderedMultimapField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeUnorderedMultimapField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = MakeUnorderedMultimapField(*model, "Index32", + ROOT::ENTupleColumnType::kIndex32); + auto Index64 = MakeUnorderedMultimapField(*model, "Index64", + ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeUnorderedMultimapField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeUnorderedMultimapField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeUnorderedMultimapField( + *model, "SplitIndex32", ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeUnorderedMultimapField( + *model, "SplitIndex64", ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element maps, with ascending values *Index32 = {{"a", {{"aa", 1}}}}; diff --git a/types/unordered_multiset/fundamental/read.C b/types/unordered_multiset/fundamental/read.C index 3771b88..144e53c 100644 --- a/types/unordered_multiset/fundamental/read.C +++ b/types/unordered_multiset/fundamental/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,7 +10,7 @@ using ROOT::RNTupleReader; using UnorderedMultiSet = std::unordered_multiset; -static void PrintUnorderedMultiSetValue(const REntry &entry, +static void PrintUnorderedMultiSetValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { UnorderedMultiSet &value = *entry.GetPtr(name); @@ -47,7 +44,7 @@ void read( std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/unordered_multiset/fundamental/write.C b/types/unordered_multiset/fundamental/write.C index 794121f..c676a0d 100644 --- a/types/unordered_multiset/fundamental/write.C +++ b/types/unordered_multiset/fundamental/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -18,9 +12,9 @@ using ROOT::RNTupleWriter; using UnorderedMultiSet = std::unordered_multiset; static std::shared_ptr -MakeUnorderedMultiSetField(RNTupleModel &model, std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +MakeUnorderedMultiSetField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); @@ -28,24 +22,24 @@ MakeUnorderedMultiSetField(RNTupleModel &model, std::string_view name, void write( std::string_view filename = "types.unordered_multiset.fundamental.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = - MakeUnorderedMultiSetField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = - MakeUnorderedMultiSetField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = MakeUnorderedMultiSetField(*model, "Index32", + ROOT::ENTupleColumnType::kIndex32); + auto Index64 = MakeUnorderedMultiSetField(*model, "Index64", + ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = MakeUnorderedMultiSetField(*model, "SplitIndex32", - ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = MakeUnorderedMultiSetField(*model, "SplitIndex64", - ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeUnorderedMultiSetField( + *model, "SplitIndex32", ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeUnorderedMultiSetField( + *model, "SplitIndex64", ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element sets, with ascending values *Index32 = {1}; diff --git a/types/unordered_multiset/nested/read.C b/types/unordered_multiset/nested/read.C index 3c7444e..76fc4fe 100644 --- a/types/unordered_multiset/nested/read.C +++ b/types/unordered_multiset/nested/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include @@ -17,7 +14,7 @@ using ROOT::RNTupleReader; using UnorderedMultiset = std::unordered_multiset>; -static void PrintNestedUnorderedMultisetValue(const REntry &entry, +static void PrintNestedUnorderedMultisetValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { @@ -76,7 +73,7 @@ void read(std::string_view input = "types.unordered_multiset.nested.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/unordered_multiset/nested/write.C b/types/unordered_multiset/nested/write.C index bf8f965..e8f964d 100644 --- a/types/unordered_multiset/nested/write.C +++ b/types/unordered_multiset/nested/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include @@ -24,9 +18,9 @@ using UnorderedMultiset = std::unordered_multiset>; static std::shared_ptr -MakeUnorderedMultisetField(RNTupleModel &model, std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +MakeUnorderedMultisetField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -38,24 +32,24 @@ void write(std::string_view filename = "types.unordered_multiset.nested.root") { throw std::runtime_error("could not find the required ROOT dictionaries, " "please make sure to run `make` first"); - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = - MakeUnorderedMultisetField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = - MakeUnorderedMultisetField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = MakeUnorderedMultisetField(*model, "Index32", + ROOT::ENTupleColumnType::kIndex32); + auto Index64 = MakeUnorderedMultisetField(*model, "Index64", + ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = MakeUnorderedMultisetField(*model, "SplitIndex32", - ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = MakeUnorderedMultisetField(*model, "SplitIndex64", - ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeUnorderedMultisetField( + *model, "SplitIndex32", ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeUnorderedMultisetField( + *model, "SplitIndex64", ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element sets, with ascending values *Index32 = {{1}}; diff --git a/types/unordered_set/fundamental/read.C b/types/unordered_set/fundamental/read.C index d077eaa..7b70148 100644 --- a/types/unordered_set/fundamental/read.C +++ b/types/unordered_set/fundamental/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,8 +10,9 @@ using ROOT::RNTupleReader; using UnorderedSet = std::unordered_set; -static void PrintUnorderedSetValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintUnorderedSetValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { UnorderedSet &value = *entry.GetPtr(name); std::vector valueSorted(value.begin(), value.end()); @@ -45,7 +43,7 @@ void read(std::string_view input = "types.unordered_set.fundamental.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/unordered_set/fundamental/write.C b/types/unordered_set/fundamental/write.C index c74154a..5e3b1ce 100644 --- a/types/unordered_set/fundamental/write.C +++ b/types/unordered_set/fundamental/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -18,33 +12,33 @@ using ROOT::RNTupleWriter; using UnorderedSet = std::unordered_set; static std::shared_ptr -MakeUnorderedSetField(RNTupleModel &model, std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +MakeUnorderedSetField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.unordered_set.fundamental.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = - MakeUnorderedSetField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = - MakeUnorderedSetField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = MakeUnorderedSetField(*model, "Index32", + ROOT::ENTupleColumnType::kIndex32); + auto Index64 = MakeUnorderedSetField(*model, "Index64", + ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeUnorderedSetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeUnorderedSetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeUnorderedSetField( + *model, "SplitIndex32", ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeUnorderedSetField( + *model, "SplitIndex64", ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element sets, with ascending values *Index32 = {1}; diff --git a/types/unordered_set/nested/read.C b/types/unordered_set/nested/read.C index 41f8421..43584d9 100644 --- a/types/unordered_set/nested/read.C +++ b/types/unordered_set/nested/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include @@ -16,7 +13,7 @@ using ROOT::RNTupleReader; using UnorderedSet = std::unordered_set>; -static void PrintNestedUnorderedSetValue(const REntry &entry, +static void PrintNestedUnorderedSetValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { UnorderedSet &value = *entry.GetPtr(name); @@ -73,7 +70,7 @@ void read(std::string_view input = "types.unordered_set.nested.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/unordered_set/nested/write.C b/types/unordered_set/nested/write.C index bb7e6bf..79a6f54 100644 --- a/types/unordered_set/nested/write.C +++ b/types/unordered_set/nested/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include @@ -23,9 +17,9 @@ using ROOT::RNTupleWriter; using UnorderedSet = std::unordered_set>; static std::shared_ptr -MakeUnorderedSetField(RNTupleModel &model, std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +MakeUnorderedSetField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -37,24 +31,24 @@ void write(std::string_view filename = "types.unordered_set.nested.root") { throw std::runtime_error("could not find the required ROOT dictionaries, " "please make sure to run `make` first"); - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = - MakeUnorderedSetField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = - MakeUnorderedSetField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = MakeUnorderedSetField(*model, "Index32", + ROOT::ENTupleColumnType::kIndex32); + auto Index64 = MakeUnorderedSetField(*model, "Index64", + ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeUnorderedSetField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeUnorderedSetField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeUnorderedSetField( + *model, "SplitIndex32", ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeUnorderedSetField( + *model, "SplitIndex64", ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element sets, with ascending values *Index32 = {{1}}; diff --git a/types/user/class/read.C b/types/user/class/read.C index 957751a..5e0772c 100644 --- a/types/user/class/read.C +++ b/types/user/class/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include @@ -51,7 +48,7 @@ static void PrintUserMembers(const User &value, std::ostream &os, os << indent << "}\n"; } -static void PrintUserValue(const REntry &entry, std::string_view name, +static void PrintUserValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &value = *entry.GetPtr(name); os << " \"" << name << "\": {\n"; @@ -63,7 +60,7 @@ static void PrintUserValue(const REntry &entry, std::string_view name, os << "\n"; } -static void PrintUserVector(const REntry &entry, std::string_view name, +static void PrintUserVector(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { auto &vector = *entry.GetPtr>(name); os << " \"" << name << "\": ["; @@ -97,7 +94,7 @@ void read(std::string_view input = "types.user.class.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/user/class/write.C b/types/user/class/write.C index db84961..ebd9bb7 100644 --- a/types/user/class/write.C +++ b/types/user/class/write.C @@ -2,10 +2,6 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include @@ -17,15 +13,15 @@ void write(std::string_view filename = "types.user.class.root") { throw std::runtime_error("could not find the required ROOT dictionaries, " "please make sure to run `make` first"); - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto value = model->MakeField("f"); auto vector = model->MakeField>("Vector"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: simple values value->fInt = 1; diff --git a/types/user/enum/read.C b/types/user/enum/read.C index dffc12a..08e7907 100644 --- a/types/user/enum/read.C +++ b/types/user/enum/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include @@ -16,7 +13,7 @@ using ROOT::RNTupleReader; #include "UserEnum.hxx" template -static void PrintEnumValue(const REntry &entry, std::string_view name, +static void PrintEnumValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { T value = *entry.GetPtr(name); os << " \"" << name << "\": "; @@ -38,7 +35,7 @@ void read(std::string_view input = "types.user.enum.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/user/enum/write.C b/types/user/enum/write.C index 941cfe0..76aa144 100644 --- a/types/user/enum/write.C +++ b/types/user/enum/write.C @@ -2,10 +2,6 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include @@ -17,7 +13,7 @@ void write(std::string_view filename = "types.user.enum.root") { throw std::runtime_error("could not find the required ROOT dictionaries, " "please make sure to run `make` first"); - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // TODO: enums with bool underlying type are possible since ROOT 6.38 auto EInt8 = model->MakeField("EnumInt8"); @@ -29,10 +25,10 @@ void write(std::string_view filename = "types.user.enum.root") { auto EInt64 = model->MakeField("EnumInt64"); auto EUInt64 = model->MakeField("EnumUInt64"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: simple values *EInt8 = EnumInt8::Simple; // = 1; diff --git a/types/variant/read.C b/types/variant/read.C index 34b1798..24fb3c7 100644 --- a/types/variant/read.C +++ b/types/variant/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -16,7 +13,7 @@ using VectorInt32 = std::vector; using Variant = std::variant; using Vector = std::vector>; -static void PrintVariantValue(const REntry &entry, std::string_view name, +static void PrintVariantValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { Variant &value = *entry.GetPtr(name); os << " \"" << name << "\": "; @@ -48,7 +45,7 @@ static void PrintVariantValue(const REntry &entry, std::string_view name, os << "\n"; } -static void PrintVectorValue(const REntry &entry, std::string_view name, +static void PrintVectorValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { Vector &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; @@ -82,7 +79,7 @@ void read(std::string_view input = "types.variant.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/variant/write.C b/types/variant/write.C index 7a7181a..ff7949c 100644 --- a/types/variant/write.C +++ b/types/variant/write.C @@ -2,10 +2,6 @@ #include #include -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -17,15 +13,15 @@ using Variant = std::variant; using Vector = std::vector>; void write(std::string_view filename = "types.variant.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); auto value = model->MakeField("f"); auto vector = model->MakeField("Vector"); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: std::int32_t *value = 1; diff --git a/types/vector/fundamental/read.C b/types/vector/fundamental/read.C index 7430554..fe3f3c4 100644 --- a/types/vector/fundamental/read.C +++ b/types/vector/fundamental/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,7 +10,7 @@ using ROOT::RNTupleReader; using Vector = std::vector; -static void PrintVectorValue(const REntry &entry, std::string_view name, +static void PrintVectorValue(const ROOT::REntry &entry, std::string_view name, std::ostream &os, bool last = false) { Vector &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; @@ -41,7 +38,7 @@ void read(std::string_view input = "types.vector.fundamental.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/vector/fundamental/write.C b/types/vector/fundamental/write.C index 19962ee..621ba72 100644 --- a/types/vector/fundamental/write.C +++ b/types/vector/fundamental/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -17,32 +11,34 @@ using ROOT::RNTupleWriter; using Vector = std::vector; -static std::shared_ptr MakeVectorField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeVectorField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); return model.GetDefaultEntry().GetPtr(name); } void write(std::string_view filename = "types.vector.fundamental.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeVectorField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeVectorField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeVectorField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeVectorField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeVectorField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeVectorField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeVectorField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeVectorField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element vectors, with ascending values *Index32 = {1}; diff --git a/types/vector/nested/read.C b/types/vector/nested/read.C index 0251e8f..b01ca92 100644 --- a/types/vector/nested/read.C +++ b/types/vector/nested/read.C @@ -1,9 +1,6 @@ #include #include -using ROOT::REntry; -using ROOT::RNTupleReader; - #include #include #include @@ -13,8 +10,9 @@ using ROOT::RNTupleReader; using Vector = std::vector>; -static void PrintNestedVectorValue(const REntry &entry, std::string_view name, - std::ostream &os, bool last = false) { +static void PrintNestedVectorValue(const ROOT::REntry &entry, + std::string_view name, std::ostream &os, + bool last = false) { Vector &value = *entry.GetPtr(name); os << " \"" << name << "\": ["; bool outerFirst = true; @@ -54,7 +52,7 @@ void read(std::string_view input = "types.vector.nested.root", std::ofstream os(std::string{output}); os << "[\n"; - auto reader = RNTupleReader::Open("ntpl", input); + auto reader = ROOT::RNTupleReader::Open("ntpl", input); auto &entry = reader->GetModel().GetDefaultEntry(); bool first = true; for (auto index : *reader) { diff --git a/types/vector/nested/write.C b/types/vector/nested/write.C index 40bf241..f022144 100644 --- a/types/vector/nested/write.C +++ b/types/vector/nested/write.C @@ -4,12 +4,6 @@ #include #include -using ROOT::ENTupleColumnType; -using ROOT::RField; -using ROOT::RNTupleModel; -using ROOT::RNTupleWriteOptions; -using ROOT::RNTupleWriter; - #include #include #include @@ -17,10 +11,10 @@ using ROOT::RNTupleWriter; using Vector = std::vector>; -static std::shared_ptr MakeVectorField(RNTupleModel &model, - std::string_view name, - ENTupleColumnType indexType) { - auto field = std::make_unique>(name); +static std::shared_ptr +MakeVectorField(ROOT::RNTupleModel &model, std::string_view name, + ROOT::ENTupleColumnType indexType) { + auto field = std::make_unique>(name); field->SetColumnRepresentatives({{indexType}}); field->GetMutableSubfields()[0]->SetColumnRepresentatives({{indexType}}); model.AddField(std::move(field)); @@ -28,22 +22,24 @@ static std::shared_ptr MakeVectorField(RNTupleModel &model, } void write(std::string_view filename = "types.vector.nested.root") { - auto model = RNTupleModel::Create(); + auto model = ROOT::RNTupleModel::Create(); // Non-split index encoding - auto Index32 = MakeVectorField(*model, "Index32", ENTupleColumnType::kIndex32); - auto Index64 = MakeVectorField(*model, "Index64", ENTupleColumnType::kIndex64); + auto Index32 = + MakeVectorField(*model, "Index32", ROOT::ENTupleColumnType::kIndex32); + auto Index64 = + MakeVectorField(*model, "Index64", ROOT::ENTupleColumnType::kIndex64); // Split index encoding - auto SplitIndex32 = - MakeVectorField(*model, "SplitIndex32", ENTupleColumnType::kSplitIndex32); - auto SplitIndex64 = - MakeVectorField(*model, "SplitIndex64", ENTupleColumnType::kSplitIndex64); + auto SplitIndex32 = MakeVectorField(*model, "SplitIndex32", + ROOT::ENTupleColumnType::kSplitIndex32); + auto SplitIndex64 = MakeVectorField(*model, "SplitIndex64", + ROOT::ENTupleColumnType::kSplitIndex64); - RNTupleWriteOptions options; + ROOT::RNTupleWriteOptions options; options.SetCompression(0); - auto writer = - RNTupleWriter::Recreate(std::move(model), "ntpl", filename, options); + auto writer = ROOT::RNTupleWriter::Recreate(std::move(model), "ntpl", + filename, options); // First entry: single-element vectors, with ascending values *Index32 = {{1}}; From 40409d1d6707eb950258c21da50f076368ab45c2 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Wed, 22 Apr 2026 13:01:05 +0200 Subject: [PATCH 3/6] Remove RVec workaround for ROOT 6.34 --- types/RVec/nested/write.C | 7 ------- 1 file changed, 7 deletions(-) diff --git a/types/RVec/nested/write.C b/types/RVec/nested/write.C index b125486..cf4c21f 100644 --- a/types/RVec/nested/write.C +++ b/types/RVec/nested/write.C @@ -62,11 +62,4 @@ void write(std::string_view filename = "types.RVec.nested.root") { *SplitIndex32 = {{4}, {}, {5, 6}}; *SplitIndex64 = {{}, {7, 8, 9}, {}, {10}}; writer->Fill(); - - // Work around bug in 6.34 for destroying RVec's, later fixed by commit - // https://github.com/root-project/root/commit/996cac359d for 6.36. - Index32->clear(); - Index64->clear(); - SplitIndex32->clear(); - SplitIndex64->clear(); } From 9001bb662d9fa39937fe6a4fd5d6cc4c51d31f54 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Mon, 30 Mar 2026 15:41:13 +0200 Subject: [PATCH 4/6] feature_flag: Disable compression during Commit Since ROOT 6.36, RNTupleFileWriter::Commit() takes a compression parameter. --- structure/feature_flag/write.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/structure/feature_flag/write.C b/structure/feature_flag/write.C index 0e03e6e..6f969d4 100644 --- a/structure/feature_flag/write.C +++ b/structure/feature_flag/write.C @@ -48,7 +48,7 @@ void write(std::string_view filename = "structure.feature_flag.root") { serializer.SerializeFooter(buffer.get(), descriptor, ctx); writer->WriteNTupleFooter(buffer.get(), szFooter, szFooter); - writer->Commit(); + writer->Commit(options.GetCompression()); // Call destructor to flush data to disk writer.reset(); } From 6c656b279b7f0c70451bf4e135f622ae0dff5fc6 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Mon, 30 Mar 2026 15:41:13 +0200 Subject: [PATCH 5/6] feature_flag: Call RNTupleDescriptorBuilder::SetVersionForWriting It is mandatory since the backport to ROOT 6.36.04. --- structure/feature_flag/write.C | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/structure/feature_flag/write.C b/structure/feature_flag/write.C index 6f969d4..0c348b9 100644 --- a/structure/feature_flag/write.C +++ b/structure/feature_flag/write.C @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -19,8 +20,9 @@ void write(std::string_view filename = "structure.feature_flag.root") { // low-level classes to create the file. RNTupleDescriptorBuilder descBuilder; - // The following line will be required as of ROOT v6.36 - // descBuilder.SetVersionForWriting(); +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 36, 4) + descBuilder.SetVersionForWriting(); +#endif descBuilder.SetNTuple("ntpl", ""); descBuilder.SetFeature(ROOT::RNTupleDescriptor::kFeatureFlagTest); descBuilder.AddField(RFieldDescriptorBuilder::FromField(ROOT::RFieldZero()) From 7136ce321c46cd414a708f95b851329f188fe1f9 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Wed, 22 Apr 2026 11:45:11 +0200 Subject: [PATCH 6/6] Include ROOT/RNTupleTypes.hxx, if available It replaces ROOT/RNTupleUtil.hxx, which is deprecated. --- compression/algorithms/write_algorithm.hxx | 4 ++++ compression/block/big/write.C | 4 ++++ compression/block/short/write.C | 4 ++++ projections/cardinality/read.C | 4 ++++ projections/cardinality/write.C | 4 ++++ projections/leaf/read.C | 1 - types/RVec/fundamental/write.C | 4 ++++ types/RVec/nested/write.C | 4 ++++ types/fundamental/integer/write.C | 4 ++++ types/fundamental/misc/write.C | 4 ++++ types/fundamental/real/write.C | 4 ++++ types/fundamental/real32quant/write.C | 4 ++++ types/fundamental/real32trunc/write.C | 4 ++++ types/map/fundamental/write.C | 4 ++++ types/map/nested/write.C | 4 ++++ types/multimap/fundamental/write.C | 4 ++++ types/multimap/nested/write.C | 4 ++++ types/multiset/fundamental/write.C | 4 ++++ types/multiset/nested/write.C | 4 ++++ types/optional/write.C | 4 ++++ types/set/fundamental/write.C | 4 ++++ types/set/nested/write.C | 4 ++++ types/string/write.C | 4 ++++ types/unique_ptr/write.C | 4 ++++ types/unordered_map/fundamental/write.C | 4 ++++ types/unordered_map/nested/write.C | 4 ++++ types/unordered_multimap/fundamental/write.C | 4 ++++ types/unordered_multimap/nested/write.C | 4 ++++ types/unordered_multiset/fundamental/write.C | 4 ++++ types/unordered_multiset/nested/write.C | 4 ++++ types/unordered_set/fundamental/write.C | 4 ++++ types/unordered_set/nested/write.C | 4 ++++ types/vector/fundamental/write.C | 4 ++++ types/vector/nested/write.C | 4 ++++ 34 files changed, 132 insertions(+), 1 deletion(-) diff --git a/compression/algorithms/write_algorithm.hxx b/compression/algorithms/write_algorithm.hxx index f3dabbb..dea1b32 100644 --- a/compression/algorithms/write_algorithm.hxx +++ b/compression/algorithms/write_algorithm.hxx @@ -1,5 +1,9 @@ #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/compression/block/big/write.C b/compression/block/big/write.C index 8b90071..799650a 100644 --- a/compression/block/big/write.C +++ b/compression/block/big/write.C @@ -1,5 +1,9 @@ #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/compression/block/short/write.C b/compression/block/short/write.C index dc99397..cc959ee 100644 --- a/compression/block/short/write.C +++ b/compression/block/short/write.C @@ -1,5 +1,9 @@ #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/projections/cardinality/read.C b/projections/cardinality/read.C index 5e0a29f..b42fd2f 100644 --- a/projections/cardinality/read.C +++ b/projections/cardinality/read.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/projections/cardinality/write.C b/projections/cardinality/write.C index 49e34d6..0240fbd 100644 --- a/projections/cardinality/write.C +++ b/projections/cardinality/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/projections/leaf/read.C b/projections/leaf/read.C index e510d4e..928e3dc 100644 --- a/projections/leaf/read.C +++ b/projections/leaf/read.C @@ -1,6 +1,5 @@ #include #include -#include #include #include diff --git a/types/RVec/fundamental/write.C b/types/RVec/fundamental/write.C index 9ff7913..b123d01 100644 --- a/types/RVec/fundamental/write.C +++ b/types/RVec/fundamental/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include #include diff --git a/types/RVec/nested/write.C b/types/RVec/nested/write.C index cf4c21f..8f672c2 100644 --- a/types/RVec/nested/write.C +++ b/types/RVec/nested/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include #include diff --git a/types/fundamental/integer/write.C b/types/fundamental/integer/write.C index 6ce3036..44fe9c4 100644 --- a/types/fundamental/integer/write.C +++ b/types/fundamental/integer/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/fundamental/misc/write.C b/types/fundamental/misc/write.C index 86b83ec..21256bf 100644 --- a/types/fundamental/misc/write.C +++ b/types/fundamental/misc/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/fundamental/real/write.C b/types/fundamental/real/write.C index ac2fd2e..9f4b53d 100644 --- a/types/fundamental/real/write.C +++ b/types/fundamental/real/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/fundamental/real32quant/write.C b/types/fundamental/real32quant/write.C index b89090e..516883a 100644 --- a/types/fundamental/real32quant/write.C +++ b/types/fundamental/real32quant/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/fundamental/real32trunc/write.C b/types/fundamental/real32trunc/write.C index 8c4ad29..247cbd3 100644 --- a/types/fundamental/real32trunc/write.C +++ b/types/fundamental/real32trunc/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/map/fundamental/write.C b/types/map/fundamental/write.C index 835f99d..b528ea3 100644 --- a/types/map/fundamental/write.C +++ b/types/map/fundamental/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/map/nested/write.C b/types/map/nested/write.C index 7a18cfc..be1bb08 100644 --- a/types/map/nested/write.C +++ b/types/map/nested/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/multimap/fundamental/write.C b/types/multimap/fundamental/write.C index 7cb3b23..288baaf 100644 --- a/types/multimap/fundamental/write.C +++ b/types/multimap/fundamental/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/multimap/nested/write.C b/types/multimap/nested/write.C index c20ee76..85aa2c4 100644 --- a/types/multimap/nested/write.C +++ b/types/multimap/nested/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/multiset/fundamental/write.C b/types/multiset/fundamental/write.C index 7ba2289..87a1aaa 100644 --- a/types/multiset/fundamental/write.C +++ b/types/multiset/fundamental/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/multiset/nested/write.C b/types/multiset/nested/write.C index 7181562..b439f4c 100644 --- a/types/multiset/nested/write.C +++ b/types/multiset/nested/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/optional/write.C b/types/optional/write.C index 1a423b0..84c05f2 100644 --- a/types/optional/write.C +++ b/types/optional/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/set/fundamental/write.C b/types/set/fundamental/write.C index b60ca83..1db80b9 100644 --- a/types/set/fundamental/write.C +++ b/types/set/fundamental/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/set/nested/write.C b/types/set/nested/write.C index e609347..08b1b3f 100644 --- a/types/set/nested/write.C +++ b/types/set/nested/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/string/write.C b/types/string/write.C index 5bdfb92..04268d8 100644 --- a/types/string/write.C +++ b/types/string/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/unique_ptr/write.C b/types/unique_ptr/write.C index 00240ea..0485387 100644 --- a/types/unique_ptr/write.C +++ b/types/unique_ptr/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/unordered_map/fundamental/write.C b/types/unordered_map/fundamental/write.C index 17625a9..669713c 100644 --- a/types/unordered_map/fundamental/write.C +++ b/types/unordered_map/fundamental/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/unordered_map/nested/write.C b/types/unordered_map/nested/write.C index 670f9cc..58f4dbb 100644 --- a/types/unordered_map/nested/write.C +++ b/types/unordered_map/nested/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/unordered_multimap/fundamental/write.C b/types/unordered_multimap/fundamental/write.C index d269de4..a3227dd 100644 --- a/types/unordered_multimap/fundamental/write.C +++ b/types/unordered_multimap/fundamental/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/unordered_multimap/nested/write.C b/types/unordered_multimap/nested/write.C index 6dd7199..9063d4d 100644 --- a/types/unordered_multimap/nested/write.C +++ b/types/unordered_multimap/nested/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/unordered_multiset/fundamental/write.C b/types/unordered_multiset/fundamental/write.C index c676a0d..f696bb8 100644 --- a/types/unordered_multiset/fundamental/write.C +++ b/types/unordered_multiset/fundamental/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/unordered_multiset/nested/write.C b/types/unordered_multiset/nested/write.C index e8f964d..96d7b3f 100644 --- a/types/unordered_multiset/nested/write.C +++ b/types/unordered_multiset/nested/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/unordered_set/fundamental/write.C b/types/unordered_set/fundamental/write.C index 5e3b1ce..e68fd83 100644 --- a/types/unordered_set/fundamental/write.C +++ b/types/unordered_set/fundamental/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/unordered_set/nested/write.C b/types/unordered_set/nested/write.C index 79a6f54..f1fa22c 100644 --- a/types/unordered_set/nested/write.C +++ b/types/unordered_set/nested/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/vector/fundamental/write.C b/types/vector/fundamental/write.C index 621ba72..2c69676 100644 --- a/types/vector/fundamental/write.C +++ b/types/vector/fundamental/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include diff --git a/types/vector/nested/write.C b/types/vector/nested/write.C index f022144..8dbf28a 100644 --- a/types/vector/nested/write.C +++ b/types/vector/nested/write.C @@ -1,6 +1,10 @@ #include #include +#if __has_include() +#include +#else #include +#endif #include #include