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

Fix for base module t0

parent fc27e7a4
No related branches found
No related tags found
No related merge requests found
......@@ -299,7 +299,7 @@ function Detector(io::IO)
push!(pmts, PMT(pmt_id, Position(x, y, z), Direction(dx, dy, dz), t0, pmt_status))
end
if ismissing(t₀) || t₀ == 0.0
if (ismissing(t₀) || t₀ == 0.0) && floor > 0
# t₀ is only available in DETX v4+ and even with supported versions, the value is
# sometimes 0 when e.g. the DETX was converted with Jpp from a version which did
# not include that informatino (v3 and below). Here, we are using the averaged
......@@ -307,6 +307,10 @@ function Detector(io::IO)
t₀ = mean([pmt.t₀ for pmt in pmts])
end
if ismissing(t₀) && floor == 0
t₀ = 0.0
end
if ismissing(pos)
# Similar to the module t₀, the module position was introduced in DETX v4.
# If this is missing, it will be set to the averaged PMT positions. If it's
......
......@@ -27,6 +27,7 @@ const SAMPLES_DIR = joinpath(@__DIR__, "samples")
@test 361 == length(mods)
@test 106.95 d.modules[808469291].pos.y # base module
@test 97.3720395 d.modules[808974928].pos.z # base module
@test 0.0 == d.modules[808469291].t₀ # base module
end
@test 116.600 d.modules[808992603].pos.x atol=1e-5 # optical module
......
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