Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 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
  • 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

Target

Select target project
  • common/KM3io.jl
1 result
Select Git revision
  • 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
  • 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
Commits on Source (3)
......@@ -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
```
......@@ -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)
......
......@@ -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.
"""
......
......@@ -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)