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; }
49 const std::vector<std::string> seeAlso() const override { return {"UnwrapMonitorsInTOF", "UnwrapSNS"}; }
51 const std::string category() const override { return "CorrectionFunctions\\InstrumentCorrections"; }
52
53private:
54 void init() override;
55 void exec() override;
56
57 const std::vector<int> unwrapX(std::vector<double> &newX, const int &spectrum, const double &Ld);
58 std::pair<int, int> handleFrameOverlapped(const Mantid::HistogramData::HistogramX &xdata, const double &Ld,
59 std::vector<double> &tempX);
60 void unwrapYandE(const API::MatrixWorkspace_sptr &tempWS, const int &spectrum, const std::vector<int> &rangeBounds,
61 std::vector<double> &newY, std::vector<double> &newE);
62 API::MatrixWorkspace_sptr rebin(const API::MatrixWorkspace_sptr &workspace, const double &min, const double &max,
63 const size_t &numBins);
64
68 double m_LRef;
69 double m_Tmin;
70 double m_Tmax;
71 size_t m_XSize;
73 std::unique_ptr<API::Progress> m_progress = nullptr;
74};
75
76} // namespace Algorithms
77} // namespace Mantid
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Takes an input Workspace2D that contains 'raw' data, unwraps the data according to the reference flig...
Definition: UnwrapMonitor.h:32
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: UnwrapMonitor.h:49
API::MatrixWorkspace_const_sptr m_inputWS
to wavelength
Definition: UnwrapMonitor.h:67
double m_LRef
The 'reference' flightpath.
Definition: UnwrapMonitor.h:68
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: UnwrapMonitor.h:51
double m_Tmin
The start of the time-of-flight frame.
Definition: UnwrapMonitor.h:69
size_t m_XSize
The size of the X vectors in the input workspace.
Definition: UnwrapMonitor.h:71
double m_Tmax
The end of the time-of-flight frame.
Definition: UnwrapMonitor.h:70
const std::string summary() const override
Summary of algorithms purpose.
Definition: UnwrapMonitor.h:39
~UnwrapMonitor() override=default
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: UnwrapMonitor.h:37
double m_conversionConstant
The constant used in the conversion from TOF.
Definition: UnwrapMonitor.h:65
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: UnwrapMonitor.h:48
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(const std::vector< double > &xold, const std::vector< double > &yold, const std::vector< double > &eold, const std::vector< double > &xnew, std::vector< double > &ynew, std::vector< double > &enew, bool distribution, bool addition=false)
Rebins data according to a new output X array.
Helper class which provides the Collimation Length for SANS instruments.