11#include "MantidDataObjects/DllConfig.h"
13#include <boost/date_time/posix_time/posix_time.hpp>
21namespace DataObjects {
22class EventWorkspaceMRU;
35 const std::string
id()
const override {
return "EventWorkspace"; }
38 EventWorkspace(
const Parallel::StorageMode storageMode = Parallel::StorageMode::Cloned);
44 std::unique_ptr<EventWorkspace>
clone()
const {
return std::unique_ptr<EventWorkspace>(doClone()); }
47 std::unique_ptr<EventWorkspace>
cloneEmpty()
const {
return std::unique_ptr<EventWorkspace>(doCloneEmpty()); }
50 void init(
const std::size_t &,
const std::size_t &,
const std::size_t &)
override;
51 void init(
const HistogramData::Histogram &histogram)
override;
58 bool isRaggedWorkspace()
const override;
61 std::size_t size()
const override;
64 std::size_t blocksize()
const override;
66 std::size_t getNumberBins(
const std::size_t &
index)
const override;
68 std::size_t getMaxNumberBins()
const override;
71 std::size_t getNumberHistograms()
const override;
73 size_t getMemorySize()
const override;
76 invalidateCommonBinsFlag();
77 return getSpectrumWithoutInvalidation(
index);
84 double getTofMin()
const override;
86 double getTofMax()
const override;
88 Mantid::Types::Core::DateAndTime getPulseTimeMin()
const override;
89 Mantid::Types::Core::DateAndTime getPulseTimeMax()
const override;
90 void getPulseTimeMinMax(Mantid::Types::Core::DateAndTime &xmin, Mantid::Types::Core::DateAndTime &xmax)
const;
92 Mantid::Types::Core::DateAndTime getTimeAtSampleMin(
double tofOffset = 0)
const override;
94 Mantid::Types::Core::DateAndTime getTimeAtSampleMax(
double tofOffset = 0)
const override;
96 double getEventXMin()
const;
97 double getEventXMax()
const;
98 void getEventXMinMax(
double &xmin,
double &xmax)
const;
100 MantidVec &dataX(
const std::size_t)
override;
101 MantidVec &dataY(
const std::size_t)
override;
102 MantidVec &dataE(
const std::size_t)
override;
103 MantidVec &dataDx(
const std::size_t)
override;
104 const MantidVec &dataX(
const std::size_t)
const override;
105 const MantidVec &dataY(
const std::size_t)
const override;
106 const MantidVec &dataE(
const std::size_t)
const override;
107 const MantidVec &dataDx(
const std::size_t)
const override;
112 bool skipError =
false)
const override;
116 bool skipError =
false)
const;
119 void setAllX(
const HistogramData::BinEdges &x)
override;
122 void resetAllXToSingleBin()
override;
125 std::size_t getNumberEvents()
const override;
135 bool isHistogramData()
const override;
137 std::size_t MRUSize()
const;
139 void clearMRU()
const override;
147 void getIntegratedSpectra(std::vector<double> &out,
const double minX,
const double maxX,
148 const bool entireRange)
const override;
159 EventList &getSpectrumWithoutInvalidation(
const size_t index)
override;
164 std::vector<std::unique_ptr<EventList>>
data;
167 mutable std::unique_ptr<EventWorkspaceMRU>
mru;
std::map< DeltaEMode::Type, std::string > index
This class provides an interface to an EventWorkspace.
Helper class for reporting progress from algorithms.
This class is intended to fulfill the design specified in <https://github.com/mantidproject/documents...
std::vector< std::unique_ptr< EventList > > data
A vector that holds the event list for each spectrum; the key is the workspace index,...
EventList & getSpectrum(const size_t index) override
Return the underlying ISpectrum ptr at the given workspace index.
const std::string id() const override
Return the workspace typeID.
EventWorkspace & operator=(const EventWorkspace &other)=delete
EventWorkspace * doClone() const override
Virtual clone method. Not implemented to force implementation in children.
EventWorkspace * doCloneEmpty() const override
Virtual cloneEmpty method.
std::unique_ptr< EventWorkspaceMRU > mru
Container for the MRU lists of the event lists contained.
void sortAllOld(EventSortType sortType, Mantid::API::Progress *prog) const
std::unique_ptr< EventWorkspace > clone() const
Returns a clone of the workspace.
std::unique_ptr< EventWorkspace > cloneEmpty() const
Returns a default-initialized clone of the workspace.
Implements a copy on write data template.
EventType
What kind of event list is being stored.
std::shared_ptr< const EventWorkspace > EventWorkspace_const_sptr
shared pointer to a const Workspace2D
EventSortType
How the event list is sorted.
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
std::enable_if< std::is_pointer< Arg >::value, bool >::type threadSafe(Arg workspace)
Thread-safety check Checks the workspace to ensure it is suitable for multithreaded access.
Helper class which provides the Collimation Length for SANS instruments.
std::vector< double > MantidVec
typedef for the data storage used in Mantid matrix workspaces