Ejemplo n.º 1
0
void
MDHistoToWorkspace2D::checkW2D(Mantid::DataObjects::Workspace2D_sptr outWS) {
  size_t nSpectra = outWS->getNumberHistograms();
  size_t length = outWS->blocksize();
  MantidVec x, y, e;

  g_log.information() << "W2D has " << nSpectra << " histograms of length "
                      << length;
  for (size_t i = 0; i < nSpectra; i++) {
    ISpectrum *spec = outWS->getSpectrum(i);
    x = spec->dataX();
    y = spec->dataY();
    e = spec->dataE();
    if (x.size() != length) {
      g_log.information() << "Spectrum " << i << " x-size mismatch, is "
                          << x.size() << " should be " << length << "\n";
    }
    if (y.size() != length) {
      g_log.information() << "Spectrum " << i << " y-size mismatch, is "
                          << y.size() << " should be " << length << "\n";
    }
    if (e.size() != length) {
      g_log.information() << "Spectrum " << i << " e-size mismatch, is "
                          << e.size() << " should be " << length << "\n";
    }
  }
}