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
Compare revisions
da2ec9cfbb2ba8e759095cee92b5f5d16ddd4805 to cac6d6e997e6456bd096e63ffebcfd1bf65bcf87
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
common/KM3io.jl
Select target project
No results found
cac6d6e997e6456bd096e63ffebcfd1bf65bcf87
Select Git revision
Branches
21-helper-functions-for-best-track-selection
DAQSummaryslice
better-getters
coordstuff
daq-io
detector-toolkit
dst-support
dynamic-calibration
gh-pages
improve-cache
improve-show
main
merged_files_online_offline_matcher
multihead-support
pmt-rings
rbr-iterator
read-csk-file
Tags
v0.1.1
v0.11.0
v0.12.0
v0.12.1
v0.12.2
v0.12.4
v0.12.5
v0.12.6
v0.12.7
v0.13.0
v0.13.1
v0.14.0
v0.14.1
v0.14.2
v0.14.3
v0.14.4
v0.14.5
v0.14.6
v0.14.7
v0.14.8
v0.16.2
v0.16.3
v0.16.4
v0.16.5
v0.16.6
v0.16.7
v0.16.8
v0.16.9
v0.17.0
v0.17.1
v0.17.10
v0.17.2
v0.17.3
v0.17.4
v0.17.5
v0.17.6
v0.17.7
v0.17.8
v0.17.9
v0.18.0
v0.18.1
v0.18.3
v0.18.4
v0.18.5
v0.18.6
v0.2.0
v0.2.1
v0.2.2
v0.3.0
v0.3.1
v0.4.0
v0.4.1
v0.5.0
v0.6.0
v0.7.0
v0.8.0
v0.9.0
74 results
Swap
Target
common/KM3io.jl
Select target project
common/KM3io.jl
1 result
da2ec9cfbb2ba8e759095cee92b5f5d16ddd4805
Select Git revision
Branches
21-helper-functions-for-best-track-selection
DAQSummaryslice
better-getters
coordstuff
daq-io
detector-toolkit
dst-support
dynamic-calibration
gh-pages
improve-cache
improve-show
main
merged_files_online_offline_matcher
multihead-support
pmt-rings
rbr-iterator
read-csk-file
Tags
v0.1.1
v0.11.0
v0.12.0
v0.12.1
v0.12.2
v0.12.4
v0.12.5
v0.12.6
v0.12.7
v0.13.0
v0.13.1
v0.14.0
v0.14.1
v0.14.2
v0.14.3
v0.14.4
v0.14.5
v0.14.6
v0.14.7
v0.14.8
v0.16.2
v0.16.3
v0.16.4
v0.16.5
v0.16.6
v0.16.7
v0.16.8
v0.16.9
v0.17.0
v0.17.1
v0.17.10
v0.17.2
v0.17.3
v0.17.4
v0.17.5
v0.17.6
v0.17.7
v0.17.8
v0.17.9
v0.18.0
v0.18.1
v0.18.3
v0.18.4
v0.18.5
v0.18.6
v0.2.0
v0.2.1
v0.2.2
v0.3.0
v0.3.1
v0.4.0
v0.4.1
v0.5.0
v0.6.0
v0.7.0
v0.8.0
v0.9.0
74 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (3)
Add more helpers to deal with modules
· 3a40ce4c
Tamas Gal
authored
1 year ago
Verified
3a40ce4c
Add docstring for isopticalmodule
· 2d31f564
Tamas Gal
authored
1 year ago
Verified
2d31f564
Merge branch 'more-helpers' into 'main'
· cac6d6e9
Tamas Gal
authored
1 year ago
Add more helpers to deal with modules See merge request
!28
cac6d6e9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/src/api.md
+4
-0
4 additions, 0 deletions
docs/src/api.md
src/KM3io.jl
+4
-1
4 additions, 1 deletion
src/KM3io.jl
src/hardware.jl
+22
-0
22 additions, 0 deletions
src/hardware.jl
src/tools/math.jl
+7
-0
7 additions, 0 deletions
src/tools/math.jl
with
37 additions
and
1 deletion
docs/src/api.md
View file @
cac6d6e9
...
...
@@ -52,6 +52,9 @@ Detector
modules
getmodule
getpmt
haslocation
isbasemodule
isopticalmodule
write(::AbstractString, ::Detector)
write(::IO, ::Detector)
Hydrophone
...
...
@@ -154,4 +157,5 @@ hashistory
### Math
```
@docs
angle
distance
```
This diff is collapsed.
Click to expand it.
src/KM3io.jl
View file @
cac6d6e9
...
...
@@ -27,7 +27,8 @@ export ROOTFile
export
H5File
,
H5CompoundDataset
,
create_dataset
,
addmeta
export
Direction
,
Position
,
UTMPosition
,
Location
,
Quaternion
,
Track
,
AbstractCalibratedHit
export
Detector
,
DetectorModule
,
PMT
,
Tripod
,
Hydrophone
,
StringMechanics
,
StringMechanicsParameters
,
center
,
isbasemodule
,
getmodule
,
modules
,
getpmt
,
getpmts
export
Detector
,
DetectorModule
,
PMT
,
Tripod
,
Hydrophone
,
StringMechanics
,
StringMechanicsParameters
,
center
,
isbasemodule
,
isopticalmodule
,
getmodule
,
modules
,
getpmt
,
getpmts
,
haslocation
# Acoustics
export
Waveform
,
AcousticSignal
,
AcousticsTriggerParameter
,
piezoenabled
,
hydrophoneenabled
...
...
@@ -60,6 +61,8 @@ export MCEventMatcher
export
CHClient
,
CHTag
,
subscribe
,
@ip_str
export
distance
@template
(
FUNCTIONS
,
METHODS
,
MACROS
)
=
"""
$(TYPEDSIGNATURES)
...
...
This diff is collapsed.
Click to expand it.
src/hardware.jl
View file @
cac6d6e9
...
...
@@ -81,7 +81,14 @@ end
The index in this context is the DAQ channel ID of the PMT, which is counting from 0.
"""
Base
.
getindex
(
d
::
DetectorModule
,
i
)
=
d
.
pmts
[
i
+
1
]
"""
Returns true if the module is a basemodule.
"""
isbasemodule
(
d
::
DetectorModule
)
=
d
.
location
.
floor
==
0
"""
Returns true if the module is an optical module.
"""
isopticalmodule
(
d
::
DetectorModule
)
=
d
.
n_pmts
>
0
getpmts
(
d
::
DetectorModule
)
=
d
.
pmts
"""
Get the PMT for a given DAQ channel ID (TDC)
...
...
@@ -294,6 +301,10 @@ end
Base
.
getindex
(
d
::
Detector
,
module_id
::
Integer
)
=
d
.
modules
[
module_id
]
Base
.
getindex
(
d
::
Detector
,
string
::
Integer
,
floor
::
Integer
)
=
d
.
locations
[
string
,
floor
]
"""
Return the detector module for a given module ID.
"""
@inline
getmodule
(
d
::
Detector
,
module_id
::
Integer
)
=
d
[
module_id
]
"""
Return the detector module for a given string and floor.
"""
@inline
getmodule
(
d
::
Detector
,
string
::
Integer
,
floor
::
Integer
)
=
d
[
string
,
floor
]
...
...
@@ -305,6 +316,10 @@ Return the detector module for a given string and floor (as `Tuple`).
Return the detector module for a given location.
"""
@inline
getmodule
(
d
::
Detector
,
loc
::
Location
)
=
d
[
loc
.
string
,
loc
.
floor
]
"""
Return the `PMT` for a given hit.
"""
@inline
getpmt
(
d
::
Detector
,
hit
)
=
getpmt
(
getmodule
(
d
,
hit
.
dom_id
),
hit
.
channel_id
)
Base
.
getindex
(
d
::
Detector
,
string
::
Int
,
::
Colon
)
=
sort!
(
filter
(
m
->
m
.
location
.
string
==
string
,
modules
(
d
)))
Base
.
getindex
(
d
::
Detector
,
string
::
Int
,
floors
::
T
)
where
T
<:
Union
{
AbstractArray
,
UnitRange
}
=
[
d
[
string
,
floor
]
for
floor
in
sort
(
floors
)]
Base
.
getindex
(
d
::
Detector
,
::
Colon
,
floor
::
Int
)
=
sort!
(
filter
(
m
->
m
.
location
.
floor
==
floor
,
modules
(
d
)))
...
...
@@ -326,6 +341,13 @@ end
"""
Returns true if there is a module at the given location.
"""
haslocation
(
d
::
Detector
,
loc
::
Location
)
=
haskey
(
d
.
locations
,
(
loc
.
string
,
loc
.
floor
))
"""
Calculate the center of the detector based on the location of the optical modules.
"""
...
...
This diff is collapsed.
Click to expand it.
src/tools/math.jl
View file @
cac6d6e9
...
...
@@ -5,3 +5,10 @@ Base.angle(d1::Direction, d2::Direction) = acos(min(dot(normalize(d1), normalize
Base
.
angle
(
a
::
T
,
b
::
T
)
where
{
T
<:
Union
{
KM3io
.
AbstractCalibratedHit
,
KM3io
.
PMT
}}
=
Base
.
angle
(
a
.
dir
,
b
.
dir
)
Base
.
angle
(
a
,
b
::
Union
{
KM3io
.
AbstractCalibratedHit
,
KM3io
.
PMT
})
=
Base
.
angle
(
a
,
b
.
dir
)
Base
.
angle
(
a
::
Union
{
KM3io
.
AbstractCalibratedHit
,
KM3io
.
PMT
},
b
)
=
Base
.
angle
(
a
.
dir
,
b
)
"""
Calculates the disance between two points.
"""
distance
(
a
::
Position
,
b
::
Position
)
=
norm
(
a
-
b
)
This diff is collapsed.
Click to expand it.