Mantid
Loading...
Searching...
No Matches
DetectorEfficiencyCorUser.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 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
10#include "MantidAlgorithms/DllConfig.h"
12
13// Forward declarations
14namespace mu {
15class Parser;
16} // namespace mu
17
18namespace Mantid {
19
20namespace HistogramData {
21class Histogram;
22class HistogramE;
23class HistogramY;
24class Points;
25} // namespace HistogramData
26
27namespace Algorithms {
28
37class MANTID_ALGORITHMS_DLL DetectorEfficiencyCorUser final : public API::Algorithm {
38public:
39 const std::string name() const override;
41 const std::string summary() const override {
42 return "Corrects for detector efficiency. The correction factor is "
43 "calculated using an instrument specific formula as a function "
44 "of the final neutron energy E_f=E_i-E. Note that the formula "
45 "is implemented only for a limited number of TOF instruments.";
46 }
47
48 int version() const override;
49 const std::vector<std::string> seeAlso() const override { return {"DetectorEfficiencyCor"}; }
50 const std::string category() const override;
51
52private:
53 void init() override;
54 void exec() override;
55 void retrieveProperties();
56 void correctHistogram(const size_t index, const double eff0, double &e, const mu::Parser &parser);
57
58 double evaluate(const mu::Parser &parser) const;
59
60 mu::Parser generateParser(const std::string &formula, double *e) const;
61
62 std::string retrieveFormula(const size_t workspaceIndex);
63
69 double m_Ei = 0.0;
70};
71
72} // namespace Algorithms
73} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
API::MatrixWorkspace_sptr m_outputWS
The output workspace, maybe the same as the input one.
API::MatrixWorkspace_const_sptr m_inputWS
The user selected (input) workspace.
const std::string summary() const override
Summary of algorithms purpose.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.