Skip to content
Snippets Groups Projects
Commit efb15ecc authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Clang format. Re #18823.

parent 292a9fe4
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,8 @@ namespace DataHandling { ...@@ -30,7 +30,8 @@ namespace DataHandling {
File change history is stored at: <https://github.com/mantidproject/mantid> File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org> Code Documentation is available at: <http://doxygen.mantidproject.org>
*/ */
class DLLExport CreatePolarizationEfficiencies : public CreatePolarizationEfficienciesBase { class DLLExport CreatePolarizationEfficiencies
: public CreatePolarizationEfficienciesBase {
public: public:
const std::string name() const override; const std::string name() const override;
int version() const override; int version() const override;
......
...@@ -61,7 +61,8 @@ private: ...@@ -61,7 +61,8 @@ private:
void exec() override; void exec() override;
/// Create the output workspace with efficiencies /// Create the output workspace with efficiencies
/// @param labels :: Names of the efficiencies to create /// @param labels :: Names of the efficiencies to create
virtual API::MatrixWorkspace_sptr createEfficiencies(std::vector<std::string> const &labels) = 0; virtual API::MatrixWorkspace_sptr
createEfficiencies(std::vector<std::string> const &labels) = 0;
}; };
} // namespace DataHandling } // namespace DataHandling
......
...@@ -49,7 +49,8 @@ const std::string CreatePolarizationEfficiencies::summary() const { ...@@ -49,7 +49,8 @@ const std::string CreatePolarizationEfficiencies::summary() const {
} }
const std::vector<std::string> CreatePolarizationEfficiencies::seeAlso() const { const std::vector<std::string> CreatePolarizationEfficiencies::seeAlso() const {
return {"JoinISISPolarizationEfficiencies", "LoadISISPolarizationEfficiencies", "PolarizationEfficiencyCor"}; return {"JoinISISPolarizationEfficiencies",
"LoadISISPolarizationEfficiencies", "PolarizationEfficiencyCor"};
} }
void CreatePolarizationEfficiencies::init() { void CreatePolarizationEfficiencies::init() {
......
...@@ -40,13 +40,12 @@ void CreatePolarizationEfficienciesBase::initOutputWorkspace() { ...@@ -40,13 +40,12 @@ void CreatePolarizationEfficienciesBase::initOutputWorkspace() {
} }
void CreatePolarizationEfficienciesBase::exec() { void CreatePolarizationEfficienciesBase::exec() {
auto const labelsFredrikze = auto const labelsFredrikze = getNonDefaultProperties({Pp, Ap, Rho, Alpha});
getNonDefaultProperties({Pp, Ap, Rho, Alpha}); auto const labelsWildes = getNonDefaultProperties({P1, P2, F1, F2});
auto const labelsWildes =
getNonDefaultProperties({P1, P2, F1, F2});
if (labelsFredrikze.empty() && labelsWildes.empty()) { if (labelsFredrikze.empty() && labelsWildes.empty()) {
throw std::invalid_argument("At least one of the efficiencies must be set."); throw std::invalid_argument(
"At least one of the efficiencies must be set.");
} }
if (!labelsFredrikze.empty() && !labelsWildes.empty()) { if (!labelsFredrikze.empty() && !labelsWildes.empty()) {
......
...@@ -39,11 +39,12 @@ const std::string JoinISISPolarizationEfficiencies::summary() const { ...@@ -39,11 +39,12 @@ const std::string JoinISISPolarizationEfficiencies::summary() const {
"PolarizationEfficiencyCor."; "PolarizationEfficiencyCor.";
} }
const std::vector<std::string> JoinISISPolarizationEfficiencies::seeAlso() const { const std::vector<std::string>
return {"CreatePolarizationEfficiencies", "LoadISISPolarizationEfficiencies", "PolarizationEfficiencyCor"}; JoinISISPolarizationEfficiencies::seeAlso() const {
return {"CreatePolarizationEfficiencies", "LoadISISPolarizationEfficiencies",
"PolarizationEfficiencyCor"};
} }
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
/** Initialize the algorithm's properties. /** Initialize the algorithm's properties.
*/ */
...@@ -51,50 +52,42 @@ void JoinISISPolarizationEfficiencies::init() { ...@@ -51,50 +52,42 @@ void JoinISISPolarizationEfficiencies::init() {
declareProperty( declareProperty(
Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>( Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>(
Pp, "", Kernel::Direction::Input, Pp, "", Kernel::Direction::Input, PropertyMode::Optional),
PropertyMode::Optional),
"A matrix workspaces containing the Pp polarization efficiency."); "A matrix workspaces containing the Pp polarization efficiency.");
declareProperty( declareProperty(
Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>( Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>(
Ap, "", Kernel::Direction::Input, Ap, "", Kernel::Direction::Input, PropertyMode::Optional),
PropertyMode::Optional),
"A matrix workspaces containing the Ap polarization efficiency."); "A matrix workspaces containing the Ap polarization efficiency.");
declareProperty( declareProperty(
Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>( Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>(
Rho, "", Kernel::Direction::Input, Rho, "", Kernel::Direction::Input, PropertyMode::Optional),
PropertyMode::Optional),
"A matrix workspaces containing the Rho polarization efficiency."); "A matrix workspaces containing the Rho polarization efficiency.");
declareProperty( declareProperty(
Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>( Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>(
Alpha, "", Kernel::Direction::Input, Alpha, "", Kernel::Direction::Input, PropertyMode::Optional),
PropertyMode::Optional),
"A matrix workspaces containing the Alpha polarization efficiency."); "A matrix workspaces containing the Alpha polarization efficiency.");
declareProperty( declareProperty(
Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>( Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>(
P1, "", Kernel::Direction::Input, P1, "", Kernel::Direction::Input, PropertyMode::Optional),
PropertyMode::Optional),
"A matrix workspaces containing the P1 polarization efficiency."); "A matrix workspaces containing the P1 polarization efficiency.");
declareProperty( declareProperty(
Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>( Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>(
P2, "", Kernel::Direction::Input, P2, "", Kernel::Direction::Input, PropertyMode::Optional),
PropertyMode::Optional),
"A matrix workspaces containing the P2 polarization efficiency."); "A matrix workspaces containing the P2 polarization efficiency.");
declareProperty( declareProperty(
Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>( Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>(
F1, "", Kernel::Direction::Input, F1, "", Kernel::Direction::Input, PropertyMode::Optional),
PropertyMode::Optional),
"A matrix workspaces containing the F1 polarization efficiency."); "A matrix workspaces containing the F1 polarization efficiency.");
declareProperty( declareProperty(
Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>( Kernel::make_unique<WorkspaceProperty<MatrixWorkspace>>(
F2, "", Kernel::Direction::Input, F2, "", Kernel::Direction::Input, PropertyMode::Optional),
PropertyMode::Optional),
"A matrix workspaces containing the F2 polarization efficiency."); "A matrix workspaces containing the F2 polarization efficiency.");
initOutputWorkspace(); initOutputWorkspace();
...@@ -128,7 +121,8 @@ MatrixWorkspace_sptr JoinISISPolarizationEfficiencies::createEfficiencies( ...@@ -128,7 +121,8 @@ MatrixWorkspace_sptr JoinISISPolarizationEfficiencies::createEfficiencies(
auto interpolatedWorkspaces = interpolateWorkspaces(workspaces); auto interpolatedWorkspaces = interpolateWorkspaces(workspaces);
auto const &inWS = interpolatedWorkspaces.front(); auto const &inWS = interpolatedWorkspaces.front();
MatrixWorkspace_sptr outWS = DataObjects::create<Workspace2D>(*inWS, labels.size(), inWS->histogram(0)); MatrixWorkspace_sptr outWS = DataObjects::create<Workspace2D>(
*inWS, labels.size(), inWS->histogram(0));
auto axis1 = new TextAxis(labels.size()); auto axis1 = new TextAxis(labels.size());
outWS->replaceAxis(1, axis1); outWS->replaceAxis(1, axis1);
outWS->getAxis(0)->setUnit("Wavelength"); outWS->getAxis(0)->setUnit("Wavelength");
......
...@@ -35,8 +35,10 @@ const std::string LoadISISPolarizationEfficiencies::summary() const { ...@@ -35,8 +35,10 @@ const std::string LoadISISPolarizationEfficiencies::summary() const {
"one factor per file."; "one factor per file.";
} }
const std::vector<std::string> LoadISISPolarizationEfficiencies::seeAlso() const { const std::vector<std::string>
return {"CreatePolarizationEfficiencies", "JoinISISPolarizationEfficiencies", "PolarizationEfficiencyCor"}; LoadISISPolarizationEfficiencies::seeAlso() const {
return {"CreatePolarizationEfficiencies", "JoinISISPolarizationEfficiencies",
"PolarizationEfficiencyCor"};
} }
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment