Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3io.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
common
KM3io.jl
Commits
3f59a3bd
Verified
Commit
3f59a3bd
authored
4 months ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Add Base.filter for Detector and DetectorModule
parent
3983e0fc
No related branches found
No related tags found
1 merge request
!45
Improve detector api
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hardware.jl
+4
-0
4 additions, 0 deletions
src/hardware.jl
with
4 additions
and
0 deletions
src/hardware.jl
+
4
−
0
View file @
3f59a3bd
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment