Mantid
Loading...
Searching...
No Matches
PolarizationEfficienciesWildes.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2024 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
12#include "MantidAlgorithms/DllConfig.h"
13#include <unordered_map>
14
15namespace Mantid::Algorithms {
16
17using namespace API;
18
19class MANTID_ALGORITHMS_DLL PolarizationEfficienciesWildes : public API::Algorithm {
20public:
22 std::string const name() const override { return "PolarizationEfficienciesWildes"; }
23
25 std::string const summary() const override;
26
28 std::string const category() const override { return "Reflectometry\\PolarizationCorrections"; }
29
31 const std::vector<std::string> seeAlso() const override { return {"PolarizationCorrectionWildes"}; }
32
34 int version() const override { return 1; }
35
36private:
38 void init() override;
39
41 void exec() override;
42
44 std::map<std::string, std::string> validateInputs() override;
45
47 void calculateFlipperEfficienciesAndPhi();
48
50 MatrixWorkspace_sptr calculateTPMO();
51
53 void calculatePolarizerAndAnalyserEfficiencies(const bool solveForP, const bool solveForA);
54
56 void setOutputs();
57
59 void resetMemberVariables();
60
63 void resetPropertyValue(const std::string &propertyName);
64
66 void populateSpinStateWorkspaces(const WorkspaceGroup_sptr &wsGrp, const std::string &keyPrefix = "");
67
69 void mapSpinStateWorkspaces();
70
71 // Convenience struct for handling of flipper workspaces
78
80 FlipperWorkspaces getFlipperWorkspaces(const bool mag = false);
81
82 MatrixWorkspace_sptr m_wsFp = nullptr;
83 MatrixWorkspace_sptr m_wsFa = nullptr;
84 MatrixWorkspace_sptr m_wsPhi = nullptr;
85 MatrixWorkspace_sptr m_wsP = nullptr;
86 MatrixWorkspace_sptr m_wsA = nullptr;
87 std::unordered_map<std::string, MatrixWorkspace_sptr> m_spinStateWorkspaces;
88 bool m_magWsProvided = false;
89};
90} // namespace Mantid::Algorithms
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
std::string const category() const override
The category of the algorithm.
const std::vector< std::string > seeAlso() const override
Returns related algorithms.
int version() const override
The version number of the algorithm.
std::unordered_map< std::string, MatrixWorkspace_sptr > m_spinStateWorkspaces
std::string const name() const override
The string identifier for the algorithm.
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class