Mantid
Loading...
Searching...
No Matches
SaveMD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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
13namespace Mantid {
14
15namespace MDAlgorithms {
16
22class MANTID_MDALGORITHMS_DLL SaveMD final : public API::Algorithm {
23public:
25 const std::string name() const override { return "SaveMD"; };
27 const std::string summary() const override { return "Save a MDEventWorkspace or MDHistoWorkspace to a .nxs file."; }
28
30 int version() const override { return 1; };
32 const std::string category() const override { return "MDAlgorithms\\DataHandling"; }
33
34private:
36 void init() override;
38 void exec() override;
39
41 template <typename MDE, size_t nd> void doSaveEvents(typename DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
42
44 void doSaveHisto(const Mantid::DataObjects::MDHistoWorkspace_sptr &ws);
45
49 void saveAffineTransformMatrix(::NeXus::File *const file, API::CoordTransform *transform, std::string entry_name);
51 template <typename T>
52 void saveMatrix(::NeXus::File *const file, std::string name, Kernel::Matrix<T> &m, ::NeXus::NXnumtype type,
53 std::string tag = "");
54};
55
56} // namespace MDAlgorithms
57} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Unique SingleValueParameter Declaration for InputNDimensions.
std::shared_ptr< MDEventWorkspace< MDE, nd > > sptr
Typedef for a shared pointer of this kind of event workspace.
Numerical Matrix class.
Definition: Matrix.h:42
Save a MDEventWorkspace to a .nxs file.
Definition: SaveMD.h:22
void saveAffineTransformMatrix(::NeXus::File *const file, API::CoordTransform *transform, std::string entry_name)
Save a given affine matrix.
const std::string name() const override
Algorithm's name for identification.
Definition: SaveMD.h:25
int version() const override
Algorithm's version for identification.
Definition: SaveMD.h:30
const std::string category() const override
Algorithm's category for identification.
Definition: SaveMD.h:32
void saveAffineTransformMatricies(::NeXus::File *const file, API::IMDWorkspace_const_sptr ws)
Save all the affine matricies.
const std::string summary() const override
Summary of algorithms purpose.
Definition: SaveMD.h:27
void saveMatrix(::NeXus::File *const file, std::string name, Kernel::Matrix< T > &m, ::NeXus::NXnumtype type, std::string tag="")
Save a generic matrix.
std::shared_ptr< const IMDWorkspace > IMDWorkspace_const_sptr
Shared pointer to the IMDWorkspace base class (const version)
Definition: IMDWorkspace.h:148
std::shared_ptr< MDHistoWorkspace > MDHistoWorkspace_sptr
A shared pointer to a MDHistoWorkspace.
Helper class which provides the Collimation Length for SANS instruments.