Mantid
Loading...
Searching...
No Matches
CompareMDWorkspaces.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 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
13#include "MantidMDAlgorithms/DllConfig.h"
14
15namespace Mantid {
16namespace MDAlgorithms {
17
22class MANTID_MDALGORITHMS_DLL CompareMDWorkspaces final : public API::Algorithm {
23public:
24 const std::string name() const override;
26 const std::string summary() const override { return "Compare two MDWorkspaces for equality."; }
27
28 int version() const override;
29 const std::string category() const override;
30
31private:
32 void init() override;
33 void exec() override;
34 void doComparison();
35 void compareMDGeometry(const Mantid::API::IMDWorkspace_sptr &ws1, const Mantid::API::IMDWorkspace_sptr &ws2);
36 void compareMDHistoWorkspaces(const Mantid::DataObjects::MDHistoWorkspace_sptr &ws1,
38
39 template <typename MDE, size_t nd>
40 void compareMDEventWorkspaces(typename Mantid::DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
41
42 template <typename T> void compare(T a, T b, const std::string &message);
43
44 template <typename T> inline void compareTol(T a, T b, const std::string &message);
45
46 template <typename MDE, size_t nd> void compare2Boxes(API::IMDNode *box1, API::IMDNode *box2, size_t ibox);
47
49
51 std::string m_result;
52
54 double m_tolerance = 0.0;
55
57 bool m_CheckEvents = true;
58
59 bool m_CompareBoxID = true;
60};
61
62} // namespace MDAlgorithms
63} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
std::shared_ptr< MDEventWorkspace< MDE, nd > > sptr
Typedef for a shared pointer of this kind of event workspace.
Compare two MDWorkspaces for equality.
const std::string summary() const override
Summary of algorithms purpose.
Mantid::API::IMDWorkspace_sptr inWS2
std::shared_ptr< IMDWorkspace > IMDWorkspace_sptr
Shared pointer to the IMDWorkspace base class.
Definition: IMDWorkspace.h:146
bool compare(const mypair &left, const mypair &right)
Definition: LoadSassena.cpp:91
std::shared_ptr< MDHistoWorkspace > MDHistoWorkspace_sptr
A shared pointer to a MDHistoWorkspace.
Helper class which provides the Collimation Length for SANS instruments.