Extract dom information from detector file

def _parse_doms(self):
        """Extract dom information from detector file"""
        self.print("Reading PMT information...")
        self._det_file.seek(0, 0)
        self._readline()
        pmts = defaultdict(list)
        pmt_index = 0
        while True:
            line = self._readline()

            if line == '':
                self.print("Done.")
                break

            try:
                dom_id, du, floor, n_pmts = split(line, int)
            except ValueError:
                continue

            if du != self._current_du:
                log.debug("Next DU, resetting floor to 1.")
                self._current_du = du
                self.dus.append(du)
                self._current_floor = 1
                if du == 1 and floor == -1:
                    log.warning(
                        "Floor ID is -1 (Jpp conversion bug), "
                        "using our own floor ID!"
                    )
            else:
                self._current_floor += 1

            if floor == -1:
                log.debug("Setting floor ID to our own ID")
                floor = self._current_floor

            self.doms[dom_id] = (du, floor, n_pmts)

            if self.n_pmts_per_dom is None:
                self.n_pmts_per_dom = n_pmts

            if self.n_pmts_per_dom != n_pmts:
                log.warning(
                    "DOMs with different number of PMTs are "
                    "detected, this can cause some unexpected "
                    "behaviour."
                )

            for i in range(n_pmts):
                raw_pmt_info = self._readline()
                pmt_info = raw_pmt_info.split()
                pmt_id, x, y, z, rest = unpack_nfirst(pmt_info, 4)
                dx, dy, dz, t0, rest = unpack_nfirst(rest, 4)
                pmt_id = int(pmt_id)
                omkey = (du, floor, i)
                pmts['pmt_id'].append(int(pmt_id))
                pmts['pos_x'].append(float(x))
                pmts['pos_y'].append(float(y))
                pmts['pos_z'].append(float(z))
                pmts['dir_x'].append(float(dx))
                pmts['dir_y'].append(float(dy))
                pmts['dir_z'].append(float(dz))
                pmts['t0'].append(float(t0))
                pmts['du'].append(int(du))
                pmts['floor'].append(int(floor))
                pmts['channel_id'].append(int(i))
                pmts['dom_id'].append(int(dom_id))
                if self.version == 'v3' and rest:
                    status, rest = unpack_nfirst(rest, 1)
                    pmts['status'].append(int(status))
                if rest:
                    log.warning("Unexpected PMT values: {0}".format(rest))
                self._pmt_index_by_omkey[omkey] = pmt_index
                self._pmt_index_by_pmt_id[pmt_id] = pmt_index
                pmt_index += 1

        self.pmts = Table(pmts, name='PMT')