Skip to content

Commit

Permalink
hard code TLeafB
Browse files Browse the repository at this point in the history
  • Loading branch information
Moelf committed Jul 2, 2021
1 parent c40da32 commit e40e5eb
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/dev/
/docs/build/
/docs/site/
__pycache__/
35 changes: 35 additions & 0 deletions src/bootstrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,41 @@ end

primitivetype(l::TLeafF) = Float32

# FIXME this should be generated and inherited from TLeaf
# https://root.cern/doc/master/TLeafB_8h_source.html#l00026
@with_kw struct TLeafB
# from TNamed
fName
fTitle

# from TLeaf
fLen
fLenType
fOffset
fIsRange
fIsUnsigned
fLeafCount

# own fields
fMinimum
fMaximum
end

function parsefields!(io, fields, T::Type{TLeafB})
preamble = Preamble(io, T)
parsefields!(io, fields, TLeaf)
fields[:fMinimum] = readtype(io, UInt8)
fields[:fMaximum] = readtype(io, UInt8)
endcheck(io, preamble)
end

function unpack(io, tkey::TKey, refs::Dict{Int32, Any}, T::Type{TLeafB})
@initparse
parsefields!(io, fields, T)
T(;fields...)
end

primitivetype(l::TLeafB) = UInt8
# FIXME this should be generated and inherited from TLeaf
@with_kw struct TLeafD
# from TNamed
Expand Down
Binary file added test/samples/NanoAODv5_sample.root
Binary file not shown.
Binary file removed test/samples/__pycache__/lz4.cpython-39.pyc
Binary file not shown.
Binary file modified test/samples/tree_with_large_array_lz4.root
Binary file not shown.

0 comments on commit e40e5eb

Please sign in to comment.