Mantid
Loading...
Searching...
No Matches
Stitch1DMany.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2014 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
11#include "MantidAlgorithms/DllConfig.h"
12
13namespace Mantid {
14namespace Algorithms {
15
19class MANTID_ALGORITHMS_DLL Stitch1DMany final : public API::Algorithm {
20public:
22 const std::string name() const override { return "Stitch1DMany"; }
24 int version() const override { return 1; }
25 const std::vector<std::string> seeAlso() const override { return {"Rebin", "Stitch1D"}; }
27 const std::string category() const override { return "Reflectometry"; }
29 const std::string summary() const override { return "Stitches histogram matrix workspaces together"; }
31 std::map<std::string, std::string> validateInputs() override;
32
34 void doStitch1D(std::vector<API::MatrixWorkspace_sptr> &toStitch, const std::vector<double> &manualScaleFactors,
35 API::Workspace_sptr &outWS, std::string &outName);
36
38 void doStitch1DMany(const size_t period, const bool useManualScaleFactors, std::string &outName,
39 std::vector<double> &outScaleFactors, const int indexOfReference, const bool storeInADS = true);
40
41private:
43 void init() override;
45 bool checkGroups() override { return false; }
47 void exec() override;
48
49 // A 2D matrix holding workspaces obtained from each workspace list/group
50 std::vector<std::vector<API::MatrixWorkspace_sptr>> m_inputWSMatrix;
51
52 std::vector<double> m_startOverlaps;
53 std::vector<double> m_endOverlaps;
54 std::vector<double> m_params;
55 std::vector<double> m_scaleFactors;
56 std::vector<double> m_manualScaleFactors;
58
59 bool m_useManualScaleFactors = false;
60 size_t m_scaleFactorFromPeriod = 1;
61 int m_indexOfReference = 0;
62};
63
64} // namespace Algorithms
65} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Stitch1DMany : Stitches multiple Matrix Workspaces together into a single output.
Definition: Stitch1DMany.h:19
bool checkGroups() override
Pass groups in as they are to this algorithm.
Definition: Stitch1DMany.h:45
std::vector< double > m_scaleFactors
Definition: Stitch1DMany.h:55
std::vector< std::vector< API::MatrixWorkspace_sptr > > m_inputWSMatrix
Definition: Stitch1DMany.h:50
std::vector< double > m_params
Definition: Stitch1DMany.h:54
int version() const override
Algorithm's version for identification.
Definition: Stitch1DMany.h:24
API::Workspace_sptr m_outputWorkspace
Definition: Stitch1DMany.h:57
std::vector< double > m_endOverlaps
Definition: Stitch1DMany.h:53
const std::string name() const override
Algorithm's name for identification.
Definition: Stitch1DMany.h:22
const std::string summary() const override
Summary of algorithm's purpose.
Definition: Stitch1DMany.h:29
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: Stitch1DMany.h:25
std::vector< double > m_startOverlaps
Definition: Stitch1DMany.h:52
std::vector< double > m_manualScaleFactors
Definition: Stitch1DMany.h:56
const std::string category() const override
Algorithm's category for identification.
Definition: Stitch1DMany.h:27
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
Helper class which provides the Collimation Length for SANS instruments.