def mass_weighted_number(dat, total_sampled_mass, component_mass):
    """Compute the total number of systems in the synthetic catalog
    based on the total sampled mass of the simulated system and
    the total mass of a given galactic component

    Parameters
    ----------
    dat : DataFrame
        DataFrame containing the fixed population created from cosmic-pop
    total_sampled_mass : float
        total amount of mass sampled to generate the fixed population
        including single stars
    component_mass : float
        mass of the Galactic component we are simulating

    Returns
    -------
    nSystems : int
        number of systems in a Milky Way population for the selected
        Galactic population and fixed population
    """
    nSystems = int(len(dat.mass_1) * component_mass / total_sampled_mass)
    return nSystems
