Mantid
Loading...
Searching...
No Matches
ConvToMDBase.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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
12#include "MantidAPI/Progress.h"
13#include "MantidKernel/Logger.h"
14
20
21namespace Mantid {
22namespace MDAlgorithms {
34class MANTID_MDALGORITHMS_DLL ConvToMDBase {
35public:
36 // constructor;
38
40 virtual size_t initialize(const MDWSDescription &WSD, std::shared_ptr<MDEventWSWrapper> inWSWrapper,
41 bool ignoreZeros);
43 virtual void runConversion(API::Progress *) = 0;
45 virtual ~ConvToMDBase() = default;
47 virtual void setDisplayNormalization(Mantid::API::IMDEventWorkspace_sptr mdWorkspace,
48 const Mantid::API::MatrixWorkspace_sptr &underlyingWorkspace);
49
53 UnitsConversionHelper &getUnitConversionHelper() { return m_UnitConversion; }
54
55protected:
56 // pointer to input matrix workspace;
58 // pointer to the class, which keeps target workspace and provides functions
59 // adding additional MD events to it.
60 std::shared_ptr<MDEventWSWrapper> m_OutWSWrapper;
61 // shared pointer to the converter, which converts WS coordinates to MD
62 // coordinates
65 size_t m_NDims;
66 // index of current run(workspace). Used for MD WS combining
68 //---> preprocessed detectors information
69 // number of valid spectra
70 uint32_t m_NSpectra;
71 std::vector<size_t> m_detIDMap;
72 std::vector<int32_t> m_detID;
73
74 //<--- End of preprocessed detectors information
75 // logger -> to provide logging, for MD dataset file operations
77 // vector to keep MD coordinates of single event
78 std::vector<coord_t> m_Coord;
79 // class responsible for converting units if necessary;
81 // the parameter, which control if algorithm should run multithreaded.
82 // On multiprocessor machine the algorithm should run and utilizes all cores
83 // (see Kernel::Threadpool),
84 // but this can be changed setting this parameter to 0 (no multithreading) or
85 // positive number specifying the requested number of threads
87 // Flag which indicates that data with 0 signal should be ignored
91
92private:
101 virtual size_t conversionChunk(size_t job_ID) = 0;
102};
103
104} // end namespace MDAlgorithms
105} // end namespace Mantid
Helper class for reporting progress from algorithms.
Definition: Progress.h:25
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition: Logger.h:52
Class describes the interface to the methods, which perform conversion from usual workspaces to MDEve...
Definition: ConvToMDBase.h:34
virtual ~ConvToMDBase()=default
virtual destructor
API::MatrixWorkspace_const_sptr m_InWS2D
Definition: ConvToMDBase.h:57
std::vector< size_t > m_detIDMap
Definition: ConvToMDBase.h:71
static Mantid::Kernel::Logger g_Log
Definition: ConvToMDBase.h:76
virtual void runConversion(API::Progress *)=0
method which starts the conversion procedure
UnitsConversionHelper & getUnitConversionHelper()
method returns unit conversion helper, used to convert input workspace units to the units,...
Definition: ConvToMDBase.h:53
std::vector< int32_t > m_detID
Definition: ConvToMDBase.h:72
Mantid::Kernel::SpecialCoordinateSystem m_coordinateSystem
Any special coordinate system used.
Definition: ConvToMDBase.h:90
std::vector< coord_t > m_Coord
Definition: ConvToMDBase.h:78
size_t m_NDims
number of target ws dimensions
Definition: ConvToMDBase.h:65
virtual size_t conversionChunk(size_t job_ID)=0
internal function which do one peace of work, which should be performed by one thread
std::shared_ptr< MDEventWSWrapper > m_OutWSWrapper
Definition: ConvToMDBase.h:60
UnitsConversionHelper m_UnitConversion
Definition: ConvToMDBase.h:80
helper class describes the properties of target MD workspace, which should be obtained as the result ...
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
SpecialCoordinateSystem
Special coordinate systems for Q3D.
std::shared_ptr< MDTransfInterface > MDTransf_sptr
Helper class which provides the Collimation Length for SANS instruments.