Mantid
Loading...
Searching...
No Matches
AlignAndFocusPowder.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2008 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
15
16namespace Mantid {
17namespace Kernel {
18class PropertyManager;
19}
20
21namespace WorkflowAlgorithms {
29public:
31 const std::string name() const override { return "AlignAndFocusPowder"; }
32
34 int version() const override { return 1; }
35 const std::vector<std::string> seeAlso() const override { return {"AlignAndFocusPowderFromFiles"}; }
36
38 const std::string category() const override { return "Workflow\\Diffraction"; }
39
41 const std::string summary() const override {
42 return "Algorithm to focus powder diffraction data into a number of "
43 "histograms "
44 "according to a grouping scheme defined in a CalFile.";
45 }
46
47 std::map<std::string, std::string> validateInputs() override;
48
49private:
50 // Overridden Algorithm methods
51 void init() override;
52 void exec() override;
53 void loadCalFile(const std::string &calFilename, const std::string &groupFilename);
55 API::MatrixWorkspace_sptr rebinRagged(API::MatrixWorkspace_sptr matrixws, const bool inDspace);
56
57 API::MatrixWorkspace_sptr conjoinWorkspaces(const API::MatrixWorkspace_sptr &ws1,
58 const API::MatrixWorkspace_sptr &ws2, size_t offset);
59
62
64 API::MatrixWorkspace_sptr convertUnits(API::MatrixWorkspace_sptr matrixws, const std::string &target);
65
68
70 API::MatrixWorkspace_sptr editInstrument(API::MatrixWorkspace_sptr ws, const std::vector<double> &polars,
71 const std::vector<specnum_t> &specids, const std::vector<double> &l2s,
72 const std::vector<double> &phis);
73 void convertOffsetsToCal(DataObjects::OffsetsWorkspace_sptr &offsetsWS);
74 double getVecPropertyFromPmOrSelf(const std::string &name, std::vector<double> &avec);
75
83 double m_l1{0.0};
84 std::vector<int32_t> specids;
85 std::vector<double> l2s;
86 std::vector<double> tths;
87 std::vector<double> phis;
88 std::string m_instName;
89 std::vector<double> m_params;
90 int m_resampleX{0};
91 std::vector<double> m_dmins;
92 std::vector<double> m_dmaxs;
93 std::vector<double> m_delta_ragged;
94 std::vector<double> m_resonanceLower;
95 std::vector<double> m_resonanceUpper;
96 bool dspace{false};
97 double xmin{0.0};
98 double xmax{0.0};
99 double LRef{0.0};
100 double DIFCref{0.0};
101 double minwl{0.0};
102 double maxwl{0.0};
103 double tmin{0.0};
104 double tmax{0.0};
105 bool m_preserveEvents{false};
106 void doSortEvents(const Mantid::API::Workspace_sptr &ws);
107
113 bool m_processLowResTOF{false};
115 size_t m_lowResSpecOffset{0};
116
117 std::unique_ptr<API::Progress> m_progress = nullptr;
118};
119
120} // namespace WorkflowAlgorithms
121} // namespace Mantid
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition: System.h:53
Data processor algorithm to be used as a parent to workflow algorithms.
This is a parent algorithm that uses several different child algorithms to perform it's task.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
DataObjects::GroupingWorkspace_sptr m_groupWS
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
API::MatrixWorkspace_sptr m_lowResW
Low resolution TOF matrix workspace.
int version() const override
Algorithm's version for identification overriding a virtual method.
DataObjects::EventWorkspace_sptr m_lowResEW
Low resolution TOF event workspace.
const std::vector< std::string > seeAlso() const override
const std::string summary() const override
Summary of algorithms purpose.
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< GroupingWorkspace > GroupingWorkspace_sptr
shared pointer to the GroupingWorkspace class
std::shared_ptr< MaskWorkspace > MaskWorkspace_sptr
shared pointer to the MaskWorkspace class
Definition: MaskWorkspace.h:64
std::shared_ptr< OffsetsWorkspace > OffsetsWorkspace_sptr
shared pointer to the OffsetsWorkspace class
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
Helper class which provides the Collimation Length for SANS instruments.