Mantid
Loading...
Searching...
No Matches
Integration.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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"
13#include "MantidAPI/ISpectrum.h"
14#include "MantidAlgorithms/DllConfig.h"
15
16namespace Mantid {
17namespace Algorithms {
43class MANTID_ALGORITHMS_DLL Integration final : public API::Algorithm {
44public:
46 const std::string name() const override { return "Integration"; }
48 const std::string summary() const override {
49 return "Integration takes a 2D workspace or an EventWorkspace as input and "
50 "sums the data values. Optionally, the range summed can be "
51 "restricted in either dimension.";
52 }
53
55 int version() const override { return (1); }
56 const std::vector<std::string> seeAlso() const override { return {"IntegrateByComponent", "Rebin"}; }
58 const std::string category() const override { return "Arithmetic;Transforms\\Rebin"; }
59
60private:
61 // Overridden Algorithm methods
62 void init() override;
63 void exec() override;
64
65 API::MatrixWorkspace_sptr rangeFilterEventWorkspace(const API::MatrixWorkspace_sptr &workspace, double minRange,
66 double maxRange);
67
69 API::MatrixWorkspace_sptr getInputWorkspace();
71 API::MatrixWorkspace_sptr getOutputWorkspace(API::MatrixWorkspace_sptr inWS, const int minSpec, const int maxSpec);
72 std::map<std::string, std::string> validateInputs() override;
73 void integrateSpectrum(const API::ISpectrum &inSpec, API::ISpectrum &outSpec, const std::vector<double> *Fin,
74 std::vector<double> *Fout, double lowerLimit, double upperLimit, bool incPartBins);
75};
76
77} // namespace Algorithms
78} // namespace Mantid
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
A "spectrum" is an object that holds the data for a particular spectrum, in particular:
Definition: ISpectrum.h:39
Takes a workspace as input and sums each spectrum contained within it, storing the result as a worksp...
Definition: Integration.h:43
const std::string summary() const override
Summary of algorithms purpose.
Definition: Integration.h:48
API::MatrixWorkspace_sptr getOutputWorkspace(API::MatrixWorkspace_sptr inWS, const int minSpec, const int maxSpec)
Create the outputworkspace.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: Integration.h:58
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: Integration.h:56
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: Integration.h:55
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: Integration.h:46
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.