def w(q2: float, m_parent: float, m_daughter: float) -> float:
    """
    Calculates the recoil variable w, which runs from 1 (zero recoil) to the maximum value (depends on daughter).
    :param q2: Momentum transfer to the lepton-neutrino system.
    :param m_parent: Mass of the parent meson, e.g. the B meson.
    :param m_daughter: Mass of the daughter meson, e.g. the D or D* meson.
    :return:
    """
    return (m_parent ** 2 + m_daughter ** 2 - q2) / (2 * m_parent * m_daughter)