Mantid
Loading...
Searching...
No Matches
ConvertCWSDExpToMomentum.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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
13#include "MantidKernel/Matrix.h"
14#include "MantidMDAlgorithms/DllConfig.h"
15
16namespace Mantid {
17namespace MDAlgorithms {
18
21class MANTID_MDALGORITHMS_DLL ConvertCWSDExpToMomentum final : public API::Algorithm {
22public:
24
26 const std::string name() const override { return "ConvertCWSDExpToMomentum"; }
27
29 const std::string summary() const override { return "Load and convert a set of files in an HB3A experiment."; }
30
32 int version() const override { return (1); }
33
35 const std::string category() const override { return "Diffraction\\ConstantWavelength;DataHandling\\Text"; }
36
37private:
38 void init() override;
39 void exec() override;
40
41 void addMDEvents(bool usevirtual);
42
43 void convertSpiceMatrixToMomentumMDEvents(const API::MatrixWorkspace_sptr &dataws, bool usevirtual,
44 const detid_t &startdetid, const int scannumber, const int runnumber,
45 double measuretime, int monitor_counts);
46
48 Kernel::V3D convertToQSample(const Kernel::V3D &samplePos, const Kernel::V3D &ki, const Kernel::V3D &detPos,
49 const double &momentum, std::vector<Mantid::coord_t> &qSample,
50 const Kernel::DblMatrix &rotationMatrix);
51
52 API::IMDEventWorkspace_sptr createExperimentMDWorkspace();
53
54 bool getInputs(bool virtualinstrument, std::string &errmsg);
55
56 API::MatrixWorkspace_sptr loadSpiceData(const std::string &filename, bool &loaded, std::string &errmsg);
57
58 void parseDetectorTable(std::vector<Kernel::V3D> &vec_detpos, std::vector<detid_t> &vec_detid);
59
60 void setupTransferMatrix(const API::MatrixWorkspace_sptr &dataws, Kernel::DblMatrix &rotationMatrix);
61
62 void createVirtualInstrument();
63
64 void updateQRange(const std::vector<Mantid::coord_t> &vec_q);
65
67 void removeBackground(const API::MatrixWorkspace_sptr &dataws);
68
73
79
82
83 size_t m_iColScan;
84 size_t m_iColPt;
88 size_t m_iTime;
89
90 std::vector<double> m_extentMins;
91 std::vector<double> m_extentMaxs;
92 std::vector<size_t> m_numBins;
93
94 std::vector<coord_t> m_minQVec;
95 std::vector<coord_t> m_maxQVec;
97
99 std::string m_dataDir;
105};
106
107} // namespace MDAlgorithms
108} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Class for 3D vectors.
Definition: V3D.h:34
ConvertCWSDExpToMomentum : TODO: DESCRIPTION.
const std::string summary() const override
Summary of algorithms purpose.
const std::string name() const override
Algorithm's name.
const std::string category() const override
Algorithm's category for identification.
double m_detSampleDistanceShift
Shifts in detector position set from user (calibration): all in the unit as meter.
int version() const override
Algorithm's version.
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
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
std::shared_ptr< Instrument > Instrument_sptr
Shared pointer to an instrument object.
Helper class which provides the Collimation Length for SANS instruments.