How to use the phasespace.phasespace.GenParticle.set_children function in phasespace

To help you get started, we’ve selected a few phasespace examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zfit / phasespace / phasespace / phasespace.py View on Github external
'p_{i}', where i is given by their ordering in the `masses` list.

    Return:
        `GenParticle`: Particle decay.

    Raise:
        ValueError: If the length of `masses` and `names` doesn't match.

    """
    if not top_name:
        top_name = 'top'
    if not names:
        names = [f"p_{num}" for num in range(len(masses))]
    if len(names) != len(masses):
        raise ValueError("Mismatch in length between children masses and their names.")
    return GenParticle(top_name, mass_top).set_children(*[GenParticle(names[num], mass=mass)
                                                          for num, mass in enumerate(masses)])