Skip to content

Commit

Permalink
Revert "fix bool branch interpretation (#102)"
Browse files Browse the repository at this point in the history
This reverts commit 47d2ec9.
  • Loading branch information
aminnj authored Sep 15, 2021
1 parent 47d2ec9 commit 2a6318f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/root.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,16 @@ on type `T` and jagg type `J`.
In order to retrieve data from custom branches, user should defined more speialized
method of this function with specific `T` and `J`. See `TLorentzVector` example.
"""
function interped_data(rawdata, rawoffsets, ::Type{Bool}, ::Type{Nojagg})
# specialized case to get Vector{Bool} instead of BitVector
return map(ntoh,reinterpret(T, rawdata))
end
function interped_data(rawdata, rawoffsets, ::Type{T}, ::Type{J}) where {T, J<:JaggType}
# there are two possibility, one is the leaf is just normal leaf but the title has "[...]" in it
# magic offsets, seems to be common for a lot of types, see auto.py in uproot3
# only needs when the jaggedness comes from TLeafElements, not needed when
# the jaggedness comes from having "[]" in TLeaf's title
# the other is where we need to auto detector T bsaed on class name
# we want the fundamental type as `reinterpret` will create vector
if J === Nojagg
if J == Nojagg
return ntoh.(reinterpret(T, rawdata))
elseif J === Offsetjaggjagg # the branch is doubly jagged
elseif J == Offsetjaggjagg # the branch is doubly jagged
jagg_offset = 10
subT = eltype(eltype(T))
out = VectorOfVectors(T(), Int32[1])
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ end
tree = LazyTree(rootfile, "Events", r"Muon_(pt|eta)$")
@test sort(propertynames(tree) |> collect) == sort([:Muon_pt, :Muon_eta])
@test occursin("LazyEvent", repr(first(iterate(tree))))
@test sum(rootfile["Events/HLT_Mu3_PFJet40"]) == 443
close(rootfile)
end

Expand Down

0 comments on commit 2a6318f

Please sign in to comment.