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);
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;
49 std::string createChildWorkspaceName(const std::string &groupName, const size_t periodIndex);
50
51 // A 2D matrix holding workspaces obtained from each workspace list/group
52 std::vector<std::vector<API::MatrixWorkspace_sptr>> m_inputWSMatrix;
53
54 std::vector<double> m_startOverlaps;
55 std::vector<double> m_endOverlaps;
56 std::vector<double> m_params;
57 std::vector<double> m_scaleFactors;
58 std::vector<double> m_manualScaleFactors;
60
61 bool m_useManualScaleFactors = false;
62 size_t m_scaleFactorFromPeriod = 1;
63 int m_indexOfReference = 0;
64};
65
66} // namespace Algorithms
67} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Stitch1DMany : Stitches multiple Matrix Workspaces together into a single output.
bool checkGroups() override
Pass groups in as they are to this algorithm.
std::vector< double > m_scaleFactors
std::vector< std::vector< API::MatrixWorkspace_sptr > > m_inputWSMatrix
std::vector< double > m_params
int version() const override
Algorithm's version for identification.
API::Workspace_sptr m_outputWorkspace
std::vector< double > m_endOverlaps
const std::string name() const override
Algorithm's name for identification.
const std::string summary() const override
Summary of algorithm's purpose.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
std::vector< double > m_startOverlaps
std::vector< double > m_manualScaleFactors
const std::string category() const override
Algorithm's category for identification.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Helper class which provides the Collimation Length for SANS instruments.