Mantid
Loading...
Searching...
No Matches
ConvertSpiceDataToRealSpace.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2014 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
14#include "MantidMDAlgorithms/DllConfig.h"
15
16#include <deque>
17
18namespace Mantid {
19namespace MDAlgorithms {
20
24class MANTID_MDALGORITHMS_DLL ConvertSpiceDataToRealSpace final : public API::Algorithm {
25public:
27 const std::string name() const override { return "ConvertSpiceDataToRealSpace"; }
28
30 const std::string summary() const override { return "Load a HFIR powder diffractometer SPICE file."; }
31
33 int version() const override { return (1); }
34
36 const std::string category() const override { return "Diffraction\\ConstantWavelength;DataHandling\\Text"; }
37
39 // virtual int confidence(Kernel::FileDescriptor &descriptor) const;
40
41private:
43 using DataCollectionType = std::deque<std::string>;
44
46 void init() override;
47
49 void exec() override;
50
52 DataObjects::TableWorkspace_sptr loadSpiceData(const std::string &spicefilename);
53
55 std::vector<API::MatrixWorkspace_sptr> convertToMatrixWorkspace(const DataObjects::TableWorkspace_sptr &tablews,
56 const API::MatrixWorkspace_const_sptr &parentws,
57 Types::Core::DateAndTime runstart,
58 std::map<std::string, std::vector<double>> &logvecmap,
59 std::vector<Types::Core::DateAndTime> &vectimes);
60
62 API::IMDEventWorkspace_sptr createDataMDWorkspace(const std::vector<API::MatrixWorkspace_sptr> &vec_ws2d);
63
65 API::IMDEventWorkspace_sptr createMonitorMDWorkspace(const std::vector<API::MatrixWorkspace_sptr> &vec_ws2d,
66 const std::vector<double> &vecmonitor);
67
69 void readTableInfo(const DataObjects::TableWorkspace_const_sptr &tablews, size_t &ipt, size_t &irotangle,
70 size_t &itime, std::vector<std::pair<size_t, size_t>> &anodelist,
71 std::map<std::string, size_t> &samplenameindexmap);
72
74 void parseSampleLogs(const DataObjects::TableWorkspace_sptr &tablews, const std::map<std::string, size_t> &indexlist,
75 std::map<std::string, std::vector<double>> &logvecmap);
76
78 API::MatrixWorkspace_sptr loadRunToMatrixWS(const DataObjects::TableWorkspace_sptr &tablews, size_t irow,
79 const API::MatrixWorkspace_const_sptr &parentws,
80 Types::Core::DateAndTime runstart, size_t ipt, size_t irotangle,
81 size_t itime, const std::vector<std::pair<size_t, size_t>> &anodelist,
82 double &duration);
83
85 void addExperimentInfos(const API::IMDEventWorkspace_sptr &mdws,
86 const std::vector<API::MatrixWorkspace_sptr> &vec_ws2d);
87
89 void appendSampleLogs(const API::IMDEventWorkspace_sptr &mdws,
90 const std::map<std::string, std::vector<double>> &logvecmap,
91 const std::vector<Types::Core::DateAndTime> &vectimes);
92
94 std::map<detid_t, double> parseDetectorEfficiencyTable(const DataObjects::TableWorkspace_sptr &detefftablews);
95
97 void correctByDetectorEfficiency(std::vector<API::MatrixWorkspace_sptr> vec_ws2d,
98 const std::map<detid_t, double> &detEffMap);
99
101 std::string m_instrumentName;
102
104 size_t m_numSpec = 0;
105
107 std::vector<double> m_extentMins;
109 std::vector<double> m_extentMaxs;
111 std::vector<size_t> m_numBins;
113 size_t m_nDimensions = 3;
114};
115
116} // namespace MDAlgorithms
117} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
ConvertSpiceDataToRealSpace : Convert data from SPICE file to singals in real space contained in MDEv...
const std::string summary() const override
Summary of algorithms purpose.
DataObjects::TableWorkspace_sptr loadSpiceData(const std::string &spicefilename)
Load data by call.
std::vector< double > m_extentMaxs
x-y-z value maximum
const std::string name() const override
Algorithm's name.
std::deque< std::string > DataCollectionType
Returns a confidence value that this algorithm can load a file.
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version.
std::vector< double > m_extentMins
x-y-z-value minimum
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
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< TableWorkspace > TableWorkspace_sptr
shared pointer to Mantid::DataObjects::TableWorkspace
std::shared_ptr< const TableWorkspace > TableWorkspace_const_sptr
shared pointer to Mantid::DataObjects::TableWorkspace (const version)
Helper class which provides the Collimation Length for SANS instruments.