angle

This module implements three classes Vector3, LorentzVector, EulerAngle .

class AlignmentAngle(alpha=0.0, beta=0.0, gamma=0.0)[source]

Bases: EulerAngle

static angle_px_px(p1, x1, p2, x2)[source]
class EulerAngle(alpha=0.0, beta=0.0, gamma=0.0)[source]

Bases: dict

This class provides methods for Eular angle \((\alpha,\beta,\gamma)\)

static angle_zx_z_getx(z1, x1, z2)[source]

The Eular angle from coordinate 1 to coordinate 2. Only the z-axis is provided for coordinate 2, so \(\gamma\) is set to be 0.

Parameters:
  • z1 – Vector3 z-axis of the initial coordinate

  • x1 – Vector3 x-axis of the initial coordinate

  • z2 – Vector3 z-axis of the final coordinate

Return eular_angle:

EularAngle object with \(\gamma=0\).

Return x2:

Vector3 object, which is the x-axis of the final coordinate when \(\gamma=0\).

static angle_zx_zx(z1, x1, z2, x2)[source]

The Euler angle from coordinate 1 to coordinate 2 (right-hand coordinates).

Parameters:
  • z1 – Vector3 z-axis of the initial coordinate

  • x1 – Vector3 x-axis of the initial coordinate

  • z2 – Vector3 z-axis of the final coordinate

  • x2 – Vector3 x-axis of the final coordinate

Returns:

Euler Angle object

static angle_zx_zzz_getx(z, x, zi)[source]

The Eular angle from coordinate 1 to coordinate 2. Z-axis of coordinate 2 is the normal vector of a plane.

Parameters:
  • z1 – Vector3 z-axis of the initial coordinate

  • x1 – Vector3 x-axis of the initial coordinate

  • z – list of Vector3 of the plane point.

Return eular_angle:

EularAngle object.

Return x2:

list of Vector3 object, which is the x-axis of the final coordinate in zi.

class LorentzVector[source]

Bases: Tensor

This class provides methods for Lorentz vectors (T,X,Y,Z). or -T???

Dot(other)[source]
M()[source]

The invariant mass

M2()[source]

The invariant mass squared

beta()[source]
boost(p)[source]

Boost this Lorentz vector into the frame indicated by the 3-d vector p.

boost_matrix()[source]
boost_vector()[source]

\(\beta=(X,Y,Z)/T\) :return: 3-d vector \(\beta\)

static from_p4(p_0, p_1, p_2, p_3)[source]

Given p_0 is a real number, it will make it transform into the same shape with p_1.

gamma()[source]
get_T()[source]
get_X()[source]
get_Y()[source]
get_Z()[source]
get_e()[source]

rm???

get_metric()[source]

The metric is (1,-1,-1,-1) by default

neg()[source]

The negative vector

omega()[source]
rest_vector(other)[source]

Boost another Lorentz vector into the rest frame of \(\beta\).

vect()[source]

It returns the 3-d vector (X,Y,Z).

class SU2M(x)[source]

Bases: dict

static Boost_z(omega)[source]
static Boost_z_from_p(p)[source]
static Rotation_y(beta)[source]
static Rotation_z(alpha)[source]
get_euler_angle()[source]
inv()[source]
class Vector3[source]

Bases: Tensor

This class provides methods for 3-d vectors (X,Y,Z)

angle_from(x, y)[source]

The angle from x-axis providing the x,y axis to define a 3-d coordinate.

x  ->  self
|      /
| ang /
|    /
|   /
|  /
| /
|/
-------- y
Parameters:
  • x – A Vector3 instance as x-axis

  • y – A Vector3 instance as y-axis. It should be perpendicular to the x-axis.

cos_theta(other)[source]

cos theta of included angle

cross(other)[source]

Cross product with another Vector3 instance

cross_unit(other)[source]

The unit vector of the cross product with another Vector3 object. It has interface to tf.linalg.normalize().

dot(other)[source]

Dot product with another Vector3 object

get_X()[source]
get_Y()[source]
get_Z()[source]
norm()[source]
norm2()[source]

The norm square

unit()[source]

The unit vector of itself. It has interface to tf.linalg.normalize().

kine_max(s12, m0, m1, m2, m3)[source]

max s23 for s12 in p0 -> p1 p2 p3

kine_min(s12, m0, m1, m2, m3)[source]

min s23 for s12 in p0 -> p1 p2 p3

kine_min_max(s12, m0, m1, m2, m3)[source]

min max s23 for s12 in p0 -> p1 p2 p3