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:
27 IEventWorkspace_uptr clone() const { return IEventWorkspace_uptr(doClone()); }
29 IEventWorkspace_uptr cloneEmpty() const { return IEventWorkspace_uptr(doCloneEmpty()); }
30
31 IEventList &getSpectrum(const size_t index) override = 0;
32 const IEventList &getSpectrum(const size_t index) const override = 0;
33
35 const std::string id() const override { return "IEventWorkspace"; }
36 virtual std::size_t getNumberEvents() const = 0;
37 virtual double getTofMin() const = 0;
38 virtual double getTofMax() const = 0;
39 virtual Mantid::Types::Core::DateAndTime getPulseTimeMax() const = 0;
40 virtual Mantid::Types::Core::DateAndTime getPulseTimeMin() const = 0;
41 virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMax(double tofOffset = 0) const = 0;
42 virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMin(double tofOffset = 0) const = 0;
43 virtual EventType getEventType() const = 0;
44 void generateHistogram(const std::size_t index, const MantidVec &X, MantidVec &Y, MantidVec &E,
45 bool skipError = false) const override = 0;
46
47 virtual void setAllX(const HistogramData::BinEdges &x) = 0;
48 virtual void resetAllXToSingleBin() = 0;
49
50 virtual void clearMRU() const = 0;
51
52protected:
54 IEventWorkspace(const IEventWorkspace &) = default;
55
56 const std::string toString() const override;
57 IEventList &getSpectrumWithoutInvalidation(const size_t index) override = 0;
58
59private:
60 IEventWorkspace *doClone() const override = 0;
61 IEventWorkspace *doCloneEmpty() const override = 0;
62};
63} // namespace API
64} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
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.
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