Mantid
Loading...
Searching...
No Matches
ImportMDEventWorkspace.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 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
11#include "MantidMDAlgorithms/DllConfig.h"
12#include <deque>
13
14namespace Mantid {
15namespace MDAlgorithms {
16
23class MANTID_MDALGORITHMS_DLL ImportMDEventWorkspace final : public API::Algorithm {
24public:
25 const std::string name() const override;
27 const std::string summary() const override {
28 return "Reads an ASCII file containing MDEvent data and constructs an "
29 "MDEventWorkspace.";
30 }
31
32 int version() const override;
33 const std::vector<std::string> seeAlso() const override { return {"ImportMDHistoWorkspace"}; }
34 const std::string category() const override;
35
37 static const std::string DimensionBlockFlag();
39 static const std::string MDEventBlockFlag();
41 static const std::string CommentLineStartFlag();
42
43private:
45 using DataCollectionType = std::deque<std::string>;
49 DataCollectionType::iterator m_posDimStart;
51 DataCollectionType::iterator m_posMDEventStart;
53 enum MDEventType { Lean, Full, NotSpecified };
55 bool m_IsFullDataObjects = false;
57 size_t m_nDimensions = 0;
59 size_t m_nDataObjects = 0;
61 template <typename MDE, size_t nd> void addEventsData(typename DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
63 void quickFileCheck();
65 bool fileDoesContain(const std::string &flag);
66
67 void init() override;
68 void exec() override;
69};
70
71} // namespace MDAlgorithms
72} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
std::shared_ptr< MDEventWorkspace< MDE, nd > > sptr
Typedef for a shared pointer of this kind of event workspace.
ImportMDEventWorkspace : Loads a file containing dimensionality and data for an MDEventWorkspace.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
DataCollectionType::iterator m_posDimStart
Iterator for the dimensionality start position.
std::deque< std::string > DataCollectionType
Typdef for the white-space separated file data type.
DataCollectionType::iterator m_posMDEventStart
Iterator for the mdevent data start position.
const std::string summary() const override
Summary of algorithms purpose.
DataCollectionType m_file_data
All read-in data.
Helper class which provides the Collimation Length for SANS instruments.