Skip to content

Commit

Permalink
change Switch from 64 bits to 96 bits and update the Cardinality test…
Browse files Browse the repository at this point in the history
… sample
  • Loading branch information
Moelf committed Jan 19, 2024
1 parent fdf23d4 commit d6ee392
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/RNTuple/constants.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# the signed ones are not used
@define_integers 64 SignedSwitch Switch
@define_integers 96 SignedSwitch Switch
@define_integers 32 SignedIndex32 Index32
@define_integers 64 SignedIndex64 Index64

Expand Down Expand Up @@ -38,7 +38,7 @@ const rntuple_col_type_dict = (
const rntuple_col_nbits_dict = (
64,
32,
64, # Switch
96, # Switch
8,
8, # char
1, # it's actually `Bit` in ROOT, there's no byte in RNTuple spec
Expand Down
6 changes: 3 additions & 3 deletions src/RNTuple/fieldcolumn_reading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ end

struct UnionVector{T, N} <: AbstractVector{T}
kindex::Vector{UInt64}
tag::Vector{Int8}
tag::Vector{Int32}
contents::N
function UnionVector(kindex, tag, contents::N) where N
T = Union{eltype.(contents)...}
Expand All @@ -167,8 +167,8 @@ function Base.getindex(ary::UnionVector, i::Int)
end

function _split_switch_bits(content)
kindex = content .& 0x00000000000FFFFF .+ 1
tags = Int8.(content .>> 44)
kindex = content .& (typemax(UInt128) >> 64) .+ 1
tags = Int32.(content .>> 64)
return kindex, tags
end
function _field_output_type(::Type{UnionField{S, T}}) where {S, T}
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion test/samples/RNTuple/importer.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
root [0] auto importer = ROOT::Experimental::RNTupleImporter::Create("./Run2012BC_DoubleMuParked_Muons.root", "Events", "./limit.root");
root [0] auto importer = ROOT::Experimental::RNTupleImporter::Create("./Run2012BC_DoubleMuParked_Muons.root", "Events", "./Run2012BC_DoubleMuParked_Muons_rntuple_1000evts.root");
root [2] auto c = importer.get();
root [4] c->SetMaxEntries(1000);
root [5] c->Import()

0 comments on commit d6ee392

Please sign in to comment.