Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Mantid::Algorithms::RunCombinationHelper Class Reference

#include <RunCombinationHelper.h>

Public Member Functions

std::string checkCompatibility (const API::MatrixWorkspace_sptr &, bool checkNumberHistograms=false)
 Compares the properties of the input workspace with the reference. More...
 
void setReferenceProperties (const API::MatrixWorkspace_sptr &)
 Sets the properties of the reference (usually first) workspace, to later check the compatibility of the others with the reference. More...
 
std::list< API::MatrixWorkspace_sptrvalidateInputWorkspaces (const std::vector< std::string > &inputWorkspaces, Kernel::Logger &g_log)
 Checks that the input workspace all exist, that they are the same size, have the same units and the same instrument name. More...
 

Static Public Member Functions

static std::vector< std::string > unWrapGroups (const std::vector< std::string > &)
 Flattens the list of group workspaces (if any) into list of workspaces. More...
 

Private Attributes

std::vector< bool > m_hasDx
 
std::string m_instrumentName
 
bool m_isDistribution
 
bool m_isHistogramData
 
bool m_isScanning
 
size_t m_numberDetectors
 
size_t m_numberSpectra
 
std::string m_spectrumAxisUnit
 
std::string m_xUnit
 
std::string m_yUnit
 

Detailed Description

Definition at line 31 of file RunCombinationHelper.h.

Member Function Documentation

◆ checkCompatibility()

std::string Mantid::Algorithms::RunCombinationHelper::checkCompatibility ( const API::MatrixWorkspace_sptr ws,
bool  checkNumberHistograms = false 
)

Compares the properties of the input workspace with the reference.

Parameters
ws: the testee workspace
checkNumberHistograms: whether to check also the number of histograms
Returns
: empty if compatible, error message otherwises

Definition at line 79 of file RunCombinationHelper.cpp.

References m_hasDx, m_instrumentName, m_isDistribution, m_isHistogramData, m_isScanning, m_numberDetectors, m_numberSpectra, m_spectrumAxisUnit, m_xUnit, and m_yUnit.

Referenced by Mantid::Algorithms::ConjoinXRuns::validateInputs(), Mantid::Algorithms::Stitch::validateInputs(), Mantid::Algorithms::Stitch1D::validateInputs(), Mantid::Algorithms::Stitch1DMany::validateInputs(), Mantid::Algorithms::MergeRuns::validateInputsForEventWorkspaces(), and validateInputWorkspaces().

◆ setReferenceProperties()

void Mantid::Algorithms::RunCombinationHelper::setReferenceProperties ( const API::MatrixWorkspace_sptr ref)

◆ unWrapGroups()

std::vector< std::string > Mantid::Algorithms::RunCombinationHelper::unWrapGroups ( const std::vector< std::string > &  inputs)
static

Flattens the list of group workspaces (if any) into list of workspaces.

Parameters
inputs: input workspaces vector [including] group workspaces (all must be on ADS)
Returns
: the flat vector of the input workspaces
Exceptions
std::runtime_error if the input workspaces are neither groups nor MatrixWorkspaces

Definition at line 31 of file RunCombinationHelper.cpp.

References Mantid::API::WorkspaceGroup::getNames(), and Mantid::Kernel::SingletonHolder< T >::Instance().

Referenced by Mantid::Algorithms::ConjoinXRuns::exec(), Mantid::Algorithms::MergeRuns::exec(), Mantid::Algorithms::Stitch::exec(), Mantid::Algorithms::SumOverlappingTubes::getInputParameters(), Mantid::Algorithms::ConjoinXRuns::validateInputs(), Mantid::Algorithms::Stitch::validateInputs(), and Mantid::Algorithms::Stitch1DMany::validateInputs().

◆ validateInputWorkspaces()

std::list< API::MatrixWorkspace_sptr > Mantid::Algorithms::RunCombinationHelper::validateInputWorkspaces ( const std::vector< std::string > &  inputWorkspaces,
Kernel::Logger g_log 
)

Checks that the input workspace all exist, that they are the same size, have the same units and the same instrument name.

Will throw if they don't.

Parameters
inputWorkspacesThe names of the input workspaces
g_logA logger to send error messages to
Returns
A list of pointers to the input workspace, ordered by increasing frame starting point
Exceptions
Exception::NotFoundErrorIf an input workspace doesn't exist
std::invalid_argumentIf the input workspaces are not compatible

Definition at line 124 of file RunCombinationHelper.cpp.

References checkCompatibility(), Mantid::Kernel::Logger::error(), Mantid::API::g_log, Mantid::Kernel::SingletonHolder< T >::Instance(), and setReferenceProperties().

Referenced by Mantid::Algorithms::MergeRuns::execHistogram(), and Mantid::Algorithms::SumOverlappingTubes::getInputParameters().

Member Data Documentation

◆ m_hasDx

std::vector<bool> Mantid::Algorithms::RunCombinationHelper::m_hasDx
private

Definition at line 49 of file RunCombinationHelper.h.

Referenced by checkCompatibility(), and setReferenceProperties().

◆ m_instrumentName

std::string Mantid::Algorithms::RunCombinationHelper::m_instrumentName
private

Definition at line 45 of file RunCombinationHelper.h.

Referenced by checkCompatibility(), and setReferenceProperties().

◆ m_isDistribution

bool Mantid::Algorithms::RunCombinationHelper::m_isDistribution
private

Definition at line 47 of file RunCombinationHelper.h.

Referenced by checkCompatibility(), and setReferenceProperties().

◆ m_isHistogramData

bool Mantid::Algorithms::RunCombinationHelper::m_isHistogramData
private

Definition at line 46 of file RunCombinationHelper.h.

Referenced by checkCompatibility(), and setReferenceProperties().

◆ m_isScanning

bool Mantid::Algorithms::RunCombinationHelper::m_isScanning
private

Definition at line 48 of file RunCombinationHelper.h.

Referenced by checkCompatibility(), and setReferenceProperties().

◆ m_numberDetectors

size_t Mantid::Algorithms::RunCombinationHelper::m_numberDetectors
private

Definition at line 41 of file RunCombinationHelper.h.

Referenced by checkCompatibility(), and setReferenceProperties().

◆ m_numberSpectra

size_t Mantid::Algorithms::RunCombinationHelper::m_numberSpectra
private

Definition at line 40 of file RunCombinationHelper.h.

Referenced by checkCompatibility(), and setReferenceProperties().

◆ m_spectrumAxisUnit

std::string Mantid::Algorithms::RunCombinationHelper::m_spectrumAxisUnit
private

Definition at line 44 of file RunCombinationHelper.h.

Referenced by checkCompatibility(), and setReferenceProperties().

◆ m_xUnit

std::string Mantid::Algorithms::RunCombinationHelper::m_xUnit
private

Definition at line 42 of file RunCombinationHelper.h.

Referenced by checkCompatibility(), and setReferenceProperties().

◆ m_yUnit

std::string Mantid::Algorithms::RunCombinationHelper::m_yUnit
private

Definition at line 43 of file RunCombinationHelper.h.

Referenced by checkCompatibility(), and setReferenceProperties().


The documentation for this class was generated from the following files: