-
Notifications
You must be signed in to change notification settings - Fork 122
/
PolarizationAngleCorrectionMD.h
67 lines (53 loc) · 1.95 KB
/
PolarizationAngleCorrectionMD.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2011 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/IMDEventWorkspace_fwd.h"
#include "MantidDataObjects/MDEventWorkspace.h"
#include "MantidKernel/Matrix.h"
#include "MantidMDAlgorithms/DllConfig.h"
namespace Mantid {
namespace MDAlgorithms {
/** PolarizationAngleCorrection : Perform polarization angle correction to an MDEventWorkspace
@date 2011-11-08
*/
class MANTID_MDALGORITHMS_DLL PolarizationAngleCorrectionMD final : public API::Algorithm {
public:
PolarizationAngleCorrectionMD()
: mIsQSample(false), mQxIndex(4), mQzIndex(4), mPolarizationAngle(0.), mPrecision(1.) {}
const std::string name() const override;
int version() const override;
const std::string category() const override;
const std::string summary() const override;
private:
/// Initialize the proeprties
void init() override;
/// Run the algorithm
void exec() override;
/// Validate inputs
std::map<std::string, std::string> validateInputs() override;
/// Apply polarization angle correction to each MDEvent
template <typename MDE, size_t nd>
void applyPolarizationAngleCorrection(typename Mantid::DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
/// Check input workspace dimension
std::string checkInputMDDimension();
/// Get Ei
std::string checkEi(const API::IMDEventWorkspace_sptr &mdws);
/// coordinate system
bool mIsQSample;
/// Map
std::map<uint16_t, Mantid::Kernel::Matrix<double>> mRotationMatrixMap;
/// Qx and Qz indexes
size_t mQxIndex;
size_t mQzIndex;
/// Polarization angle
double mPolarizationAngle;
/// Precision
double mPrecision;
};
} // namespace MDAlgorithms
} // namespace Mantid