<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_tgt_length(self, var):
 """Get the total length of the whole reference sequence """

        if var.type == "g" or var.type == "m":
            return float("inf")
        else:
            # Get genomic sequence access number for this transcript
            identity_info = self.hdp.get_tx_identity_info(var.ac)
            if not identity_info:
                raise HGVSDataNotAvailableError(
                    "No identity info available for {ac}".format(ac=var.ac))
            tgt_len = sum(identity_info["lengths"])
            return tgt_len