def virial_mass_HB(temp, z):
    """Halo mass from Virial temperature according to Haiman & Bryan
    (2006ApJ...650....7).

    z is the redshift.

    Units are Msun and kelvin.

    """
    return 1e6 * (21. * temp / (1800 * (1+z)))**(3./2.)