Mantid
Loading...
Searching...
No Matches
IEventList.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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#include "MantidAPI/DllConfig.h"
12#include <functional>
13
14namespace Mantid {
15namespace API {
16
19
26class MANTID_API_DLL IEventList : public ISpectrum {
27public:
30
32 IEventList(specnum_t specNo) : ISpectrum(specNo) {}
33
37 virtual void switchTo(Mantid::API::EventType newType) = 0;
39 virtual void clear(const bool removeDetIDs) = 0;
41 virtual void reserve(size_t num) = 0;
43 virtual bool isSortedByTof() const = 0;
45 virtual std::size_t getNumberEvents() const = 0;
47 size_t getMemorySize() const override = 0;
49 virtual void generateHistogram(const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError = false) const = 0;
53 bool skipError = false) const = 0;
56 virtual void generateHistogramTimeAtSample(const MantidVec &X, MantidVec &Y, MantidVec &E, const double &tofFactor,
57 const double &tofOffset, bool skipError = false) const = 0;
59 virtual double integrate(const double minX, const double maxX, const bool entireRange) const = 0;
61 virtual void convertTof(std::function<double(double)> func, const int sorting = 0) = 0;
63 virtual void convertTof(const double factor, const double offset = 0.) = 0;
65 virtual void scaleTof(const double factor) = 0;
67 virtual void addTof(const double offset) = 0;
69 virtual void addPulsetime(const double seconds) = 0;
71 virtual void addPulsetimes(const std::vector<double> &seconds) = 0;
73 virtual void maskTof(const double tofMin, const double tofMax) = 0;
75 virtual void maskCondition(const std::vector<bool> &mask) = 0;
77 virtual std::vector<double> getTofs() const = 0;
79 virtual void getTofs(std::vector<double> &tofs) const = 0;
81 virtual std::vector<double> getWeights() const = 0;
83 virtual void getWeights(std::vector<double> &weights) const = 0;
85 virtual std::vector<double> getWeightErrors() const = 0;
87 virtual void getWeightErrors(std::vector<double> &weightErrors) const = 0;
89 virtual std::vector<Mantid::Types::Core::DateAndTime> getPulseTimes() const = 0;
91 virtual double getTofMin() const = 0;
93 virtual double getTofMax() const = 0;
95 virtual Mantid::Types::Core::DateAndTime getPulseTimeMin() const = 0;
97 virtual Mantid::Types::Core::DateAndTime getPulseTimeMax() const = 0;
99 virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMax(const double &tofFactor,
100 const double &tofOffset) const = 0;
102 virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMin(const double &tofFactor,
103 const double &tofOffset) const = 0;
105 virtual void setTofs(const MantidVec &tofs) = 0;
107 virtual void multiply(const double value, const double error = 0.0) = 0;
109 virtual void divide(const double value, const double error = 0.0) = 0;
111 virtual void multiply(const MantidVec &X, const MantidVec &Y, const MantidVec &E) = 0;
113 virtual void divide(const MantidVec &X, const MantidVec &Y, const MantidVec &E) = 0;
114};
115
116} // namespace API
117} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
double error
Definition: IndexPeaks.cpp:133
IEventList : Interface to Mantid::DataObjects::EventList class, used to expose to PythonAPI.
Definition: IEventList.h:26
virtual void addPulsetime(const double seconds)=0
Add a value to the pulse time values.
virtual void addTof(const double offset)=0
Add a value to the TOF values.
virtual Mantid::API::EventType getEventType() const =0
Return the current event type for the list.
virtual Mantid::Types::Core::DateAndTime getPulseTimeMax() const =0
Get the maximum pulse time from the list.
virtual void convertTof(const double factor, const double offset=0.)=0
Convert the TOF values.
virtual std::size_t getNumberEvents() const =0
Get the number of events from the list.
virtual void generateHistogramTimeAtSample(const MantidVec &X, MantidVec &Y, MantidVec &E, const double &tofFactor, const double &tofOffset, bool skipError=false) const =0
Get copy of counts and errors rebinning using the given X values w.r.t absolute time at the sample.
virtual Mantid::Types::Core::DateAndTime getPulseTimeMin() const =0
Get the minimum pulse time from the list.
virtual void maskCondition(const std::vector< bool > &mask)=0
Mask the events by the condition vector.
virtual void getTofs(std::vector< double > &tofs) const =0
Return the list of TOF values.
virtual void scaleTof(const double factor)=0
Scale the TOF values by a constant.
virtual std::vector< double > getWeights() const =0
Return the list of event weight values.
virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMin(const double &tofFactor, const double &tofOffset) const =0
Get the minimum time at sample.
virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMax(const double &tofFactor, const double &tofOffset) const =0
Get the maximum time at sample.
virtual double integrate(const double minX, const double maxX, const bool entireRange) const =0
Integrate the event list.
virtual std::vector< Mantid::Types::Core::DateAndTime > getPulseTimes() const =0
Return the list of pulse time values.
virtual void divide(const MantidVec &X, const MantidVec &Y, const MantidVec &E)=0
Divide event list by a histogram.
virtual void maskTof(const double tofMin, const double tofMax)=0
Mask a given TOF range.
IEventList()
Empty constructor.
Definition: IEventList.h:29
virtual void multiply(const double value, const double error=0.0)=0
Multiply event list by a constant with error.
virtual bool isSortedByTof() const =0
IS the list sorted by TOF?
virtual void getWeights(std::vector< double > &weights) const =0
Return the list of event weight values.
virtual void convertTof(std::function< double(double)> func, const int sorting=0)=0
Convert the TOF values.
virtual void divide(const double value, const double error=0.0)=0
Divide event list by a constant with error.
virtual void multiply(const MantidVec &X, const MantidVec &Y, const MantidVec &E)=0
Multiply event list by a histogram.
virtual void clear(const bool removeDetIDs)=0
Clear the event list.
virtual std::vector< double > getTofs() const =0
Return the list of TOF values.
virtual void switchTo(Mantid::API::EventType newType)=0
Switch to a new event type within the list.
virtual void getWeightErrors(std::vector< double > &weightErrors) const =0
Return the list of event weight error values.
virtual void addPulsetimes(const std::vector< double > &seconds)=0
Add a separate value to each of the pulse time values.
virtual void setTofs(const MantidVec &tofs)=0
Set the TOFs from the given list.
virtual double getTofMin() const =0
Get the minimum TOF from the list.
virtual void generateHistogramPulseTime(const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const =0
Get copy of counts and errors rebinned using the given X values w.r.t pulse time.
virtual double getTofMax() const =0
Get the maximum TOF from the list.
size_t getMemorySize() const override=0
Get memory size of event list.
virtual void generateHistogram(const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const =0
Get copy of counts and errors, rebinned using on the given X values.
IEventList(specnum_t specNo)
Constructor.
Definition: IEventList.h:32
virtual std::vector< double > getWeightErrors() const =0
Return the list of event weight error values.
virtual void reserve(size_t num)=0
Reserve a fixed size for the list.
A "spectrum" is an object that holds the data for a particular spectrum, in particular:
Definition: ISpectrum.h:39
EventType
What kind of event list is being stored.
Definition: IEventList.h:18
@ WEIGHTED_NOTIME
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
int32_t specnum_t
Typedef for a spectrum Number.
Definition: IDTypes.h:16