16using namespace Kernel;
18using DataObjects::PeaksWorkspace;
33 "The first of peaks.");
35 "The second set of peaks.");
37 "The set of peaks that are in the first, but not the second, workspace.");
39 auto mustBePositive = std::make_shared<BoundedValidator<double>>();
40 mustBePositive->setLower(0.0);
43 "Maximum difference in each component of Q for which peaks "
44 "are considered identical");
55 if (LHSWorkspace->getInstrument()->getName() != RHSWorkspace->getInstrument()->getName()) {
56 g_log.
warning(
"The two input workspaces do not appear to come from data "
57 "take on the same instrument");
59 if (LHSWorkspace->sample().getName() != RHSWorkspace->sample().getName()) {
60 g_log.
warning(
"The two input workspaces do not appear to relate to the same sample");
66 auto &rhsPeaks = RHSWorkspace->getPeaks();
68 auto &lhsPeaks = output->getPeaks();
72 std::vector<int> badPeaks;
75 for (
const auto ¤tPeak : rhsPeaks) {
79 for (
int j = 0; j < output->getNumberPeaks(); ++j) {
80 const V3D deltaQ = currentPeak.getQSampleFrame() - lhsPeaks[j].getQSampleFrame();
85 badPeaks.emplace_back(j);
92 output->removePeaks(std::move(badPeaks));
#define DECLARE_ALGORITHM(classname)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
Helper class for reporting progress from algorithms.
A property class for workspaces.
void exec() override
Executes the algorithm.
const std::string category() const override
Algorithm's category for identification.
const std::string name() const override
Algorithm's name for identification.
int version() const override
Algorithm's version for identification.
void init() override
Initialises the algorithm's properties.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void warning(const std::string &msg)
Logs at warning level.
bool nullVector(const double tolerance=1e-3) const noexcept
Determine if the point is null.
std::shared_ptr< const PeaksWorkspace > PeaksWorkspace_const_sptr
Typedef for a shared pointer to a const peaks workspace.
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
constexpr double Tolerance
Standard tolerance value.
@ Input
An input workspace.
@ Output
An output workspace.