PhysicsTools
Documentation for PhysicsTools.
PhysicsTools.Utils.CategoricalSetDistributionPhysicsTools.Utils.apply_rotPhysicsTools.Utils.cart_to_sphPhysicsTools.Utils.fast_linear_interpPhysicsTools.Utils.fast_linear_interpPhysicsTools.Utils.fwhmPhysicsTools.Utils.rand_gammaPhysicsTools.Utils.repeat_forPhysicsTools.Utils.sample_cherenkov_track_directionPhysicsTools.Utils.sph_to_cartPhysicsTools.Utils.split_byPhysicsTools.Utils.split_by!
PhysicsTools.Utils.CategoricalSetDistribution — TypeCategoricalSetDistribution{T, U<:Real}
Represents a Categorical distribution on a set
Examples
p = CategoricalSetDistribution(Set([:EMinus, :EPlus]), Categorical([0.1, 0.9])) rand(p)– returns:EMinuswith 10% probability and:Epluswith 90% probabilityp = CategoricalSetDistribution(Set([:EMinus, :EPlus]), [0.1, 0.9])– convenience constructor
PhysicsTools.Utils.apply_rot — Methodapply_rot(a, b, operand)Calculates rotation matrix obtained by rotating a to b. Apply to operand. Apply the resulting rotation to operand.
PhysicsTools.Utils.cart_to_sph — Methodcart_to_sph(x::Real, y::Real, z::Real)Convert cartesian to spherical coordinates. Assumes x, y, z represent a unit vector. Uses ISO convetion (inclination, azimuth).
PhysicsTools.Utils.fast_linear_interp — Methodfast_linear_interp(x_eval::Number, xs::AbstractVector, ys::AbstractVector)Linearly interpolate xs -> ys and evaluate x_eval on interpolation. Assume xs are sorted in ascending order.
PhysicsTools.Utils.fast_linear_interp — Methodfast_linear_interp(x_eval::Number, knots::AbstractVector, lower::Number, upper::Number)Linearly interpolate knots and evaluate x_eval on interpolation. Assume knots are equidistant in (lower, upper).
PhysicsTools.Utils.fwhm — Methodfwhm(d::UnivariateDistribution, xmode::Real; xlims=(-20, 20))Calculate FWHM of a univariate distribution
PhysicsTools.Utils.rand_gamma — Methodrand_gamma(shape, scale)Sample gamma variates when shape > 1
PhysicsTools.Utils.repeat_for — Methodrepeat_for(x::AbstractMatrix, n::AbstractVector)Repeat each slice along the second dimension of x for n times
PhysicsTools.Utils.sample_cherenkov_track_direction — MethodPhysicsTools.Utils.sph_to_cart — Methodsph_to_cart(theta::Real, phi::Real)Convert spherical to cartesian coordinates.
Uses ISO convention (inclination, azimuth).
PhysicsTools.Utils.split_by! — Methodsplit_by!(x::AbstractVector, n::AbstractVector, out)Write output into out
PhysicsTools.Utils.split_by — Methodsplit_by(x::AbstractVector, n::AbstractVector)Split vector x into parts, where the split indices are given by vector n.