Mantid
Loading...
Searching...
No Matches
CalculateEfficiency2.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
15#include "MantidAlgorithms/DllConfig.h"
16
17namespace {
18struct SummedResults {
19 double sum{0.0};
20 double error{0.0};
21 size_t nPixels{0};
22};
23} // namespace
24
25namespace Mantid {
26namespace Algorithms {
60class MANTID_ALGORITHMS_DLL CalculateEfficiency2 final : public API::Algorithm {
61public:
63 const std::string name() const override { return "CalculateEfficiency"; }
65 const std::string summary() const override { return "Calculates the detector efficiency for a SANS instrument."; }
66
68 int version() const override { return (2); }
70 const std::string category() const override { return "SANS;CorrectionFunctions\\EfficiencyCorrections"; }
71
72private:
73 // Overridden Algorithm methods
74 void init() override;
75 std::map<std::string, std::string> validateInputs() override;
76 void exec() override;
77 bool processGroups() override;
78
79 API::MatrixWorkspace_sptr calculateEfficiency(const API::MatrixWorkspace_sptr &, double startProgress = 0.0,
80 double stepProgress = 1.0);
81
83 SummedResults sumUnmaskedAndDeadPixels(const API::MatrixWorkspace &workspace);
84
85 void averageAndNormalizePixels(API::MatrixWorkspace &workspace, const SummedResults &results);
86
88 void validateGroupInput();
89
91 double m_minThreshold{0.};
93 double m_maxThreshold{2.};
94};
95
96} // namespace Algorithms
97} // namespace Mantid
double error
Definition: IndexPeaks.cpp:133
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Base MatrixWorkspace Abstract Class.
Class to hold a set of workspaces.
Compute relative detector pixel efficiency from flood data as part of SANS reduction.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
int version() const override
Algorithm's version for identification overriding a virtual method.
const std::string summary() const override
Summary of algorithms purpose.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.