Skip to content
Snippets Groups Projects
Verified Commit f8333d3e authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Fix iteration

parent 9d621df8
No related branches found
No related tags found
1 merge request!36Make fitinf use 0-based indexing
......@@ -49,7 +49,7 @@ Base.firstindex(::FitInformation) = 0
Base.lastindex(fitinf::FitInformation) = length(fitinf) - 1
Base.eltype(::FitInformation) = Float64
function Base.iterate(fitinf::FitInformation, state=0)
state > length(fitinf) ? nothing : (fitinf[state], state+1)
state > length(fitinf)+1 ? nothing : (fitinf[state], state+1)
end
"""
......
......@@ -91,7 +91,8 @@ const ONLINEFILE = datapath("online", "km3net_online.root")
@test 56 == length(t[1].trks)
@test 0 == length(t[1].w)
@test 17 == length(t[1].trks[1].fitinf)
@test 0.009290906625313346 == t[end].trks[1].fitinf[0]
@test 63.92088448672399 == sum(t[end].trks[2].fitinf)
@test 101.0 == t[1].trks[1].fitinf[end]
close(f)
f = ROOTFile(datapath("offline", "numucc.root"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment