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 +
9
10using namespace Mantid::Kernel;
11using namespace Mantid::API;
12
13namespace Mantid::Algorithms {
14
15// Register the algorithm into the AlgorithmFactory
16DECLARE_ALGORITHM(SignalOverError)
17
18//----------------------------------------------------------------------------------------------
22 // Flag that EventWorkspaces will become histograms
23 this->useHistogram = true;
24}
25
26//----------------------------------------------------------------------------------------------
28const std::string SignalOverError::name() const { return "SignalOverError"; }
29
31int SignalOverError::version() const { return 1; }
32
34const std::string SignalOverError::category() const { return "Arithmetic\\Errors"; }
35
36//----------------------------------------------------------------------------------------------
37
38//----------------------------------------------------------------------------------------------
40void SignalOverError::performUnaryOperation(const double XIn, const double YIn, const double EIn, double &YOut,
41 double &EOut) {
42 (void)XIn; // Avoid compiler warning
43 // Signal / Error
44 YOut = YIn / EIn;
45 // Clear the error
46 EOut = 0.0;
47}
48
49} // namespace Mantid::Algorithms
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
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.