docs: def load_k40_coincidences_from_rootfile(filename, dom_id):
      """Load k40 coincidences from JMonitorK40 ROOT file
  
      Parameters
      ----------
      filename: root file produced by JMonitorK40
      dom_id: DOM ID
  
      Returns
      -------
      data: numpy array of coincidences
      dom_weight: weight to apply to coincidences to get rate in Hz
      """
  
      from ROOT import TFile
      root_file_monitor = TFile(filename, "READ")
      dom_name = str(dom_id) + ".2S"
      histo_2d_monitor = root_file_monitor.Get(dom_name)
      data = []
      for c in range(1, histo_2d_monitor.GetNbinsX() + 1):
          combination = []
          for b in range(1, histo_2d_monitor.GetNbinsY() + 1):
              combination.append(histo_2d_monitor.GetBinContent(c, b))
          data.append(combination)
  
      weights = {}
      weights_histo = root_file_monitor.Get('weights_hist')
      try:
          for i in range(1, weights_histo.GetNbinsX() + 1):
              # we have to read all the entries, unfortunately
              weight = weights_histo.GetBinContent(i)
              label = weights_histo.GetXaxis().GetBinLabel(i)
              weights[label[3:]] = weight
          dom_weight = weights[str(dom_id)]
      except AttributeError:
          log.info("Weights histogram broken or not found, setting weight to 1.")
          dom_weight = 1.
      return np.array(data), dom_weight