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

Add hasstring

parent c9410849
No related branches found
No related tags found
1 merge request!45Improve detector api
......@@ -59,6 +59,7 @@ modules
getmodule
getpmt
haslocation
hasstring
isbasemodule
isopticalmodule
write(::AbstractString, ::Detector)
......
......@@ -29,6 +29,7 @@ getmodule,
getpmt,
getpmts,
haslocation,
hasstring,
isbasemodule,
isopticalmodule,
modules,
......
......@@ -346,6 +346,14 @@ Returns true if there is a module at the given location.
"""
haslocation(d::Detector, loc::Location) = haskey(d.locations, (loc.string, loc.floor))
"""
Returns true if there is a string with a given number.
"""
hasstring(d::Detector, s::Integer) = s in d.strings
"""
Calculate the center of the detector based on the location of the optical modules.
......
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