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 {
30class MANTID_MDALGORITHMS_DLL ConvToMDBase {
31public:
32 // constructor;
34
36 virtual size_t initialize(const MDWSDescription &WSD, std::shared_ptr<MDEventWSWrapper> inWSWrapper,
37 bool ignoreZeros);
39 virtual void runConversion(API::Progress *) = 0;
41 virtual ~ConvToMDBase() = default;
43 virtual void setDisplayNormalization(Mantid::API::IMDEventWorkspace_sptr mdWorkspace,
44 const Mantid::API::MatrixWorkspace_sptr &underlyingWorkspace);
45
49 UnitsConversionHelper &getUnitConversionHelper() { return m_UnitConversion; }
50
51protected:
52 // pointer to input matrix workspace;
54 // pointer to the class, which keeps target workspace and provides functions
55 // adding additional MD events to it.
56 std::shared_ptr<MDEventWSWrapper> m_OutWSWrapper;
57 // shared pointer to the converter, which converts WS coordinates to MD
58 // coordinates
61 size_t m_NDims;
62 // index of current run(workspace). Used for MD WS combining
64 //---> preprocessed detectors information
65 // number of valid spectra
66 uint32_t m_NSpectra;
67 std::vector<size_t> m_detIDMap;
68 std::vector<int32_t> m_detID;
69
70 //<--- End of preprocessed detectors information
71 // logger -> to provide logging, for MD dataset file operations
73 // vector to keep MD coordinates of single event
74 std::vector<coord_t> m_Coord;
75 // class responsible for converting units if necessary;
77 // the parameter, which control if algorithm should run multithreaded.
78 // On multiprocessor machine the algorithm should run and utilizes all cores
79 // (see Kernel::Threadpool),
80 // but this can be changed setting this parameter to 0 (no multithreading) or
81 // positive number specifying the requested number of threads
83 // Flag which indicates that data with 0 signal should be ignored
87
88private:
97 virtual size_t conversionChunk(size_t job_ID) = 0;
98};
99
100} // end namespace MDAlgorithms
101} // 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:51
Class describes the interface to the methods, which perform conversion from usual workspaces to MDEve...
virtual ~ConvToMDBase()=default
virtual destructor
API::MatrixWorkspace_const_sptr m_InWS2D
std::vector< size_t > m_detIDMap
static Mantid::Kernel::Logger g_Log
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,...
std::vector< int32_t > m_detID
Mantid::Kernel::SpecialCoordinateSystem m_coordinateSystem
Any special coordinate system used.
std::vector< coord_t > m_Coord
size_t m_NDims
number of target ws dimensions
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
UnitsConversionHelper m_UnitConversion
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.