def process_output(output):
    """
    Given the output file, filter out photons, electrons and positrons
    """

    if output is None:
        return (None, None, None) # no photons, electrons or positrons

    photons   = list()
    electrons = list()
    positrons = list()

    with open(output, "r") as f:
        for cnt, line in enumerate(f):
            if "GGG" in line:
                photons.append(line)
            elif "EEE" in line:
                electrons.append(line)
            elif "PPP" in line:
                positrons.append(line)

    return (photons if len(photons)>0 else None, electrons if len(electrons)>0 else None, positrons if len(positrons)>0 else None)