Mantid
Loading...
Searching...
No Matches
UnwrapMonitor.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2008 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"
11#include "MantidHistogramData/HistogramX.h"
13
14namespace Mantid {
15namespace Algorithms {
32class MANTID_ALGORITHMS_DLL UnwrapMonitor final : public API::Algorithm {
33public:
35 ~UnwrapMonitor() override = default;
37 const std::string name() const override { return "UnwrapMonitor"; }
39 const std::string summary() const override {
40 return "Takes an input workspace that contains 'raw' data, unwraps the "
41 "data "
42 "according to the reference flightpath provided and converts the "
43 "units to wavelength."
44 "The output workspace will have common bins in the maximum "
45 "theoretical wavelength range.";
46 }
48 int version() const override { return 1; }
50 const std::string category() const override { return "CorrectionFunctions\\InstrumentCorrections"; }
51
52private:
53 void init() override;
54 void exec() override;
55
56 const std::vector<int> unwrapX(std::vector<double> &newX, const int &spectrum, const double &Ld);
57 std::pair<int, int> handleFrameOverlapped(const Mantid::HistogramData::HistogramX &xdata, const double &Ld,
58 std::vector<double> &tempX);
59 void unwrapYandE(const API::MatrixWorkspace_sptr &tempWS, const int &spectrum, const std::vector<int> &rangeBounds,
60 std::vector<double> &newY, std::vector<double> &newE);
61 API::MatrixWorkspace_sptr rebin(const API::MatrixWorkspace_sptr &workspace, const double &min, const double &max,
62 const size_t &numBins);
63
67 double m_LRef;
68 double m_Tmin;
69 double m_Tmax;
70 size_t m_XSize;
72 std::unique_ptr<API::Progress> m_progress = nullptr;
73};
74
75} // namespace Algorithms
76} // namespace Mantid
IPeaksWorkspace_sptr workspace
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Takes an input Workspace2D that contains 'raw' data, unwraps the data according to the reference flig...
API::MatrixWorkspace_const_sptr m_inputWS
to wavelength
double m_LRef
The 'reference' flightpath.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
double m_Tmin
The start of the time-of-flight frame.
size_t m_XSize
The size of the X vectors in the input workspace.
double m_Tmax
The end of the time-of-flight frame.
const std::string summary() const override
Summary of algorithms purpose.
~UnwrapMonitor() override=default
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
double m_conversionConstant
The constant used in the conversion from TOF.
int version() const override
Algorithm's version for identification overriding a virtual method.
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
void MANTID_KERNEL_DLL rebin(std::span< double const > xold, std::span< double const > yold, std::span< double const > eold, std::span< double const > xnew, std::span< double > ynew, std::span< double > enew, bool distribution, bool addition=false)
The input and output ranges are taken as spans so that the size-checked histogram data types,...
Helper class which provides the Collimation Length for SANS instruments.