code: def create_hist(self, evclass, evtype, xsep, energy, ctheta,
                      fill_sep=False, fill_evtype=False):
          
  
          nevt = len(evclass)
          ebin = utils.val_to_bin(self._energy_bins, energy)
          scale = self._psf_scale[ebin]
  
          vals = [energy, ctheta]
          bins = [self._energy_bins, self._ctheta_bins]
  
          if fill_sep:
              vals += [xsep]
              bins += [self._xsep_bins]
  
          if fill_evtype:
              loopv = [self._evclass_bins[:-1], self._evtype_bins[:-1]]
              shape = [16, 16] + [len(b) - 1 for b in bins]
          else:
              loopv = [self._evclass_bins[:-1]]
              shape = [16] + [len(b) - 1 for b in bins]
  
          h = np.zeros(shape)
          for t in itertools.product(*loopv):
  
              m = (evclass[:, int(t[0])] == True)
              if fill_evtype:
                  m &= (evtype[:, int(t[1])] == True)
              if not np.sum(m):
                  continue
  
              z = np.vstack(vals)
              z = z[:, m]
  
              if fill_evtype:
                  h[int(t[0]), int(t[1])] += np.histogramdd(z.T, bins=bins)[0]
              else:
                  h[int(t[0])] += np.histogramdd(z.T, bins=bins)[0]
  
          return h
docs: Load into a histogram.