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
59
61 API::MatrixWorkspace_sptr diffractionFocusRaggedRebinInDspace(API::MatrixWorkspace_sptr ws);
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
81 double m_l1{0.0};
82 std::vector<int32_t> specids;
83 std::vector<double> l2s;
84 std::vector<double> tths;
85 std::vector<double> phis;
86 std::string m_instName;
87 std::vector<double> m_params;
88 int m_resampleX{0};
89 std::vector<double> m_dmins;
90 std::vector<double> m_dmaxs;
91 std::vector<double> m_delta_ragged;
92 std::vector<double> m_resonanceLower;
93 std::vector<double> m_resonanceUpper;
94 bool binInDspace{false};
95 double xmin{0.0};
96 double xmax{0.0};
97 double minwl{0.0};
98 double maxwl{0.0};
99 double tmin{0.0};
100 double tmax{0.0};
101 bool m_preserveEvents{false};
102 void compressEventsOutputWS(const double compressEventsTolerance, const double wallClockTolerance);
103 bool shouldCompressUnfocused(const double compressTolerance, const double tofmin, const double tofmax,
104 const bool hasWallClockTolerance);
105
106 std::unique_ptr<API::Progress> m_progress = nullptr;
107};
108
109} // namespace WorkflowAlgorithms
110} // namespace Mantid
std::string name
Definition Run.cpp:60
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition System.h:33
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.
int version() const override
Algorithm's version for identification overriding a virtual method.
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
Helper class which provides the Collimation Length for SANS instruments.