is used to store Monte Carlo (MC) simulations and reconstruction results.
is used to store Monte Carlo (MC) simulations and reconstruction results. The
`OfflineFile` type represents an actual offline file and it is essentially a
vector of events (`Vector{Evt}`) with some fancy caching, lazy access and
slicing magic.
The following REPL session shows how to open a file, access individual events or slices of events, loop through events and access e.g. the tracks which are stored in the events.
``` julia-repl
julia> using KM3io, KM3NeTTestData
julia> f = OfflineFile(datapath("offline", "km3net_offline.root"))
OfflineFile with 10 events
julia> f[5]
KM3io.Evt (83 hits, 0 MC hits, 56 tracks, 0 MC tracks)
julia> f[3:5]
3-element Vector{KM3io.Evt}:
KM3io.Evt (318 hits, 0 MC hits, 56 tracks, 0 MC tracks)
KM3io.Evt (157 hits, 0 MC hits, 56 tracks, 0 MC tracks)
KM3io.Evt (83 hits, 0 MC hits, 56 tracks, 0 MC tracks)
julia> event = f[1]
KM3io.Evt (176 hits, 0 MC hits, 56 tracks, 0 MC tracks)