Mantid
Loading...
Searching...
No Matches
SignalOverError.cpp
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 +
8
9using namespace Mantid::Kernel;
10using namespace Mantid::API;
11
12namespace Mantid::Algorithms {
13
14// Register the algorithm into the AlgorithmFactory
15DECLARE_ALGORITHM(SignalOverError)
16
17//----------------------------------------------------------------------------------------------
21 // Flag that EventWorkspaces will become histograms
22 this->useHistogram = true;
23}
24
25//----------------------------------------------------------------------------------------------
27const std::string SignalOverError::name() const { return "SignalOverError"; }
28
30int SignalOverError::version() const { return 1; }
31
33const std::string SignalOverError::category() const { return "Arithmetic\\Errors"; }
34
35//----------------------------------------------------------------------------------------------
36
37//----------------------------------------------------------------------------------------------
39void SignalOverError::performUnaryOperation(const double XIn, const double YIn, const double EIn, double &YOut,
40 double &EOut) {
41 (void)XIn; // Avoid compiler warning
42 // Signal / Error
43 YOut = YIn / EIn;
44 // Clear the error
45 EOut = 0.0;
46}
47
48} // namespace Mantid::Algorithms
#define DECLARE_ALGORITHM(classname)
Definition Algorithm.h:538
Calculate Y/E for a Workspace2D.
int version() const override
Algorithm's version for identification.
const std::string category() const override
Algorithm's category for identification.
const std::string name() const override
Algorithm's name for identification.
void performUnaryOperation(const double XIn, const double YIn, const double EIn, double &YOut, double &EOut) override
Perform the Y/E.
UnaryOperation supports the implementation of a Unary operation on an input workspace.