Mantid
Loading...
Searching...
No Matches
LoadDNSSCD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 "MantidKernel/Matrix.h"
15#include "MantidKernel/V3D.h"
16#include "MantidMDAlgorithms/DllConfig.h"
17#include <vector>
18
19namespace Mantid {
20namespace MDAlgorithms {
21
27class MANTID_MDALGORITHMS_DLL LoadDNSSCD : public API::IFileLoader<Kernel::FileDescriptor> {
28public:
29 LoadDNSSCD();
30
32 const std::string name() const override { return "LoadDNSSCD"; }
33
35 const std::string summary() const override { return "Load a list of DNS .d_dat files into a MDEventWorkspace."; }
36
38 int version() const override { return 1; }
39
41 const std::string category() const override { return "MDAlgorithms\\DataHandling"; }
42
43 const std::vector<std::string> seeAlso() const override {
44 return {"LoadDNSLegacy", "LoadWANDSCD", "ConvertWANDSCDtoQ"};
45 }
46
48 int confidence(Kernel::FileDescriptor &descriptor) const override;
49
50private:
52 void init() override;
54 void exec() override;
55
57 std::string m_columnSep;
58
60 size_t m_nDims;
61
63 double m_tof_max;
64
66 std::string m_normtype;
69
71 struct ExpData {
72 double deterota; // detector rotation angle
73 double huber; // sample rotation angle
74 double wavelength;
75 double norm; // normalizarion
76 size_t nchannels; // TOF channels number
77 double chwidth; // channel width, microseconds
78 std::vector<std::vector<double>> signal;
79 std::vector<int> detID;
80 };
81
82 std::vector<ExpData> m_data;
83
86
87 int splitIntoColumns(std::list<std::string> &columns, std::string &str);
88 void read_data(const std::string &fname, std::map<std::string, std::string> &str_metadata,
89 std::map<std::string, double> &num_metadata);
90 void fillOutputWorkspace(double wavelength);
91 void fillOutputWorkspaceRaw(double wavelength);
92 API::ITableWorkspace_sptr saveHuber();
93 void loadHuber(const API::ITableWorkspace_sptr &tws);
94 template <class T> void updateProperties(API::Run &run, std::map<std::string, T> &metadata, std::string time);
95};
96
97} // namespace MDAlgorithms
98} // namespace Mantid
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
Definition: IFileLoader.h:19
This class stores information regarding an experimental run as a series of log entries.
Definition: Run.h:38
Defines a wrapper around an open file.
LoadDNSSCD : Load a list of DNS .d_dat files into a MDEventWorkspace.
Definition: LoadDNSSCD.h:27
double m_normfactor
factor to multiply the error^2 for normalization
Definition: LoadDNSSCD.h:68
size_t m_nDims
number of workspace dimensions
Definition: LoadDNSSCD.h:60
std::string m_normtype
type of normalization;
Definition: LoadDNSSCD.h:66
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: LoadDNSSCD.h:43
std::string m_columnSep
The column separator.
Definition: LoadDNSSCD.h:57
Mantid::API::IMDEventWorkspace_sptr m_OutWS
Output IMDEventWorkspace.
Definition: LoadDNSSCD.h:85
const std::string summary() const override
Summary of algorithms purpose.
Definition: LoadDNSSCD.h:35
const std::string category() const override
Algorithm's category for identification.
Definition: LoadDNSSCD.h:41
std::vector< ExpData > m_data
Definition: LoadDNSSCD.h:82
int version() const override
Algorithm's version for identification.
Definition: LoadDNSSCD.h:38
const std::string name() const override
Algorithm's name for identification.
Definition: LoadDNSSCD.h:32
double m_tof_max
maximal TOF (for extends)
Definition: LoadDNSSCD.h:63
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
Helper class which provides the Collimation Length for SANS instruments.
structure for experimental data
Definition: LoadDNSSCD.h:71
std::vector< std::vector< double > > signal
Definition: LoadDNSSCD.h:78