Mantid
Loading...
Searching...
No Matches
IEventWorkspace.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
13namespace Mantid {
14
15namespace API {
16
22class MANTID_API_DLL IEventWorkspace : public MatrixWorkspace {
23public:
24 IEventWorkspace(const Parallel::StorageMode storageMode = Parallel::StorageMode::Cloned)
25 : MatrixWorkspace(storageMode) {}
28 IEventWorkspace_uptr clone() const { return IEventWorkspace_uptr(doClone()); }
30 IEventWorkspace_uptr cloneEmpty() const { return IEventWorkspace_uptr(doCloneEmpty()); }
31
32 IEventList &getSpectrum(const size_t index) override = 0;
33 const IEventList &getSpectrum(const size_t index) const override = 0;
34
36 const std::string id() const override { return "IEventWorkspace"; }
37 virtual std::size_t getNumberEvents() const = 0;
38 virtual double getTofMin() const = 0;
39 virtual double getTofMax() const = 0;
40 virtual Mantid::Types::Core::DateAndTime getPulseTimeMax() const = 0;
41 virtual Mantid::Types::Core::DateAndTime getPulseTimeMin() const = 0;
42 virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMax(double tofOffset = 0) const = 0;
43 virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMin(double tofOffset = 0) const = 0;
44 virtual EventType getEventType() const = 0;
45 void generateHistogram(const std::size_t index, const MantidVec &X, MantidVec &Y, MantidVec &E,
46 bool skipError = false) const override = 0;
47
48 virtual void setAllX(const HistogramData::BinEdges &x) = 0;
49 virtual void resetAllXToSingleBin() = 0;
50
51 virtual void clearMRU() const = 0;
52
53protected:
55 IEventWorkspace(const IEventWorkspace &) = default;
56
57 const std::string toString() const override;
58 IEventList &getSpectrumWithoutInvalidation(const size_t index) override = 0;
59
60private:
61 IEventWorkspace *doClone() const override = 0;
62 IEventWorkspace *doCloneEmpty() const override = 0;
63};
64} // namespace API
65} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
IEventList : Interface to Mantid::DataObjects::EventList class, used to expose to PythonAPI.
Definition: IEventList.h:26
This class provides an interface to an EventWorkspace.
virtual void resetAllXToSingleBin()=0
virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMin(double tofOffset=0) const =0
IEventWorkspace * doClone() const override=0
Virtual clone method. Not implemented to force implementation in children.
IEventWorkspace_uptr clone() const
Returns a clone of the workspace.
virtual void setAllX(const HistogramData::BinEdges &x)=0
virtual EventType getEventType() const =0
virtual Mantid::Types::Core::DateAndTime getPulseTimeMax() const =0
IEventWorkspace * doCloneEmpty() const override=0
Virtual cloneEmpty method.
const IEventList & getSpectrum(const size_t index) const override=0
Return the underlying ISpectrum ptr (const version) at the given workspace index.
virtual double getTofMin() const =0
const std::string toString() const override
Serializes the object to a string.
virtual Mantid::Types::Core::DateAndTime getPulseTimeMin() const =0
virtual double getTofMax() const =0
IEventWorkspace & operator=(const IEventWorkspace &)=delete
IEventWorkspace(const IEventWorkspace &)=default
Protected copy constructor. May be used by childs for cloning.
virtual void clearMRU() const =0
IEventList & getSpectrum(const size_t index) override=0
Return the underlying ISpectrum ptr at the given workspace index.
IEventWorkspace(const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
const std::string id() const override
Return the workspace typeID.
void generateHistogram(const std::size_t index, const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const override=0
Generate the histogram or rebin the existing histogram.
virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMax(double tofOffset=0) const =0
IEventList & getSpectrumWithoutInvalidation(const size_t index) override=0
virtual std::size_t getNumberEvents() const =0
IEventWorkspace_uptr cloneEmpty() const
Returns a default-initialized clone of the workspace.
Base MatrixWorkspace Abstract Class.
std::unique_ptr< IEventWorkspace > IEventWorkspace_uptr
unique pointer to Mantid::API::IEventWorkspace
EventType
What kind of event list is being stored.
Definition: IEventList.h:18
Helper class which provides the Collimation Length for SANS instruments.
std::vector< double > MantidVec
typedef for the data storage used in Mantid matrix workspaces
Definition: cow_ptr.h:172