29 const std::vector<int> &summedPeriods,
30 const std::vector<int> &subtractedPeriods,
31 const int firstPairIndex,
const int secondPairIndex,
34 m_firstPairIndex(firstPairIndex), m_secondPairIndex(secondPairIndex) {}
44 int numPeriods =
m_inputWS->getNumberOfEntries();
59 outWS = asymSummedPeriods;
84 alg->setProperty(
"InputWorkspace", inputWS);
85 alg->setProperty(
"ForwardSpectra", fwd);
86 alg->setProperty(
"BackwardSpectra", bwd);
87 alg->setProperty(
"Alpha",
m_alpha);
88 alg->setProperty(
"OutputWorkspace",
"__NotUsed__");
90 outWS = alg->getProperty(
"OutputWorkspace");
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 : Abstract base class for muon asymmetry calculations.
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.
const std::vector< int > m_subtractedPeriods
List of subtracted periods.
API::MatrixWorkspace_sptr sumPeriods(const std::vector< int > &periodsToSum) const
Sums the specified periods in the input workspace group.
const std::vector< int > m_summedPeriods
List of summed periods.
MuonPairAsymmetryCalculator(const API::WorkspaceGroup_sptr &inputWS, const std::vector< int > &summedPeriods, const std::vector< int > &subtractedPeriods, const int firstPairIndex, const int secondPairIndex, const double alpha=1)
Constructor.
API::MatrixWorkspace_sptr calculate() const override
Performs pair asymmetry calculation.
const double m_alpha
Alpha value of the pair.
API::MatrixWorkspace_sptr asymmetryCalc(const API::Workspace_sptr &inputWS) const
Calculate asymmetry for the given workspace.
const int m_secondPairIndex
Workspace index of the second group of the pair.
const int m_firstPairIndex
Workspace index of the first group of the pair.
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