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#include "MantidWorkflowAlgorithms/DllConfig.h"
16
17namespace Mantid {
18namespace Kernel {
19class PropertyManager;
20}
21
22namespace WorkflowAlgorithms {
29class MANTID_WORKFLOWALGORITHMS_DLL AlignAndFocusPowder : public API::DataProcessorAlgorithm {
30public:
32 const std::string name() const override { return "AlignAndFocusPowder"; }
33
35 int version() const override { return 1; }
36 const std::vector<std::string> seeAlso() const override { return {"AlignAndFocusPowderFromFiles"}; }
37
39 const std::string category() const override { return "Workflow\\Diffraction"; }
40
42 const std::string summary() const override {
43 return "Algorithm to focus powder diffraction data into a number of "
44 "histograms "
45 "according to a grouping scheme defined in a CalFile.";
46 }
47
48 std::map<std::string, std::string> validateInputs() override;
49
50private:
51 // Overridden Algorithm methods
52 void init() override;
53 void exec() override;
54 void loadCalFile(const std::string &calFilename, const std::string &groupFilename);
56 API::MatrixWorkspace_sptr rebinRagged(API::MatrixWorkspace_sptr matrixws, const bool inDspace);
57
60
62 API::MatrixWorkspace_sptr diffractionFocusRaggedRebinInDspace(API::MatrixWorkspace_sptr ws);
63
65 API::MatrixWorkspace_sptr convertUnits(API::MatrixWorkspace_sptr matrixws, const std::string &target);
66
69
71 API::MatrixWorkspace_sptr editInstrument(API::MatrixWorkspace_sptr ws, const std::vector<double> &polars,
72 const std::vector<specnum_t> &specids, const std::vector<double> &l2s,
73 const std::vector<double> &phis);
74 void convertOffsetsToCal(DataObjects::OffsetsWorkspace_sptr &offsetsWS);
75 double getVecPropertyFromPmOrSelf(const std::string &name, std::vector<double> &avec);
76
82 double m_l1{0.0};
83 std::vector<int32_t> specids;
84 std::vector<double> l2s;
85 std::vector<double> tths;
86 std::vector<double> phis;
87 std::string m_instName;
88 std::vector<double> m_params;
89 int m_resampleX{0};
90 std::vector<double> m_dmins;
91 std::vector<double> m_dmaxs;
92 std::vector<double> m_delta_ragged;
93 std::vector<double> m_resonanceLower;
94 std::vector<double> m_resonanceUpper;
95 bool binInDspace{false};
96 double xmin{0.0};
97 double xmax{0.0};
98 double minwl{0.0};
99 double maxwl{0.0};
100 double tmin{0.0};
101 double tmax{0.0};
102 bool m_preserveEvents{false};
103 void compressEventsOutputWS(const double compressEventsTolerance, const double wallClockTolerance);
104 bool shouldCompressUnfocused(const double compressTolerance, const double tofmin, const double tofmax,
105 const bool hasWallClockTolerance);
106
107 std::unique_ptr<API::Progress> m_progress = nullptr;
108};
109
110} // namespace WorkflowAlgorithms
111} // namespace Mantid
std::string name
Definition Run.cpp:60
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.