The death benefit provisions of paragraph (a) of Section 31839 shall be subject to the provisions of Sections 31765, 31765.1, 31781.1 and 31781.2 in those counties where these sections are applicable. In all calculations under these sections only the retirement allowances which would be payable by the system from which the member elected deferred retirement shall be considered. The provisions of Section 31784 shall apply to the death benefits provided by paragraphs (a) and (b) of Section 31839.