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

Add Base.filter for Detector and DetectorModule

parent 3983e0fc
No related branches found
No related tags found
1 merge request!45Improve detector api
......@@ -95,6 +95,8 @@ Get the PMT for a given DAQ channel ID (TDC)
"""
getpmt(d::DetectorModule, channel_id::Integer) = d[channel_id]
Base.filter(f::Function, d::DetectorModule) = filter(f, getpmts(d))
"""
Calculate the centre of a module by fitting the crossing point of the PMT axes.
......@@ -347,6 +349,8 @@ function Base.getindex(d::Detector, ::Colon, floors::UnitRange{T}) where T<:Inte
sort!(modules)
end
Base.filter(f::Function, d::Detector) = filter(f, modules(d))
"""
Returns true if there is a module at the given location.
......
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