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

Add RBRIterator

parent eb03033d
No related branches found
No related tags found
2 merge requests!25MC event matcher,!24RBR iterator
......@@ -56,6 +56,8 @@ export most_frequent, categorize, nthbitset
export cherenkov, CherenkovPhoton, azimuth, zenith, theta, phi
export RBRIterator
export CHClient, CHTag, subscribe, @ip_str
@template (FUNCTIONS, METHODS, MACROS) =
......@@ -100,6 +102,7 @@ include("tools/general.jl")
include("tools/daq.jl")
include("tools/trigger.jl")
include("tools/reconstruction.jl")
include("tools/helpers.jl")
include("physics.jl")
......
"""
A basic container type to assist run-by-run iteration.
"""
struct RBRIterator
f::ROOTFile
end
Base.length(itr::RBRIterator) = length(itr.f.online.events)
function Base.iterate(itr::RBRIterator, state=1)
state > length(itr) && return nothing
event = f.online.events[state]
mc_idx = event.header.trigger_counter + 1
mc_event = itr.f.offline[mc_idx]
((event, mc_event), state + 1)
end
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