Mantid
Loading...
Searching...
No Matches
NormaliseByPeakArea.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 "MantidCurveFitting/DllConfig.h"
11#include "MantidKernel/System.h"
13
14namespace Mantid {
15
16namespace HistogramData {
17class HistogramY;
18class HistogramE;
19} // namespace HistogramData
20
21namespace CurveFitting {
22namespace Algorithms {
23
24class MANTID_CURVEFITTING_DLL NormaliseByPeakArea final : public API::Algorithm {
25public:
27
28 const std::string name() const override;
30 const std::string summary() const override {
31 return "Normalises the input data by the area of of peak defined by the "
32 "input mass value.";
33 }
34
35 const std::vector<std::string> seeAlso() const override { return {"MonitorEfficiencyCorUser", "Divide"}; }
36
37 int version() const override;
38 const std::string category() const override;
39
40private:
41 void init() override;
42 void exec() override;
43
45 void retrieveInputs();
47 void createOutputWorkspaces(const API::MatrixWorkspace_sptr &yspaceIn);
49 void setUnitsToMomentum(const API::MatrixWorkspace_sptr &workspace);
50
52 API::MatrixWorkspace_sptr convertInputToY();
54 double fitToMassPeak(const API::MatrixWorkspace_sptr &yspace, const size_t index);
56 void normaliseTOFData(const double area, const size_t index);
58 void saveToOutput(const API::MatrixWorkspace_sptr &accumWS, const Kernel::cow_ptr<HistogramData::HistogramY> &yValues,
59 const Kernel::cow_ptr<HistogramData::HistogramE> &eValues, const size_t index);
61 void symmetriseYSpace();
62
65 double m_mass;
76
78 std::unique_ptr<API::Progress> m_progress;
79};
80
81} // namespace Algorithms
82} // namespace CurveFitting
83} // namespace Mantid
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
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::string summary() const override
Summary of algorithms purpose.
API::MatrixWorkspace_sptr m_normalisedWS
Normalised output in TOF.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
API::MatrixWorkspace_sptr m_symmetrisedWS
Fitted output.
API::MatrixWorkspace_sptr m_yspaceWS
Input data converted (and possible summed) to Y space.
bool m_sumResults
Flag to indicate if results are to be summed.
std::unique_ptr< API::Progress > m_progress
Reporting.
API::MatrixWorkspace_sptr m_fittedWS
Fitted output.
Implements a copy on write data template.
Definition: cow_ptr.h:41
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.