Mantid
Loading...
Searching...
No Matches
ConvertCWSDMDtoHKL.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 "MantidKernel/V3D.h"
15#include "MantidMDAlgorithms/DllConfig.h"
16
17namespace Mantid {
18namespace MDAlgorithms {
19
22class MANTID_MDALGORITHMS_DLL ConvertCWSDMDtoHKL final : public API::Algorithm {
23public:
25 const std::string name() const override { return "ConvertCWSDMDtoHKL"; }
26
28 const std::string summary() const override {
29 return "Convert constant wavelength single crystal diffractomer's data"
30 "in MDEventWorkspace and in unit of Q-sample to the HKL space "
31 "by UB matrix.";
32 }
33
35 int version() const override { return (1); }
36
38 const std::string category() const override { return "Diffraction\\ConstantWavelength"; }
39
40private:
42 void init() override;
43
45 void exec() override;
46
47 void exportEvents(const API::IMDEventWorkspace_sptr &mdws, std::vector<Kernel::V3D> &vec_event_qsample,
48 std::vector<signal_t> &vec_event_signal, std::vector<detid_t> &vec_event_det);
49
50 void convertFromQSampleToHKL(const std::vector<Kernel::V3D> &q_vectors, std::vector<Kernel::V3D> &miller_indices);
51
52 API::IMDEventWorkspace_sptr createHKLMDWorkspace(const std::vector<Kernel::V3D> &vec_hkl,
53 const std::vector<signal_t> &vec_signal,
54 const std::vector<detid_t> &vec_detid);
55
56 void addMDEvents(std::vector<std::vector<coord_t>> &vec_q_sample, std::vector<float> &vec_signal);
57
58 void saveMDToFile(const std::vector<std::vector<coord_t>> &vecEventQsample, const std::vector<float> &vecEventSignal);
59
60 void saveEventsToFile(const std::string &filename, std::vector<Kernel::V3D> &vecEventPos,
61 const std::vector<signal_t> &vecEventSignal, const std::vector<detid_t> &vecEventDetid);
62
63 void getUBMatrix();
64
65 void getRange(const std::vector<Kernel::V3D> &vec_hkl, std::vector<double> &extentMins,
66 std::vector<double> &extentMaxs);
67
69
71};
72
73} // namespace MDAlgorithms
74} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Numerical Matrix class.
Definition: Matrix.h:42
ConvertCWSDMDtoHKL : TODO: DESCRIPTION.
const std::string name() const override
Algorithm's name.
const std::string summary() const override
Summary of algorithms purpose.
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version.
API::IMDEventWorkspace_sptr m_outputWS
void addMDEvents(std::vector< std::vector< coord_t > > &vec_q_sample, std::vector< float > &vec_signal)
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
Helper class which provides the Collimation Length for SANS instruments.