Skip to content

Commit

Permalink
Add THxI support (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamasgal authored Nov 12, 2024
1 parent 2a31cdf commit 1ac1e44
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/bootstrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,9 @@ end
fFriends
end

TH1I(io, tkey::TKey, refs) = TH(io, tkey, refs)
TH2I(io, tkey::TKey, refs) = TH(io, tkey, refs)
TH3I(io, tkey::TKey, refs) = TH(io, tkey, refs)
TH1F(io, tkey::TKey, refs) = TH(io, tkey, refs)
TH2F(io, tkey::TKey, refs) = TH(io, tkey, refs)
TH3F(io, tkey::TKey, refs) = TH(io, tkey, refs)
Expand Down Expand Up @@ -981,7 +984,6 @@ function TH(io, tkey::TKey, refs)
stream!(io, fields, TAttMarker)
fields[:fNcells] = readtype(io, Int32)


for axis in ["fXaxis_", "fYaxis_", "fZaxis_"]
subfields = Dict{Symbol, Any}()
stream!(io, subfields, TAxis, check=false)
Expand Down Expand Up @@ -1025,7 +1027,16 @@ function TH(io, tkey::TKey, refs)
end
end

arraytype = endswith(tkey.fClassName, 'F') ? TArrayF : TArrayD
if endswith(tkey.fClassName, 'F')
arraytype = TArrayF
elseif endswith(tkey.fClassName, 'D')
arraytype = TArrayD
elseif endswith(tkey.fClassName, 'I')
arraytype = TArrayI
else
error("Unknown histogram of type $(tkey.fClassName)")
end

fields[:fN] = readtype(io, arraytype)
fields
end
Expand Down

0 comments on commit 1ac1e44

Please sign in to comment.