@staticmethod
def get_referenced_beam_sequence_index(fx_grp_seq, beam_number):
    """
        Determine the index of the referenced beam sequence for a given beam_number. This properly connects BeamSequence
        beams and ReferencedBeamSequence beams.
        :param fx_grp_seq: Index of the fraction group (likely 0 unless TPS allows multiple prescriptions
        :param beam_number: The beam number of the beam of interest within BeamSequence
        :return: the ReferencedBeamSequence index that matches beam_number
        :rtype: int
        """
    for i, ref_beam_seq in enumerate(fx_grp_seq.ReferencedBeamSequence):
        if ref_beam_seq.ReferencedBeamNumber == beam_number:
            return i
    print(
        'ERROR: Failed to find a matching reference beam in ReferencedBeamSequence for beam number %s'
         % beam_number)
