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
9#include "MantidAPI/DllConfig.h"
14
15namespace Mantid {
16
17namespace API {
18
24class MANTID_API_DLL IEventWorkspace : public MatrixWorkspace {
25public:
29 IEventWorkspace_uptr clone() const { return IEventWorkspace_uptr(doClone()); }
31 IEventWorkspace_uptr cloneEmpty() const { return IEventWorkspace_uptr(doCloneEmpty()); }
32
33 IEventList &getSpectrum(const size_t index) override = 0;
34 const IEventList &getSpectrum(const size_t index) const override = 0;
35
37 const std::string id() const override { return "IEventWorkspace"; }
38 virtual std::size_t getNumberEvents() const = 0;
39 virtual double getTofMin() const = 0;
40 virtual double getTofMax() const = 0;
41 virtual Mantid::Types::Core::DateAndTime getPulseTimeMax() const = 0;
42 virtual Mantid::Types::Core::DateAndTime getPulseTimeMin() const = 0;
43 virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMax(double tofOffset = 0) const = 0;
44 virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMin(double tofOffset = 0) const = 0;
45 virtual EventType getEventType() const = 0;
46 void generateHistogram(const std::size_t index, std::span<double const> X, MantidVec &Y, MantidVec &E,
47 bool skipError = false) const override = 0;
48
49 virtual void setAllX(const HistogramData::BinEdges &x) = 0;
50 virtual void resetAllXToSingleBin() = 0;
51
52 virtual void clearMRU() const = 0;
53
54protected:
56 IEventWorkspace(const IEventWorkspace &) = default;
57
58 const std::string toString() const override;
59 IEventList &getSpectrumWithoutInvalidation(const size_t index) override = 0;
60
61private:
62 IEventWorkspace *doClone() const override = 0;
63 IEventWorkspace *doCloneEmpty() const override = 0;
64};
65} // namespace API
66} // namespace Mantid
67
68// Instantiated and exported by API/src/PropertyWithValue.cpp
69MANTID_API_EXTERN_TEMPLATE(Mantid::Kernel::PropertyWithValue<std::shared_ptr<Mantid::API::IEventWorkspace>>);
MANTID_API_EXTERN_TEMPLATE(Mantid::Kernel::PropertyWithValue< std::shared_ptr< Mantid::API::IEventWorkspace > >)
std::map< DeltaEMode::Type, std::string > index
IEventList : Interface to Mantid::DataObjects::EventList class, used to expose to PythonAPI.
Definition IEventList.h:27
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.
virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMax(double tofOffset=0) const =0
IEventList & getSpectrumWithoutInvalidation(const size_t index) override=0
void generateHistogram(const std::size_t index, std::span< double const > X, MantidVec &Y, MantidVec &E, bool skipError=false) const override=0
Generate the histogram or rebin the existing histogram.
virtual std::size_t getNumberEvents() const =0
IEventWorkspace_uptr cloneEmpty() const
Returns a default-initialized clone of the workspace.
Base MatrixWorkspace Abstract Class.
The concrete, templated class for properties.
std::unique_ptr< IEventWorkspace > IEventWorkspace_uptr
unique pointer to Mantid::API::IEventWorkspace
EventType
What kind of event list is being stored.
Definition IEventList.h:19
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