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 diffractionFocusRaggedRebinInDspace(API::MatrixWorkspace_sptr ws);
65
67 API::MatrixWorkspace_sptr convertUnits(API::MatrixWorkspace_sptr matrixws, const std::string &target);
68
71
73 API::MatrixWorkspace_sptr editInstrument(API::MatrixWorkspace_sptr ws, const std::vector<double> &polars,
74 const std::vector<specnum_t> &specids, const std::vector<double> &l2s,
75 const std::vector<double> &phis);
76 void convertOffsetsToCal(DataObjects::OffsetsWorkspace_sptr &offsetsWS);
77 double getVecPropertyFromPmOrSelf(const std::string &name, std::vector<double> &avec);
78
84 double m_l1{0.0};
85 std::vector<int32_t> specids;
86 std::vector<double> l2s;
87 std::vector<double> tths;
88 std::vector<double> phis;
89 std::string m_instName;
90 std::vector<double> m_params;
91 int m_resampleX{0};
92 std::vector<double> m_dmins;
93 std::vector<double> m_dmaxs;
94 std::vector<double> m_delta_ragged;
95 std::vector<double> m_resonanceLower;
96 std::vector<double> m_resonanceUpper;
97 bool binInDspace{false};
98 double xmin{0.0};
99 double xmax{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 compressEventsOutputWS(const double compressEventsTolerance, const double wallClockTolerance);
107 bool shouldCompressUnfocused(const double compressTolerance, const double tofmin, const double tofmax,
108 const bool hasWallClockTolerance);
109
115 bool m_processLowResTOF{false};
117 size_t m_lowResSpecOffset{0};
118
119 std::unique_ptr<API::Progress> m_progress = nullptr;
120};
121
122} // namespace WorkflowAlgorithms
123} // namespace Mantid
std::string name
Definition Run.cpp:60
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition System.h:37
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< 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
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.