def spherical_to_cartesian(backend, pt, eta, phi, mass):
    """Converts an array of spherical four-momentum coordinates (pt, eta, phi, mass) to cartesian (px, py ,pz, E).
    
    Args:
        backend (library): either hepaccelerate.backend_cpu or hepaccelerate.backend_cuda
        pt (array of floats): Data array of the transverse momentum values (numpy or cupy)
        eta (array of floats): Data array of the pseudorapidity
        phi (array of floats): Data array of the azimuthal angle
        mass (array of floats): Data array of the mass
    
    Returns:
        tuple of arrays: returns the numpy or cupy arrays (px, py, pz, E) 
    """
    return backend.spherical_to_cartesian(pt, eta, phi, mass)