Mantid
Loading...
Searching...
No Matches
Plus.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10#include "MantidAPI/Run.h"
13
14namespace Mantid {
15namespace Algorithms {
32class MANTID_ALGORITHMS_DLL Plus : public CommutativeBinaryOperation {
33public:
35 const std::string name() const override { return "Plus"; }
37 const std::string summary() const override {
38 return "The Plus algorithm will add the data values and calculate the "
39 "corresponding error values in two compatible workspaces. ";
40 }
41
43 int version() const override { return 1; }
44 const std::vector<std::string> seeAlso() const override { return {"Divide", "Minus", "Multiply"}; }
45
46private:
47 // Overridden BinaryOperation methods
48 void performBinaryOperation(const HistogramData::Histogram &lhs, const HistogramData::Histogram &rhs,
49 HistogramData::HistogramY &YOut, HistogramData::HistogramE &EOut) override;
50 void performBinaryOperation(const HistogramData::Histogram &lhs, const double rhsY, const double rhsE,
51 HistogramData::HistogramY &YOut, HistogramData::HistogramE &EOut) override;
52 void performEventBinaryOperation(DataObjects::EventList &lhs, const DataObjects::EventList &rhs) override;
53 void performEventBinaryOperation(DataObjects::EventList &lhs, const MantidVec &rhsX, const MantidVec &rhsY,
54 const MantidVec &rhsE) override;
55 void performEventBinaryOperation(DataObjects::EventList &lhs, const double &rhsY, const double &rhsE) override;
56
57 void checkRequirements() override;
58 std::string checkSizeCompatibility(const API::MatrixWorkspace_const_sptr lhs,
59 const API::MatrixWorkspace_const_sptr rhs) const override;
60 bool checkCompatibility(const API::MatrixWorkspace_const_sptr lhs,
61 const API::MatrixWorkspace_const_sptr rhs) const override;
62 void operateOnRun(const API::Run &lhs, const API::Run &rhs, API::Run &ans) const override;
63
64 // Overridden event-specific operation
65 bool checkUnitCompatibility(const API::MatrixWorkspace_const_sptr &lhs,
67};
68
69} // namespace Algorithms
70} // namespace Mantid
const std::vector< double > & rhs
This class stores information regarding an experimental run as a series of log entries.
Definition: Run.h:38
CommutativeBinaryOperation supports commutative binary operations on two input workspaces.
Plus performs the addition of two input workspaces.
Definition: Plus.h:32
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: Plus.h:44
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: Plus.h:43
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: Plus.h:35
const std::string summary() const override
Summary of algorithms purpose.
Definition: Plus.h:37
A class for holding :
Definition: EventList.h:56
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
Helper class which provides the Collimation Length for SANS instruments.