Commit 62852349 authored by Tamas Gal's avatar Tamas Gal 💬

Cleanup

parent b2b0aec0
Pipeline #11490 failed with stages
in 3 minutes and 20 seconds
......@@ -29,7 +29,6 @@ export
read_calibration, read_event_info,
Calibration, calibrate,
duhits, domhits, nfoldhits, triggered,
svdfit, matrix, rows,
CHClient, CHTag, CHPrefix, CHMessage, subscribe,
ztplot,
savefigs,
......@@ -118,38 +117,8 @@ function calibrate(mc_hits::Vector{T},
end
# Utility
rows(x) = (x[i, :] for i in indices(x,1))
# Math
Base.angle(d1::Direction, d2::Direction) = acos(dot(d1/norm(d1), d2/norm(d2)))
Base.angle(a::T, b::T) where {T<:Union{CalibratedHit, PMT, MCTrack}} = Base.angle(a.dir, b.dir)
Base.angle(a::FieldVector{3}, b::Union{CalibratedHit, PMT, MCTrack}) = Base.angle(a, b.dir)
Base.angle(a::Union{CalibratedHit, PMT, MCTrack}, b::FieldVector{3}) = Base.angle(a.dir, b)
function matrix(v::Vector)
m = length(v)
n = length(v[1])
M = zeros(m, n)
i = 1
for j 1:n
for k 1:m
M[i] = v[k][j]
i += 1
end
end
M
end
function svdfit(M)
com = mean(M, dims=1)
subtr = M .- com
U, S, V = svd(subtr)
return com[:], V[:, 1]
end
end # module
......@@ -16,22 +16,6 @@ struct ROyFit
end
"""
function svdfit(hits::Vector{CalibratedHit})
Uses SVD to do a fast and dirty track prefit. Provide hits with a multiplicity
of at least 2.
"""
function svdfit(hits::Vector{CalibratedHit})
t₀ = hits[div(length(hits), 2)].t
pos, dir = svdfit(matrix([h.pos for h in hits]))
if (last(hits).pos - first(hits).pos) dir < 0.0
dir *= -1
end
return Track(dir, pos, t₀)
end
"""
function prefit(hits::Vector{CalibratedHit})
......@@ -533,7 +517,3 @@ function estimate_azimuth(
return ϕ + cos(1/n)
end
end
function royfit_rbr(filename::AbstractString, detx::AbstractString, sparams::SingleDURecoParams)
end
# # I/O related functions
#
# The following function are used to read datastructures from KM3NeT
# dataformats like HDF5 or custom binary types.
# dataformats like HDF5, ROOT or custom binary types.
"""
function read_compound(dset::HDF5.HDF5Dataset, T::DataType)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment