Пример #1
0
def helicity_angles_3body(pa, pb, pc):
    """Calculate 4 helicity angles for the 3-body D->ABC decay defined as:
      theta_r, phi_r : polar and azimuthal angles of the AB resonance in the D rest frame
      theta_a, phi_a : polar and azimuthal angles of the A in AB rest frame

    :param pa: 
    :param pb: 
    :param pc: 

    """
    theta_r = atfi.acos(-z_component(pc) / norm(spatial_components(pc)))
    phi_r = atfi.atan2(-y_component(pc), -x_component(pc))

    pa_prime = lorentz_vector(
        rotate_euler(spatial_components(pa), -phi_r,
                     atfi.pi() - theta_r, phi_r), time_component(pa))
    pb_prime = lorentz_vector(
        rotate_euler(spatial_components(pb), -phi_r,
                     atfi.pi() - theta_r, phi_r), time_component(pb))

    w = time_component(pa) + time_component(pb)

    pab = lorentz_vector(-(pa_prime + pb_prime) / scalar(w), w)
    pa_prime2 = lorentz_boost(pa_prime, pab)

    theta_a = atfi.acos(
        z_component(pa_prime2) / norm(spatial_components(pa_prime2)))
    phi_a = atfi.atan2(y_component(pa_prime2), x_component(pa_prime2))

    return (theta_r, phi_r, theta_a, phi_a)
Пример #2
0
def euler_angles(x1, y1, z1, x2, y2, z2):
    """Calculate Euler angles (phi, theta, psi in the ZYZ convention) which transform the coordinate basis (x1, y1, z1)
      to the basis (x2, y2, z2). Both x1,y1,z1 and x2,y2,z2 are assumed to be orthonormal and right-handed.

    :param x1: 
    :param y1: 
    :param z1: 
    :param x2: 
    :param y2: 
    :param z2: 

    """
    theta = atfi.acos(scalar_product(z1, z2))
    phi = atfi.atan2(scalar_product(z1, y2), scalar_product(z1, x2))
    psi = atfi.atan2(scalar_product(y1, z2), scalar_product(x1, z2))
    return (phi, theta, psi)
Пример #3
0
def helicity_angles_4body(pa, pb, pc, pd):
    """Calculate 4 helicity angles for the 4-body E->ABCD decay defined as:
      theta_ab, phi_ab : polar and azimuthal angles of the AB resonance in the E rest frame
      theta_cd, phi_cd : polar and azimuthal angles of the CD resonance in the E rest frame
      theta_ac, phi_ac : polar and azimuthal angles of the AC resonance in the E rest frame
      theta_bd, phi_bd : polar and azimuthal angles of the BD resonance in the E rest frame
      theta_ad, phi_ad : polar and azimuthal angles of the AD resonance in the E rest frame
      theta_bc, phi_bc : polar and azimuthal angles of the BC resonance in the E rest frame
      phi_ab_cd : azimuthal angle between AB and CD
      phi_ac_bd : azimuthal angle between AC and BD
      phi_ad_bc : azimuthal angle between AD and BC

    :param pa:
    :param pb:
    :param pc:
    :param pd:

    """
    theta_r = atfi.acos(-z_component(pc) / norm(spatial_components(pc)))
    phi_r = atfi.atan2(-y_component(pc), -x_component(pc))

    pa_prime = lorentz_vector(
        rotate_euler(spatial_components(pa), -phi_r,
                     atfi.pi() - theta_r, phi_r),
        time_component(pa),
    )
    pb_prime = lorentz_vector(
        rotate_euler(spatial_components(pb), -phi_r,
                     atfi.pi() - theta_r, phi_r),
        time_component(pb),
    )

    w = time_component(pa) + time_component(pb)

    pab = lorentz_vector(-(pa_prime + pb_prime) / scalar(w), w)
    pa_prime2 = lorentz_boost(pa_prime, pab)

    theta_a = atfi.acos(
        z_component(pa_prime2) / norm(spatial_components(pa_prime2)))
    phi_a = atfi.atan2(y_component(pa_prime2), x_component(pa_prime2))

    return (theta_r, phi_r, theta_a, phi_a)
Пример #4
0
def spherical_angles(pb):
    """theta, phi : polar and azimuthal angles of the vector pb

    :param pb: 

    """
    z1 = unit_vector(
        spatial_components(pb))  # New z-axis is in the direction of pb
    theta = atfi.acos(z_component(z1))  # Helicity angle
    phi = atfi.atan2(y_component(pb), x_component(pb))  # phi angle
    return (theta, phi)
Пример #5
0
def spherical_angles(pb):
    """
    Return polar and azimuthal angles of the 3-vector or Lorentz vector

    :param pb: Input vector
    :returns: tuple (theta, phi), where theta is the polar
              and phi the azimuthal angles

    """
    z1 = unit_vector(
        spatial_components(pb))  # Unit vector in the direction of pb
    theta = atfi.acos(z_component(z1))  # Helicity angle
    phi = atfi.atan2(y_component(pb), x_component(pb))  # phi angle
    return (theta, phi)
Пример #6
0
def azimuthal_4body_angle(p1, p2, p3, p4):
    """Calculates the angle between the plane defined by (p1,p2) and (p3,p4)

    :param p1: 
    :param p2: 
    :param p3: 
    :param p4: 

    """
    v1 = spatial_components(p1)
    v2 = spatial_components(p2)
    v3 = spatial_components(p3)
    v4 = spatial_components(p4)
    n12 = unit_vector(vector_product(v1, v2))
    n34 = unit_vector(vector_product(v3, v4))
    z = unit_vector(v1 + v2)
    cosPhi = scalar_product(n12, n34)
    sinPhi = scalar_product(vector_product(n12, n34), z)
    phi = atfi.atan2(sinPhi, cosPhi)  # defined in [-pi,pi]
    return phi