-
Notifications
You must be signed in to change notification settings - Fork 122
/
ApplyMuonDetectorGroupPairing.h
104 lines (86 loc) · 3.75 KB
/
ApplyMuonDetectorGroupPairing.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 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/MatrixWorkspace.h"
#include "MantidAPI/WorkspaceGroup.h"
#include "MantidMuon/DllConfig.h"
#include "MantidMuon/MuonAlgorithmHelper.h"
namespace Mantid {
namespace Muon {
/** ApplyMuonDetectorGroupPairing :
@date 2018-06-01
*/
class MANTID_MUON_DLL ApplyMuonDetectorGroupPairing : public API::Algorithm {
public:
/// (Empty) Constructor
ApplyMuonDetectorGroupPairing() : API::Algorithm() {}
/// Virtual destructor
~ApplyMuonDetectorGroupPairing() {}
/// Algorithm's name
const std::string name() const override {
return "ApplyMuonDetectorGroupPairing";
}
/// Algorithm's version
int version() const override { return (1); }
/// Algorithm's category for identification
const std::string category() const override { return "Muon\\DataHandling"; }
/// Algorithm's summary for identification
const std::string summary() const override {
return "Perform an asymmetry analysis on two groupings of muon detectors.";
}
/// See also
const std::vector<std::string> seeAlso() const override {
return {"MuonProcess", "ApplyMuonDetectorGrouping"};
}
/// Perform validation of inputs to the algorithm
std::map<std::string, std::string> validateInputs() override;
/// Get the names of the two workspaces in the ADS to pair manually.
const std::string
getGroupWorkspaceNamesManually(const std::string &groupName,
const std::string &groupWSName);
/// Get the name of the workspace to be saved.
const std::string getPairWorkspaceName(const std::string &pairName,
const std::string &groupWSName);
/// return a workspace for a pair of detector groups, specified in options.
API::MatrixWorkspace_sptr
createPairWorkspaceManually(const API::Workspace_sptr &inputWS,
const bool noRebin);
/// Store the input properties in options.
Muon::AnalysisOptions getUserInput();
/// Set MuonProcess properties (input workspace and period properties).
void
setMuonProcessPeriodProperties(IAlgorithm &alg,
const API::Workspace_sptr &inputWS,
const Muon::AnalysisOptions &options) const;
/// Set MuonProcess properties according to the given options.
void
setMuonProcessAlgorithmProperties(IAlgorithm &alg,
const Muon::AnalysisOptions &options) const;
/// Apply the asymmetry calculation to two workspaces.
API::MatrixWorkspace_sptr createPairWorkspaceFromGroupWorkspaces(
const API::MatrixWorkspace_sptr &inputWS1,
const API::MatrixWorkspace_sptr &inputWS2, const double &alpha);
/// Set grouping properties of MuonProcess
void setMuonProcessAlgorithmGroupingProperties(
IAlgorithm &alg, const Muon::AnalysisOptions &options) const;
/// Set time properties of MuonProcess according to the given options.
void setMuonProcessAlgorithmTimeProperties(
IAlgorithm &alg, const Muon::AnalysisOptions &options) const;
/// Checks that the detector IDs in grouping are in the workspace
void checkDetectorIDsInWorkspace(API::Grouping &grouping,
API::Workspace_sptr workspace);
/// Allow WorkspaceGroup property to function correctly.
bool checkGroups() override;
private:
/// Initialisation code
void init() override;
/// Execution code
void exec() override;
};
} // namespace Muon
} // namespace Mantid