PhysicsTools

Documentation for PhysicsTools.

PhysicsTools.Utils.CategoricalSetDistributionType

CategoricalSetDistribution{T, U<:Real}

Represents a Categorical distribution on a set

Examples

  • p = CategoricalSetDistribution(Set([:EMinus, :EPlus]), Categorical([0.1, 0.9])) rand(p) – returns :EMinus with 10% probability and :Eplus with 90% probability

  • p = CategoricalSetDistribution(Set([:EMinus, :EPlus]), [0.1, 0.9]) – convenience constructor

source
PhysicsTools.Utils.apply_rotMethod
apply_rot(a, b, operand)

Calculates rotation matrix obtained by rotating a to b. Apply to operand. Apply the resulting rotation to operand.

source
PhysicsTools.Utils.cart_to_sphMethod
cart_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).

source
PhysicsTools.Utils.fast_linear_interpMethod
fast_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.

source
PhysicsTools.Utils.fast_linear_interpMethod
fast_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).

source