-
Notifications
You must be signed in to change notification settings - Fork 122
/
CorrectTOFAxis.h
52 lines (44 loc) · 1.78 KB
/
CorrectTOFAxis.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
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2016 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/ITableWorkspace_fwd.h"
#include "MantidAPI/MatrixWorkspace_fwd.h"
#include "MantidAlgorithms/DllConfig.h"
#include <vector>
namespace Mantid {
namespace API {
class SpectrumInfo;
}
namespace Algorithms {
/** CorrectTOFAxis : Corrects the time-of-flight axis with regards to
the incident energy and the L1+L2 distance or a reference workspace.
*/
class MANTID_ALGORITHMS_DLL CorrectTOFAxis : public API::Algorithm {
public:
const std::string name() const override;
int version() const override;
const std::vector<std::string> seeAlso() const override { return {"ConvertToConstantL2"}; }
const std::string category() const override;
const std::string summary() const override;
private:
size_t m_elasticBinIndex = EMPTY_LONG();
API::ITableWorkspace_const_sptr m_eppTable;
API::MatrixWorkspace_const_sptr m_inputWs;
API::MatrixWorkspace_const_sptr m_referenceWs;
std::vector<size_t> m_workspaceIndices;
void init() override;
std::map<std::string, std::string> validateInputs() override;
void exec() override;
void useReferenceWorkspace(const API::MatrixWorkspace_sptr &outputWs);
void correctManually(const API::MatrixWorkspace_sptr &outputWs);
double averageL2(const API::SpectrumInfo &spectrumInfo);
void averageL2AndEPP(const API::SpectrumInfo &spectrumInfo, double &l2, double &epp);
std::vector<size_t> referenceWorkspaceIndices() const;
};
} // namespace Algorithms
} // namespace Mantid