ThreeVector

class coffea.nanoevents.methods.vector.ThreeVector[source]

Bases: TwoVector

A cartesian 3-dimensional vector

A heavy emphasis towards a momentum vector interpretation is assumed. This mixin class requires the parent class to provide items x, y, and z.

Attributes Summary

p

Alias for rho

p2

Squared p

pz

Alias for z

rho

Distance from origin in 3D

rho2

Squared rho

theta

Inclination angle from XY plane

unit

Unit vector, a vector of length 1 pointing in the same direction

Methods Summary

absolute()

Returns magnitude of the 3D vector

add(other)

Add two vectors together elementwise using x, y, and z components

cross(other)

Compute the cross product of two vectors

dot(other)

Compute the dot product of two vectors

multiply(other)

Multiply this vector by a scalar elementwise using x, y, and z components

negative()

Returns the negative of the vector

subtract(other)

Subtract a vector from another elementwise using x, y, and z components

sum([axis])

Sum an array of vectors elementwise using x, y, and z components

Attributes Documentation

p

Alias for rho

p2

Squared p

pz

Alias for z

rho

Distance from origin in 3D

\(\sqrt{x^2+y^2+z^2} = \sqrt{r^2+z^2}\)

rho2

Squared rho

theta

Inclination angle from XY plane

\(\text{arctan2}(r, z)\)

unit

Unit vector, a vector of length 1 pointing in the same direction

Methods Documentation

absolute()[source]

Returns magnitude of the 3D vector

Alias for rho

add(other)[source]

Add two vectors together elementwise using x, y, and z components

cross(other)[source]

Compute the cross product of two vectors

dot(other)[source]

Compute the dot product of two vectors

multiply(other)[source]

Multiply this vector by a scalar elementwise using x, y, and z components

negative()[source]

Returns the negative of the vector

subtract(other)[source]

Subtract a vector from another elementwise using x, y, and z components

sum(axis=-1)[source]

Sum an array of vectors elementwise using x, y, and z components