def wrong_reference_system(net):
    """
    Checks usage of wrong reference system for loads, sgens and gens.

     INPUT:
        **net** (pandapowerNet)    - pandapower network

     OUTPUT:
        **check_results** (dict)        - dict that contains the indices of all components where the
                                          usage of the wrong reference system was found.

                                          Format: {'element_type': element_indices}

    """
    check_results = {}
    neg_loads = list(net.load[net.load.p_mw < 0].index)
    pos_gens = list(net.gen[net.gen.p_mw < 0].index)
    pos_sgens = list(net.sgen[net.sgen.p_mw < 0].index)

    if neg_loads:
        check_results['loads'] = neg_loads
    if pos_gens:
        check_results['gens'] = pos_gens
    if pos_sgens:
        check_results['sgens'] = pos_sgens

    if check_results:
        return check_results