29 std::vector<int> subtractedPeriods)
30 : m_inputWS(
std::move(inputWS)), m_summedPeriods(
std::move(summedPeriods)),
31 m_subtractedPeriods(
std::move(subtractedPeriods)) {}
40 if (!periodsToSum.empty()) {
41 auto LHSWorkspace =
m_inputWS->getItem(periodsToSum[0] - 1);
42 outWS = std::dynamic_pointer_cast<MatrixWorkspace>(LHSWorkspace);
43 if (outWS !=
nullptr && periodsToSum.size() > 1) {
44 auto numPeriods =
static_cast<int>(periodsToSum.size());
45 for (
int i = 1; i < numPeriods; i++) {
46 auto RHSWorkspace =
m_inputWS->getItem(periodsToSum[i] - 1);
49 alg->setProperty(
"LHSWorkspace", outWS);
50 alg->setProperty(
"RHSWorkspace", RHSWorkspace);
51 alg->setProperty(
"OutputWorkspace",
"__NotUsed__");
53 outWS = alg->getProperty(
"OutputWorkspace");
72 alg->setProperty(
"LHSWorkspace", lhs);
73 alg->setProperty(
"RHSWorkspace",
rhs);
74 alg->setProperty(
"OutputWorkspace",
"__NotUsed__");
76 outWS = alg->getProperty(
"OutputWorkspace");
92 alg->setProperty(
"InputWorkspace", inputWS);
93 alg->setProperty(
"WorkspaceIndex",
index);
94 alg->setProperty(
"OutputWorkspace",
"__NotUsed__");
96 outWS = alg->getProperty(
"OutputWorkspace");
const std::vector< double > & rhs
std::map< DeltaEMode::Type, std::string > index
Base MatrixWorkspace Abstract Class.
Manage the lifetime of a class intended to be a singleton.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
IMuonAsymmetryCalculator(API::WorkspaceGroup_sptr inputWS, std::vector< int > summedPeriods, std::vector< int > subtractedPeriods)
Constructor.
API::MatrixWorkspace_sptr subtractWorkspaces(const API::MatrixWorkspace_sptr &lhs, const API::MatrixWorkspace_sptr &rhs) const
Subtracts one workspace from another (lhs - rhs)
const API::WorkspaceGroup_sptr m_inputWS
Input workspace.
API::MatrixWorkspace_sptr sumPeriods(const std::vector< int > &periodsToSum) const
Sums the specified periods in the input workspace group.
API::MatrixWorkspace_sptr extractSpectrum(const API::Workspace_sptr &inputWS, const int index) const
Extracts a single spectrum from a workspace.
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class