/** Check if the two workspace's sizes match (for comparison or *element-by-element operation * * @param other :: the workspace to compare to * @param operation :: descriptive string (for the error message) * @throw an error if they don't match */ void MDHistoWorkspace::checkWorkspaceSize(const MDHistoWorkspace &other, std::string operation) { if (other.getNumDims() != this->getNumDims()) throw std::invalid_argument("Cannot perform the " + operation + " operation on this MDHistoWorkspace. The " "number of dimensions does not match."); if (other.m_length != this->m_length) throw std::invalid_argument("Cannot perform the " + operation + " operation on this MDHistoWorkspace. The " "length of the signals vector does not match."); }
/** * Create & cached the normalization workspace * @param dataWS The binned workspace that will be used for the data */ void MDNormDirectSC::createNormalizationWS(const MDHistoWorkspace &dataWS) { // Copy the MDHisto workspace, and change signals and errors to 0. m_normWS = dataWS.clone(); m_normWS->setTo(0., 0., 0.); }
/** * Create & cached the normalization workspace * @param dataWS The binned workspace that will be used for the data */ void MDNormSCD::createNormalizationWS(const MDHistoWorkspace &dataWS) { // Copy the MDHisto workspace, and change signals and errors to 0. m_normWS.reset(dataWS.clone().release()); m_normWS->setTo(0., 0., 0.); }