Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::DataObjects::EventWorkspace Class Reference

This class is intended to fulfill the design specified in <https://github.com/mantidproject/documents/tree/master/Design/Event WorkspaceDetailed Design Document.doc> More...

#include <EventWorkspace.h>

Inheritance diagram for Mantid::DataObjects::EventWorkspace:
Mantid::API::IEventWorkspace Mantid::API::MatrixWorkspace Mantid::API::IMDWorkspace Mantid::API::ExperimentInfo Mantid::API::Workspace Mantid::API::MDGeometry Mantid::Kernel::DataItem

Public Member Functions

std::size_t blocksize () const override
 Get the blocksize, aka the number of bins in the histogram. More...
 
void clearMRU () const override
 Clears the MRU lists. More...
 
std::unique_ptr< EventWorkspaceclone () const
 Returns a clone of the workspace. More...
 
std::unique_ptr< EventWorkspacecloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
const MantidVecdataDx (const std::size_t) const override
 Deprecated, use dx() instead. More...
 
MantidVecdataDx (const std::size_t) override
 Deprecated, use mutableDx() instead. More...
 
const MantidVecdataE (const std::size_t) const override
 Deprecated, use e() instead. More...
 
MantidVecdataE (const std::size_t) override
 Deprecated, use mutableE() instead. More...
 
const MantidVecdataX (const std::size_t) const override
 Deprecated, use x() instead. More...
 
MantidVecdataX (const std::size_t) override
 Deprecated, use mutableX() instead. More...
 
const MantidVecdataY (const std::size_t) const override
 Deprecated, use y() instead. More...
 
MantidVecdataY (const std::size_t) override
 Deprecated, use mutableY() instead. More...
 
 EventWorkspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 
void generateHistogram (const std::size_t index, const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const override
 Generate a new histogram from specified event list at the given index. More...
 
void generateHistogramPulseTime (const std::size_t index, const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const
 Generate a new histogram from specified event list at the given index. More...
 
Mantid::API::EventType getEventType () const override
 Get the EventType of the most-specialized EventList in the workspace. More...
 
double getEventXMax () const
 Get them maximum x-value for the events themselves, ignoring the histogram representation. More...
 
double getEventXMin () const
 Get them minimum x-value for the events themselves, ignoring the histogram representation. More...
 
void getEventXMinMax (double &xmin, double &xmax) const
 Get them minimum and maximum x-values for the events themselves, ignoring the histogram representation. More...
 
void getIntegratedSpectra (std::vector< double > &out, const double minX, const double maxX, const bool entireRange) const override
 Integrate all the spectra in the matrix workspace within the range given. More...
 
std::size_t getMaxNumberBins () const override
 Returns the maximum number of bins in a workspace (works on ragged data). More...
 
size_t getMemorySize () const override
 Returns the amount of memory used in bytes. More...
 
std::size_t getNumberBins (const std::size_t &index) const override
 Returns the number of bins for a given histogram index. More...
 
std::size_t getNumberEvents () const override
 The total number of events across all of the spectra. More...
 
std::size_t getNumberHistograms () const override
 Get the number of histograms, usually the same as the number of pixels or detectors. More...
 
Mantid::Types::Core::DateAndTime getPulseTimeMax () const override
 Get the maximum pulse time for events accross the entire workspace. More...
 
Mantid::Types::Core::DateAndTime getPulseTimeMin () const override
 Get the minimum pulse time for events accross the entire workspace. More...
 
void getPulseTimeMinMax (Mantid::Types::Core::DateAndTime &xmin, Mantid::Types::Core::DateAndTime &xmax) const
 Get the maximum and mimumum pulse time for events accross the entire workspace. More...
 
EventSortType getSortType () const
 
const EventListgetSpectrum (const size_t index) const override
 Return const reference to EventList at the given workspace index. More...
 
EventListgetSpectrum (const size_t index) override
 Return the underlying ISpectrum ptr at the given workspace index. More...
 
EventListgetSpectrumUnsafe (const size_t index)
 Returns a pointer to the EventList for a given spectrum in a timely manner. More...
 
Mantid::Types::Core::DateAndTime getTimeAtSampleMax (double tofOffset=0) const override
 Get the maximum time at sample for events across the entire workspace. More...
 
Mantid::Types::Core::DateAndTime getTimeAtSampleMin (double tofOffset=0) const override
 Get the minimum time at sample for events across the entire workspace. More...
 
double getTofMax () const override
 
double getTofMin () const override
 
const std::string id () const override
 Return the workspace typeID. More...
 
void init (const HistogramData::Histogram &histogram) override
 
void init (const std::size_t &, const std::size_t &, const std::size_t &) override
 Initialize the pixels. More...
 
bool isHistogramData () const override
 Returns true always - an EventWorkspace always represents histogramm-able data. More...
 
bool isRaggedWorkspace () const override
 Returns true if the workspace is ragged (has differently sized spectra). More...
 
std::size_t MRUSize () const
 Return how many entries in the Y MRU list are used. More...
 
EventWorkspaceoperator= (const EventWorkspace &other)=delete
 
Kernel::cow_ptr< HistogramData::HistogramX > refX (const std::size_t) const override
 Deprecated, use sharedX() instead. More...
 
void resetAllXToSingleBin () override
 Set all Histogram X vectors to a single bin with boundaries that fit the TOF of all events across all spectra. More...
 
void setAllX (const HistogramData::BinEdges &x) override
 Set all histogram X vectors. More...
 
std::size_t size () const override
 The total size of the workspace. More...
 
void sortAll (EventSortType sortType, Mantid::API::Progress *prog) const
 
void sortAllOld (EventSortType sortType, Mantid::API::Progress *prog) const
 
void switchEventType (const Mantid::API::EventType type)
 Switch all event lists to the given event type. More...
 
bool threadSafe () const override
 Returns true if the EventWorkspace is safe for multithreaded operations. More...
 
 ~EventWorkspace () override
 
- Public Member Functions inherited from Mantid::API::IEventWorkspace
virtual void clearMRU () const =0
 
IEventWorkspace_uptr clone () const
 Returns a clone of the workspace. More...
 
IEventWorkspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
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. More...
 
virtual EventType getEventType () const =0
 
virtual std::size_t getNumberEvents () const =0
 
virtual Mantid::Types::Core::DateAndTime getPulseTimeMax () const =0
 
virtual Mantid::Types::Core::DateAndTime getPulseTimeMin () const =0
 
const IEventListgetSpectrum (const size_t index) const override=0
 Return the underlying ISpectrum ptr (const version) at the given workspace index. More...
 
IEventListgetSpectrum (const size_t index) override=0
 Return the underlying ISpectrum ptr at the given workspace index. More...
 
virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMax (double tofOffset=0) const =0
 
virtual Mantid::Types::Core::DateAndTime getTimeAtSampleMin (double tofOffset=0) const =0
 
virtual double getTofMax () const =0
 
virtual double getTofMin () const =0
 
const std::string id () const override
 Return the workspace typeID. More...
 
 IEventWorkspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 
IEventWorkspaceoperator= (const IEventWorkspace &)=delete
 
virtual void resetAllXToSingleBin ()=0
 
virtual void setAllX (const HistogramData::BinEdges &x)=0
 
- Public Member Functions inherited from Mantid::API::MatrixWorkspace
MatrixWorkspace_uptr clone () const
 Returns a clone of the workspace. More...
 
MatrixWorkspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
const Indexing::IndexInfo & indexInfo () const
 Returns a const reference to the IndexInfo object of the workspace. More...
 
void initialize (const Indexing::IndexInfo &indexInfo, const HistogramData::Histogram &histogram)
 
void initialize (const std::size_t &NVectors, const HistogramData::Histogram &histogram)
 
void initialize (const std::size_t &NVectors, const std::size_t &XLength, const std::size_t &YLength)
 Initialize the workspace. More...
 
MatrixWorkspaceoperator= (const MatrixWorkspace &other)=delete
 
void setIndexInfo (const Indexing::IndexInfo &indexInfo)
 Sets the IndexInfo object of the workspace. More...
 
const std::string toString () const override
 Serializes the object to a string. More...
 
const std::string toString () const override
 String description of state. More...
 
 ~MatrixWorkspace () override
 Delete. More...
 
std::shared_ptr< const Geometry::IDetectorgetDetector (const size_t workspaceIndex) const
 Get the effective detector for the given spectrum. More...
 
double detectorTwoTheta (const Geometry::IDetector &det) const
 Returns the 2Theta scattering angle for a detector. More...
 
double detectorSignedTwoTheta (const Geometry::IDetector &det) const
 Returns the signed 2Theta scattering angle for a detector. More...
 
virtual void updateSpectraUsing (const SpectrumDetectorMapping &map)
 
void rebuildSpectraMapping (const bool includeMonitors=true, const specnum_t specNumOffset=1)
 Build the default spectra mapping, most likely wanted after an instrument update. More...
 
spec2index_map getSpectrumToWorkspaceIndexMap () const
 Return a map where: KEY is the Spectrum # VALUE is the Workspace Index. More...
 
detid2index_map getDetectorIDToWorkspaceIndexMap (bool throwIfMultipleDets=false, bool ignoreIfNoValidDets=false) const
 Return a map where: KEY is the DetectorID (pixel ID) VALUE is the Workspace Index. More...
 
virtual std::vector< size_t > getDetectorIDToWorkspaceIndexVector (detid_t &offset, bool throwIfMultipleDets=false) const
 Return a vector where: The index into the vector = DetectorID (pixel ID) + offset The value at that index = the corresponding Workspace Index. More...
 
virtual std::vector< size_t > getSpectrumToWorkspaceIndexVector (specnum_t &offset) const
 Return a vector where: The index into the vector = spectrum number + offset The value at that index = the corresponding Workspace Index. More...
 
std::vector< size_t > getIndicesFromSpectra (const std::vector< specnum_t > &spectraList) const
 Converts a list of spectrum numbers to the corresponding workspace indices. More...
 
size_t getIndexFromSpectrumNumber (const specnum_t specNo) const
 Given a spectrum number, find the corresponding workspace index. More...
 
std::vector< size_t > getIndicesFromDetectorIDs (const std::vector< detid_t > &detIdList) const
 Converts a list of detector IDs to the corresponding workspace indices. More...
 
std::vector< specnum_tgetSpectraFromDetectorIDs (const std::vector< detid_t > &detIdList) const
 Converts a list of detector IDs to the corresponding spectrum numbers. More...
 
bool hasGroupedDetectors () const
 Does the workspace has any grouped detectors? More...
 
virtual size_t getMemorySizeForXAxes () const
 Returns the memory used (in bytes) by the X axes, handling ragged bins. More...
 
void setTitle (const std::string &) override
 Sets MatrixWorkspace title. More...
 
const std::string getTitle () const override
 Gets MatrixWorkspace title (same as Run object run_title property) More...
 
virtual Types::Core::DateAndTime getFirstPulseTime () const
 Return the time of the first pulse received, by accessing the run's sample logs to find the proton_charge. More...
 
Types::Core::DateAndTime getLastPulseTime () const
 Return the time of the last pulse received, by accessing the run's sample logs to find the proton_charge. More...
 
std::size_t yIndexOfX (const double xValue, const std::size_t &index=0, const double tolerance=0.0) const
 Returns the y index which corresponds to the X Value provided. More...
 
HistogramData::Histogram histogram (const size_t index) const
 Returns the Histogram at the given workspace index. More...
 
template<typename... T>
void setHistogram (const size_t index, T &&...data) &
 
void convertToCounts (const size_t index)
 
void convertToFrequencies (const size_t index)
 
HistogramData::BinEdges binEdges (const size_t index) const
 
HistogramData::Points points (const size_t index) const
 
HistogramData::PointStandardDeviations pointStandardDeviations (const size_t index) const
 
template<typename... T>
void setBinEdges (const size_t index, T &&...data) &
 
template<typename... T>
void setPoints (const size_t index, T &&...data) &
 
template<typename... T>
void setPointVariances (const size_t index, T &&...data) &
 
template<typename... T>
void setPointStandardDeviations (const size_t index, T &&...data) &
 
HistogramData::Counts counts (const size_t index) const
 
HistogramData::CountVariances countVariances (const size_t index) const
 
HistogramData::CountStandardDeviations countStandardDeviations (const size_t index) const
 
HistogramData::Frequencies frequencies (const size_t index) const
 
HistogramData::FrequencyVariances frequencyVariances (const size_t index) const
 
HistogramData::FrequencyStandardDeviations frequencyStandardDeviations (const size_t index) const
 
template<typename... T>
void setCounts (const size_t index, T &&...data) &
 
template<typename... T>
void setCountVariances (const size_t index, T &&...data) &
 
template<typename... T>
void setCountStandardDeviations (const size_t index, T &&...data) &
 
template<typename... T>
void setFrequencies (const size_t index, T &&...data) &
 
template<typename... T>
void setFrequencyVariances (const size_t index, T &&...data) &
 
template<typename... T>
void setFrequencyStandardDeviations (const size_t index, T &&...data) &
 
const HistogramData::HistogramX & x (const size_t index) const
 
const HistogramData::HistogramY & y (const size_t index) const
 
const HistogramData::HistogramE & e (const size_t index) const
 
const HistogramData::HistogramDx & dx (const size_t index) const
 
HistogramData::HistogramX & mutableX (const size_t index) &
 
HistogramData::HistogramDx & mutableDx (const size_t index) &
 
HistogramData::HistogramY & mutableY (const size_t index) &
 
HistogramData::HistogramE & mutableE (const size_t index) &
 
Kernel::cow_ptr< HistogramData::HistogramX > sharedX (const size_t index) const
 
Kernel::cow_ptr< HistogramData::HistogramY > sharedY (const size_t index) const
 
Kernel::cow_ptr< HistogramData::HistogramE > sharedE (const size_t index) const
 
Kernel::cow_ptr< HistogramData::HistogramDx > sharedDx (const size_t index) const
 
void setSharedX (const size_t index, const Kernel::cow_ptr< HistogramData::HistogramX > &x) &
 
void setSharedDx (const size_t index, const Kernel::cow_ptr< HistogramData::HistogramDx > &dx) &
 
void setSharedY (const size_t index, const Kernel::cow_ptr< HistogramData::HistogramY > &y) &
 
void setSharedE (const size_t index, const Kernel::cow_ptr< HistogramData::HistogramE > &e) &
 
const MantidVecreadX (std::size_t const index) const
 Deprecated, use x() instead. More...
 
const MantidVecreadY (std::size_t const index) const
 Deprecated, use y() instead. More...
 
const MantidVecreadE (std::size_t const index) const
 Deprecated, use e() instead. More...
 
const MantidVecreadDx (size_t const index) const
 Deprecated, use dx() instead. More...
 
virtual double getXMin () const
 
virtual double getXMax () const
 
virtual void getXMinMax (double &xmin, double &xmax) const
 
virtual void setX (const std::size_t index, const Kernel::cow_ptr< HistogramData::HistogramX > &X)
 Deprecated, use setSharedX() instead. More...
 
virtual void setX (const std::size_t index, const std::shared_ptr< HistogramData::HistogramX > &X)
 Deprecated, use setSharedX() instead. More...
 
virtual bool hasDx (const std::size_t index) const
 Probes if DX (X Error) values were set on a particular spectrum. More...
 
std::pair< size_t, double > getXIndex (size_t i, double x, bool isLeft=true, size_t start=0) const
 Return an index in the X vector for an x-value close to a given value. More...
 
int axes () const
 
virtual AxisgetAxis (const std::size_t &axisIndex) const
 Get a non owning pointer to a workspace axis. More...
 
void replaceAxis (const std::size_t &axisIndex, std::unique_ptr< Axis > newAxis)
 Replaces one of the workspace's axes with the new one provided. More...
 
size_t numberOfAxis () const
 Will return the number of Axis currently stored in the workspace it is not always safe to assume it is just 2. More...
 
virtual bool isCommonLogBins () const
 Returns true if the workspace contains common X bins with log spacing. More...
 
virtual bool isCommonBins () const
 Returns true if the workspace contains common X bins. More...
 
virtual bool isIntegerBins () const
 Returns true if the workspace has common, integer X bins. More...
 
std::string YUnit () const
 Returns the units of the data in the workspace. More...
 
void setYUnit (const std::string &newUnit)
 Sets a new unit for the data (Y axis) in the workspace. More...
 
std::string YUnitLabel (bool useLatex=false, bool plotAsDistribution=false) const
 Returns a caption for the units of the data in the workspace. More...
 
void setYUnitLabel (const std::string &newLabel)
 Sets a new caption for the data (Y axis) in the workspace. More...
 
bool isDistribution () const
 Are the Y-values dimensioned? More...
 
void setDistribution (bool newValue)
 Set the flag for whether the Y-values are dimensioned. More...
 
void maskBin (const size_t &workspaceIndex, const size_t &binIndex, const double &weight=1.0)
 Called by the algorithm MaskBins to mask a single bin for the first time, algorithms that later propagate the the mask from an input to the output should call flagMasked() instead. More...
 
void flagMasked (const size_t &index, const size_t &binIndex, const double &weight=1.0)
 Writes the masking weight to m_masks (doesn't alter y-values). More...
 
bool hasMaskedBins (const size_t &workspaceIndex) const
 Does this spectrum contain any masked bins. More...
 
bool hasAnyMaskedBins () const
 Does this workspace contain any masked bins. More...
 
const MaskListmaskedBins (const size_t &workspaceIndex) const
 Returns the list of masked bins for a spectrum. More...
 
std::vector< size_t > maskedBinsIndices (const size_t &workspaceIndex) const
 
void setMaskedBins (const size_t workspaceIndex, const MaskList &maskedBins)
 Set the list of masked bins for given workspaceIndex. More...
 
void setUnmaskedBins (const size_t workspaceIndex)
 Removes the mask from an index. More...
 
virtual void setMonitorWorkspace (const std::shared_ptr< MatrixWorkspace > &monitorWS)
 Sets the internal monitor workspace to the provided workspace. More...
 
std::shared_ptr< MatrixWorkspacemonitorWorkspace () const
 Returns a pointer to the internal monitor workspace. More...
 
void loadInstrumentNexus (::NeXus::File *file)
 
size_t getNumDims () const override
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimension (size_t index) const override
 Get a dimension. More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimensionWithId (std::string id) const override
 Get a dimension. More...
 
uint64_t getNPoints () const override
 Gets the number of points available on the workspace. More...
 
uint64_t getNEvents () const override
 Get the number of points available on the workspace. More...
 
LinePlot getLinePlot (const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, Mantid::API::MDNormalization normalize) const override
 Generate a line plot through the matrix workspace. More...
 
signal_t getSignalAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const override
 Get the signal at a coordinate in the workspace. More...
 
signal_t getSignalWithMaskAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const override
 Get the signal at a coordinate in the workspace. More...
 
std::vector< std::unique_ptr< IMDIterator > > createIterators (size_t suggestedNumCores=1, Mantid::Geometry::MDImplicitFunction *function=nullptr) const override
 Create iterators. More...
 
void setMDMasking (std::unique_ptr< Mantid::Geometry::MDImplicitFunction > maskingRegion) override
 Apply masking. More...
 
void clearMDMasking () override
 Clear exsting masking. More...
 
Mantid::Kernel::SpecialCoordinateSystem getSpecialCoordinateSystem () const override
 
virtual bool hasOrientedLattice () const override
 
virtual std::pair< int64_t, int64_t > findY (double value, const std::pair< int64_t, int64_t > &idx={0, 0}) const
 Find first index in Y equal to value. More...
 
std::pair< size_t, size_t > getImageStartEndXIndices (size_t i, double startX, double endX) const
 Get start and end x indices for images. More...
 
MantidImage_sptr getImageY (size_t start=0, size_t stop=0, size_t width=0, double startX=EMPTY_DBL(), double endX=EMPTY_DBL()) const
 Create an image of Ys. More...
 
MantidImage_sptr getImageE (size_t start=0, size_t stop=0, size_t width=0, double startX=EMPTY_DBL(), double endX=EMPTY_DBL()) const
 Create an image of Es. More...
 
virtual void setImageY (const MantidImage &image, size_t start=0, bool parallelExecution=true)
 Copy the data (Y's) from an image to this workspace. More...
 
virtual void setImageE (const MantidImage &image, size_t start=0, bool parallelExecution=true)
 Copy the data from an image to this workspace's errors. More...
 
void invalidateCachedSpectrumNumbers ()
 
void invalidateCommonBinsFlag ()
 Invalidates the commons bins flag. More...
 
- Public Member Functions inherited from Mantid::API::IMDWorkspace
std::string changeQConvention ()
 
virtual void clearFileBacked (bool)
 if a workspace was filebacked, this should clear file-based status, delete file-based information and close related files. More...
 
virtual void clearMDMasking ()=0
 Clear existing masks. More...
 
std::unique_ptr< IMDWorkspaceclone () const
 Returns a clone of the workspace. More...
 
std::unique_ptr< IMDWorkspacecloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
std::unique_ptr< IMDIteratorcreateIterator (Mantid::Geometry::MDImplicitFunction *function=nullptr) const
 Creates a single iterator and returns it. More...
 
virtual std::vector< std::unique_ptr< IMDIterator > > createIterators (size_t suggestedNumCores=1, Mantid::Geometry::MDImplicitFunction *function=nullptr) const =0
 Creates a new iterator pointing to the first cell in the workspace. More...
 
virtual MDNormalization displayNormalization () const
 
virtual MDNormalization displayNormalizationHisto () const
 
std::string getConvention () const
 
virtual LinePlot getLinePlot (const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, Mantid::API::MDNormalization normalize) const
 Method to generate a line plot through a MD-workspace. More...
 
virtual uint64_t getNEvents () const =0
 
virtual uint64_t getNPoints () const =0
 Get the number of points associated with the workspace. More...
 
virtual signal_t getSignalAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const =0
 Returns the (normalized) signal at a given coordinates. More...
 
signal_t getSignalAtVMD (const Mantid::Kernel::VMD &coords, const Mantid::API::MDNormalization &normalization=Mantid::API::VolumeNormalization) const
 Returns the signal (normalized by volume) at a given coordinates. More...
 
virtual signal_t getSignalWithMaskAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const =0
 Returns the (normalized) signal at a given coordinates or 0 if the value. More...
 
signal_t getSignalWithMaskAtVMD (const Mantid::Kernel::VMD &coords, const Mantid::API::MDNormalization &normalization=Mantid::API::VolumeNormalization) const
 Returns the signal (normalized by volume) at a given coordinates or 0 if masked. More...
 
virtual Kernel::SpecialCoordinateSystem getSpecialCoordinateSystem () const =0
 
virtual bool hasOrientedLattice () const =0
 
 IMDWorkspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 Default constructor. More...
 
virtual bool isMDHistoWorkspace () const
 
virtual ITableWorkspace_sptr makeBoxTable (size_t, size_t)
 this is the method to build table workspace from any workspace. More...
 
IMDWorkspaceoperator= (const IMDWorkspace &other)=delete
 
void setConvention (std::string convention)
 
virtual void setMDMasking (std::unique_ptr< Mantid::Geometry::MDImplicitFunction > maskingRegion)=0
 Setter for the masking region. More...
 
- Public Member Functions inherited from Mantid::API::Workspace
Workspace_uptr clone () const
 Returns a clone (copy) of the workspace with covariant return type in all derived classes. More...
 
Workspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
const std::string & getComment () const
 Get the workspace comment. More...
 
const WorkspaceHistorygetHistory () const
 Returns a reference to the WorkspaceHistory const. More...
 
virtual size_t getMemorySize () const =0
 Get the footprint in memory in bytes. More...
 
std::string getMemorySizeAsStr () const
 Returns the memory footprint in sensible units. More...
 
const std::string & getName () const override
 Get the workspace name. More...
 
virtual const std::string getTitle () const
 Get the workspace title. More...
 
WorkspaceHistoryhistory ()
 Returns a reference to the WorkspaceHistory. More...
 
bool isDirty (const int n=1) const
 Check whether other algorithms have been applied to the workspace by checking the history length. More...
 
virtual bool isGroup () const
 
Workspaceoperator= (const Workspace &other)=delete
 
void setComment (const std::string &)
 Set the comment field of the workspace. More...
 
virtual void setTitle (const std::string &)
 Set the title of the workspace. More...
 
Parallel::StorageMode storageMode () const
 Returns the storage mode (used for MPI runs) More...
 
bool threadSafe () const override
 Marks the workspace as safe for multiple threads to edit data simutaneously. More...
 
 Workspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 
 ~Workspace ()
 
- Public Member Functions inherited from Mantid::Kernel::DataItem
 DataItem ()
 Default constructor. More...
 
 DataItem (const DataItem &other)
 Copy constructor Always makes a unique lock. More...
 
virtual ~DataItem ()
 Destructor. More...
 
void readLock ()
 Acquires a read lock. More...
 
void unlock ()
 
- Public Member Functions inherited from Mantid::API::MDGeometry
void addDimension (const std::shared_ptr< Mantid::Geometry::IMDDimension > &dim)
 Add a dimension. More...
 
void addDimension (Mantid::Geometry::IMDDimension *dim)
 Add a dimension. More...
 
bool allBasisNormalized () const
 
void clearOriginalWorkspaces ()
 Clear original workspaces. More...
 
void clearTransforms ()
 Clear transforms. More...
 
virtual std::vector< coord_testimateResolution () const
 
Mantid::Kernel::VMDgetBasisVector (size_t index)
 Get the basis vector (in the original workspace) for a dimension of this workspace. More...
 
const Mantid::Kernel::VMDgetBasisVector (size_t index) const
 Get the basis vector (in the original workspace) for a dimension of this workspace. More...
 
virtual std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimension (size_t index) const
 Get a dimension. More...
 
size_t getDimensionIndexById (const std::string &id) const
 Get the index of the dimension that matches the ID given. More...
 
size_t getDimensionIndexByName (const std::string &name) const
 Get the index of the dimension that matches the name given. More...
 
virtual std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimensionWithId (std::string id) const
 Get a dimension. More...
 
std::string getGeometryXML () const
 
std::vector< std::shared_ptr< const Geometry::IMDDimension > > getNonIntegratedDimensions () const
 Get non-collapsed dimensions. More...
 
size_t getNumberTransformsFromOriginal () const
 Get the number of transforms defined from the original coordinate system. More...
 
size_t getNumberTransformsToOriginal () const
 Get the number of transforms defined to the original coordinate system. More...
 
virtual size_t getNumDims () const
 
virtual size_t getNumNonIntegratedDims () const
 
Mantid::Kernel::VMDgetOrigin ()
 
const Mantid::Kernel::VMDgetOrigin () const
 
std::shared_ptr< WorkspacegetOriginalWorkspace (size_t index=0) const
 Get the "original" workspace (the workspace that was the source for a binned MDWorkspace). More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetTDimension () const
 Get the t-dimension mapping. More...
 
Mantid::API::CoordTransform const * getTransformFromOriginal (size_t index=0) const
 Get the Coordinate Transformation that goes from the original workspace to this workspace's coordinates. More...
 
Mantid::API::CoordTransform const * getTransformToOriginal (size_t index=0) const
 Get the Coordinate Transformation that goes from THIS workspace's coordinates to the ORIGINAL workspace's coordinates. More...
 
const Kernel::DblMatrixgetWTransf () const
 get the transformation from Qin crystal cartezian coordinate system to Q in orthogonal or real HKL coordiate system alined with arbitrary slicing plane More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetXDimension () const
 Get the x-dimension mapping. More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetYDimension () const
 Get the y-dimension mapping. More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetZDimension () const
 Get the z-dimension mapping. More...
 
bool hasOriginalWorkspace (size_t index=0) const
 
void initGeometry (const std::vector< std::shared_ptr< Geometry::IMDDimension > > &dimensions)
 Initialize the geometry. More...
 
 MDGeometry ()
 Constructor. More...
 
 MDGeometry (const MDGeometry &other)
 Copy Constructor. More...
 
size_t numOriginalWorkspaces () const
 
MDGeometryoperator= (const MDGeometry &other)
 
void setBasisVector (size_t index, const Mantid::Kernel::VMD &vec)
 Set the basis vector (in the original workspace) for a dimension of this workspace. More...
 
void setOrigin (const Mantid::Kernel::VMD &orig)
 Sets the origin of this geometry. More...
 
void setOriginalWorkspace (std::shared_ptr< Workspace > ws, size_t index=0)
 Set the "original" workspace (the workspace that was the source for a binned MDWorkspace). More...
 
void setTransformFromOriginal (Mantid::API::CoordTransform *transform, size_t index=0)
 Sets the Coordinate Transformation that goes from the original workspace to this workspace's coordinates. More...
 
void setTransformToOriginal (Mantid::API::CoordTransform *transform, size_t index=0)
 Sets the Coordinate Transformation that goes from THIS workspace's coordinates to the ORIGINAL workspace's coordinates. More...
 
void setWTransf (const Kernel::DblMatrix &WTransf)
 set the transformation from Q in crystal cartezian coordinate system to Q in orthogonal or real HKL coordiate system alined with arbitrary slicing plane More...
 
void transformDimensions (std::vector< double > &scaling, std::vector< double > &offset)
 Transform the dimensions contained in this geometry x' = x*scaling + offset. More...
 
virtual ~MDGeometry ()
 Destructor. More...
 
- Public Member Functions inherited from Mantid::API::ExperimentInfo
virtual ExperimentInfocloneExperimentInfo () const
 Clone us. More...
 
const Geometry::ComponentInfocomponentInfo () const
 
const Geometry::ParameterMapconstInstrumentParameters () const
 Const version. More...
 
void copyExperimentInfoFrom (const ExperimentInfo *other)
 Copy everything from the given experiment object. More...
 
const Geometry::DetectorInfodetectorInfo () const
 Return a const reference to the DetectorInfo object. More...
 
 ExperimentInfo ()
 Default constructor. More...
 
 ExperimentInfo (const ExperimentInfo &)
 Copy constructor. More...
 
std::string getAvailableWorkspaceEndDate () const
 Return workspace end date as a formatted string (strftime style, as returned by Kernel::DateAdnTime) string, if available. More...
 
std::string getAvailableWorkspaceStartDate () const
 Return workspace start date as a formatted string (strftime, as returned by Types::Core::DateAndTime) string, if available. More...
 
double getEFixed (const detid_t detID) const
 Easy access to the efixed value for this run & detector ID. More...
 
double getEFixed (const std::shared_ptr< const Geometry::IDetector > &detector=std::shared_ptr< const Geometry::IDetector >{nullptr}) const
 Easy access to the efixed value for this run & optional detector. More...
 
double getEFixedForIndirect (const std::shared_ptr< const Geometry::IDetector > &detector, const std::vector< std::string > &parameterNames) const
 
double getEFixedGivenEMode (const std::shared_ptr< const Geometry::IDetector > &detector, const Kernel::DeltaEMode::Type emode) const
 Easy access to the efixed value for this run & detector. More...
 
Kernel::DeltaEMode::Type getEMode () const
 Returns the emode for this run. More...
 
Geometry::Instrument_const_sptr getInstrument () const
 Returns the parameterized instrument. More...
 
Kernel::PropertygetLog (const std::string &log) const
 Access a log for this experiment. More...
 
double getLogAsSingleValue (const std::string &log) const
 Access a single value from a log for this experiment. More...
 
int getRunNumber () const
 Utility method to get the run number. More...
 
std::string getWorkspaceStartDate () const
 Returns the start date for this experiment (or current time if no info available) More...
 
Geometry::ParameterMapinstrumentParameters ()
 Returns a modifiable set of instrument parameters. More...
 
const Geometry::ParameterMapinstrumentParameters () const
 Returns the set of parameters modifying the base instrument (const-version) More...
 
void invalidateSpectrumDefinition (const size_t index)
 Notifies the ExperimentInfo that a spectrum definition has changed. More...
 
void loadExperimentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string &parameterStr)
 Loads an experiment description from the open NeXus file. More...
 
void loadExperimentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string &parameterStr, const Mantid::Kernel::NexusHDF5Descriptor &fileInfo, const std::string &prefix)
 
void loadInstrumentInfoNexus (const std::string &nxFilename, ::NeXus::File *file)
 Load the instrument from an open NeXus file without reading any parameters. More...
 
void loadInstrumentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string &parameterStr)
 Load the instrument from an open NeXus file. More...
 
void loadInstrumentParametersNexus (::NeXus::File *file, std::string &parameterStr)
 Load instrument parameters from an open Nexus file in Instument group if found there. More...
 
void loadSampleAndLogInfoNexus (::NeXus::File *file)
 Load the sample and log info from an open NeXus file. More...
 
void loadSampleAndLogInfoNexus (::NeXus::File *file, const Mantid::Kernel::NexusHDF5Descriptor &fileInfo, const std::string &prefix)
 Load the sample and log info from an open NeXus file. More...
 
Geometry::ComponentInfomutableComponentInfo ()
 
Geometry::DetectorInfomutableDetectorInfo ()
 Return a non-const reference to the DetectorInfo object. More...
 
RunmutableRun ()
 Writable version of the run object. More...
 
SamplemutableSample ()
 Writable version of the sample object. More...
 
SpectrumInfomutableSpectrumInfo ()
 Return a non-const reference to the SpectrumInfo object. More...
 
ExperimentInfooperator= (const ExperimentInfo &)
 Implements the copy assignment operator. More...
 
void populateInstrumentParameters ()
 Add parameters to the instrument parameter map that are defined in instrument definition file or parameter file, which may contain parameters that require logfile data to be available. More...
 
void readParameterMap (const std::string &parameterStr)
 Populate the parameter map given a string. More...
 
const Runrun () const
 Run details object access. More...
 
const Samplesample () const
 Sample accessors. More...
 
void saveExperimentInfoNexus (::NeXus::File *file, bool saveInstrument, bool saveSample, bool saveLogs) const
 Saves this experiment description to the open NeXus file. More...
 
void saveExperimentInfoNexus (::NeXus::File *file, bool saveLegacyInstrument=true) const
 Saves this experiment description to the open NeXus file. More...
 
void setDetectorGrouping (const size_t index, const std::set< detid_t > &detIDs) const
 Sets the detector grouping for the spectrum with the given index. More...
 
void setEFixed (const detid_t detID, const double value)
 Set the efixed value for a given detector ID. More...
 
void setInstrument (const Geometry::Instrument_const_sptr &instr)
 Instrument accessors. More...
 
void setNumberOfDetectorGroups (const size_t count) const
 Sets the number of detector groups. More...
 
void setSharedRun (Kernel::cow_ptr< Run > run)
 Set the run object. Use in particular to clear run without copying old run. More...
 
Kernel::cow_ptr< RunsharedRun ()
 Return the cow ptr of the run. More...
 
const SpectrumInfospectrumInfo () const
 Return a reference to the SpectrumInfo object. More...
 
const std::string toString () const
 Returns a string description of the object. More...
 
void updateSpectrumDefinitionIfNecessary (const size_t index) const
 
virtual ~ExperimentInfo ()
 Virtual destructor. More...
 

Protected Member Functions

 EventWorkspace (const EventWorkspace &other)
 Protected copy constructor. May be used by childs for cloning. More...
 
- Protected Member Functions inherited from Mantid::API::IEventWorkspace
IEventListgetSpectrumWithoutInvalidation (const size_t index) override=0
 
 IEventWorkspace (const IEventWorkspace &)=default
 Protected copy constructor. May be used by childs for cloning. More...
 
const std::string toString () const override
 Serializes the object to a string. More...
 
- Protected Member Functions inherited from Mantid::API::MatrixWorkspace
 MatrixWorkspace (const MatrixWorkspace &other)
 Protected copy constructor. May be used by childs for cloning. More...
 
 MatrixWorkspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 Default constructor. More...
 
void updateCachedDetectorGrouping (const size_t index) const override
 Update detector grouping for spectrum with given index. More...
 
std::string getDimensionIdFromAxis (const int &axisIndex) const
 Getter for the dimension id based on the axis. More...
 
- Protected Member Functions inherited from Mantid::API::IMDWorkspace
 IMDWorkspace (const IMDWorkspace &)=default
 Protected copy constructor. May be used by childs for cloning. More...
 
void makeSinglePointWithNaN (std::vector< coord_t > &x, std::vector< signal_t > &y, std::vector< signal_t > &e) const
 Make a single point with NaN as the signal and error This can be returned when there would otherwise be nothing to plot. More...
 
const std::string toString () const override
 Serializes the object to a string. More...
 
- Protected Member Functions inherited from Mantid::API::Workspace
void setStorageMode (Parallel::StorageMode mode)
 Sets the storage mode (used for MPI runs) More...
 
 Workspace (const Workspace &)
 Protected copy constructor. May be used by childs for cloning. More...
 
- Protected Member Functions inherited from Mantid::Kernel::DataItem
Poco::RWLock * getLock () const
 Private method to access the RWLock object. More...
 
- Protected Member Functions inherited from Mantid::API::MDGeometry
void deleteNotificationReceived (const std::shared_ptr< const Workspace > &deleted)
 Function called when observer objects recieves a notification. More...
 
- Protected Member Functions inherited from Mantid::API::ExperimentInfo
size_t numberOfDetectorGroups () const
 Returns the number of detector groups. More...
 
virtual void populateIfNotLoaded () const
 Called as the first operation of most public methods. More...
 
void setSpectrumDefinitions (Kernel::cow_ptr< std::vector< SpectrumDefinition > > spectrumDefinitions)
 Sets the SpectrumDefinition for all spectra. More...
 
virtual void updateCachedDetectorGrouping (const size_t index) const
 Update detector grouping for spectrum with given index. More...
 

Private Member Functions

EventWorkspacedoClone () const override
 Virtual clone method. Not implemented to force implementation in children. More...
 
EventWorkspacedoCloneEmpty () const override
 Virtual cloneEmpty method. More...
 
EventListgetSpectrumWithoutInvalidation (const size_t index) override
 Return const reference to EventList at the given workspace index. More...
 

Private Attributes

std::vector< std::unique_ptr< EventList > > data
 A vector that holds the event list for each spectrum; the key is the workspace index, which is not necessarily the pixelid. More...
 
std::unique_ptr< EventWorkspaceMRUmru
 Container for the MRU lists of the event lists contained. More...
 

Additional Inherited Members

- Public Types inherited from Mantid::API::MatrixWorkspace
using MaskList = std::map< size_t, double >
 Masked bins for each spectrum are stored as a set of pairs containing <bin index, weight> More...
 
- Static Public Attributes inherited from Mantid::API::MatrixWorkspace
static const std::string xDimensionId = "xDimension"
 Dimension id for x-dimension. More...
 
static const std::string yDimensionId = "yDimension"
 Dimensin id for y-dimension. More...
 
- Protected Attributes inherited from Mantid::API::MatrixWorkspace
std::vector< std::unique_ptr< Axis > > m_axes
 A vector of pointers to the axes for this workspace. More...
 
- Protected Attributes inherited from Mantid::API::MDGeometry
std::vector< Mantid::Kernel::VMDm_basisVectors
 Vector of the basis vector (in the original workspace) for each dimension of this workspace. More...
 
std::vector< std::shared_ptr< Geometry::IMDDimension > > m_dimensions
 Vector of the dimensions used, in the order X Y Z t, etc. More...
 
std::unique_ptr< MDGeometryNotificationHelperm_notificationHelper
 Helper that deals with notifications and observing the ADS. More...
 
Mantid::Kernel::VMD m_origin
 Vector of the origin (in the original workspace) that corresponds to 0,0,0... in this workspace. More...
 
std::vector< std::shared_ptr< Workspace > > m_originalWorkspaces
 Pointer to the original workspace(s), if this workspace is a coordinate transformation from an original workspace. More...
 
std::vector< std::shared_ptr< const Mantid::API::CoordTransform > > m_transforms_FromOriginal
 Coordinate Transformation that goes from the original workspace to this workspace's coordinates. More...
 
std::vector< std::shared_ptr< const Mantid::API::CoordTransform > > m_transforms_ToOriginal
 Coordinate Transformation that goes from this workspace's coordinates to the original workspace coordinates. More...
 
Kernel::DblMatrix m_Wtransf
 the matrix which transforms momentums from orthogonal Q-system to Orthogonal HKL or non-orthogonal HKL system alighned WRT to arbitrary coordinate system requested See the UB matrix formalizm, pg 7 for further details on implementation. More...
 
- Protected Attributes inherited from Mantid::API::ExperimentInfo
std::shared_ptr< Geometry::ParameterMapm_parmap
 Parameters modifying the base instrument. More...
 
Geometry::Instrument_const_sptr sptr_instrument
 The base (unparametrized) instrument. More...
 

Detailed Description

This class is intended to fulfill the design specified in <https://github.com/mantidproject/documents/tree/master/Design/Event WorkspaceDetailed Design Document.doc>

Definition at line 31 of file EventWorkspace.h.

Constructor & Destructor Documentation

◆ EventWorkspace() [1/2]

Mantid::DataObjects::EventWorkspace::EventWorkspace ( const Parallel::StorageMode  storageMode = Parallel::StorageMode::Cloned)

Definition at line 47 of file EventWorkspace.cpp.

◆ ~EventWorkspace()

Mantid::DataObjects::EventWorkspace::~EventWorkspace ( )
override

Definition at line 61 of file EventWorkspace.cpp.

References data.

◆ EventWorkspace() [2/2]

Mantid::DataObjects::EventWorkspace::EventWorkspace ( const EventWorkspace other)
protected

Protected copy constructor. May be used by childs for cloning.

Definition at line 50 of file EventWorkspace.cpp.

References data, and mru.

Member Function Documentation

◆ blocksize()

size_t Mantid::DataObjects::EventWorkspace::blocksize ( ) const
overridevirtual

Get the blocksize, aka the number of bins in the histogram.

Returns
the number of bins in the Y data

Implements Mantid::API::MatrixWorkspace.

Definition at line 156 of file EventWorkspace.cpp.

References data.

◆ clearMRU()

void Mantid::DataObjects::EventWorkspace::clearMRU ( ) const
overridevirtual

Clears the MRU lists.

Implements Mantid::API::IEventWorkspace.

Definition at line 484 of file EventWorkspace.cpp.

References mru.

Referenced by setAllX().

◆ clone()

std::unique_ptr< EventWorkspace > Mantid::DataObjects::EventWorkspace::clone ( ) const
inline

Returns a clone of the workspace.

Definition at line 44 of file EventWorkspace.h.

◆ cloneEmpty()

std::unique_ptr< EventWorkspace > Mantid::DataObjects::EventWorkspace::cloneEmpty ( ) const
inline

Returns a default-initialized clone of the workspace.

Definition at line 47 of file EventWorkspace.h.

◆ dataDx() [1/2]

const MantidVec & Mantid::DataObjects::EventWorkspace::dataDx ( const std::size_t  index) const
overridevirtual

Deprecated, use dx() instead.

Returns
the const data X error vector at a given workspace index
Parameters
index:: workspace index

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 540 of file EventWorkspace.cpp.

References getSpectrum(), index, and Mantid::DataObjects::EventList::readDx().

◆ dataDx() [2/2]

MantidVec & Mantid::DataObjects::EventWorkspace::dataDx ( const std::size_t  index)
overridevirtual

Deprecated, use mutableDx() instead.

Return the data X error vector at a given workspace index

Parameters
index:: the workspace index to return
Returns
A reference to the vector of binned error values

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 512 of file EventWorkspace.cpp.

References Mantid::DataObjects::EventList::dataDx(), getSpectrum(), and index.

◆ dataE() [1/2]

const MantidVec & Mantid::DataObjects::EventWorkspace::dataE ( const std::size_t  index) const
overridevirtual

Deprecated, use e() instead.

Returns
the const data E (error) vector at a given workspace index
Parameters
index:: workspace index

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 550 of file EventWorkspace.cpp.

References getSpectrum(), index, and Mantid::API::ISpectrum::readE().

◆ dataE() [2/2]

MantidVec & Mantid::DataObjects::EventWorkspace::dataE ( const std::size_t  )
overridevirtual

Deprecated, use mutableE() instead.

Return the data E vector at a given workspace index Note: these non-const access methods will throw NotImplementedError

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 526 of file EventWorkspace.cpp.

◆ dataX() [1/2]

const MantidVec & Mantid::DataObjects::EventWorkspace::dataX ( const std::size_t  index) const
overridevirtual

Deprecated, use x() instead.

Returns
the const data X vector at a given workspace index
Parameters
index:: workspace index

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 535 of file EventWorkspace.cpp.

References getSpectrum(), index, and Mantid::DataObjects::EventList::readX().

◆ dataX() [2/2]

MantidVec & Mantid::DataObjects::EventWorkspace::dataX ( const std::size_t  index)
overridevirtual

Deprecated, use mutableX() instead.

Return the data X vector at a given workspace index

Parameters
index:: the workspace index to return
Returns
A reference to the vector of binned X values

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 506 of file EventWorkspace.cpp.

References Mantid::DataObjects::EventList::dataX(), getSpectrum(), and index.

◆ dataY() [1/2]

const MantidVec & Mantid::DataObjects::EventWorkspace::dataY ( const std::size_t  index) const
overridevirtual

Deprecated, use y() instead.

Returns
the const data Y vector at a given workspace index
Parameters
index:: workspace index

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 545 of file EventWorkspace.cpp.

References getSpectrum(), index, and Mantid::API::ISpectrum::readY().

◆ dataY() [2/2]

MantidVec & Mantid::DataObjects::EventWorkspace::dataY ( const std::size_t  )
overridevirtual

Deprecated, use mutableY() instead.

Return the data Y vector at a given workspace index Note: these non-const access methods will throw NotImplementedError

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 517 of file EventWorkspace.cpp.

◆ doClone()

EventWorkspace * Mantid::DataObjects::EventWorkspace::doClone ( ) const
inlineoverrideprivatevirtual

Virtual clone method. Not implemented to force implementation in children.

Implements Mantid::API::IEventWorkspace.

Definition at line 156 of file EventWorkspace.h.

◆ doCloneEmpty()

EventWorkspace * Mantid::DataObjects::EventWorkspace::doCloneEmpty ( ) const
inlineoverrideprivatevirtual

Virtual cloneEmpty method.

Not implemented to force implementation in children.

Implements Mantid::API::IEventWorkspace.

Definition at line 157 of file EventWorkspace.h.

◆ generateHistogram()

void Mantid::DataObjects::EventWorkspace::generateHistogram ( const std::size_t  index,
const MantidVec X,
MantidVec Y,
MantidVec E,
bool  skipError = false 
) const
overridevirtual

Generate a new histogram from specified event list at the given index.

Using the event data in the event list, generate a histogram of it w.r.t TOF.

Parameters
index:: workspace index to generate
X:: input X vector of the bin boundaries.
Y:: output vector to be filled with the Y data.
E:: output vector to be filled with the Error data (optionally)
skipError:: if true, the error vector is NOT calculated. This may save some processing time.

Implements Mantid::API::IEventWorkspace.

Definition at line 569 of file EventWorkspace.cpp.

References data, index, and Mantid::Geometry::Y.

◆ generateHistogramPulseTime()

void Mantid::DataObjects::EventWorkspace::generateHistogramPulseTime ( const std::size_t  index,
const MantidVec X,
MantidVec Y,
MantidVec E,
bool  skipError = false 
) const

Generate a new histogram from specified event list at the given index.

Using the event data in the event list, generate a histogram of it w.r.t PULSE TIME.

Parameters
index:: workspace index to generate
X:: input X vector of the bin boundaries.
Y:: output vector to be filled with the Y data.
E:: output vector to be filled with the Error data (optionally)
skipError:: if true, the error vector is NOT calculated. This may save some processing time.

Definition at line 586 of file EventWorkspace.cpp.

References data, index, and Mantid::Geometry::Y.

◆ getEventType()

Mantid::API::EventType Mantid::DataObjects::EventWorkspace::getEventType ( ) const
overridevirtual

Get the EventType of the most-specialized EventList in the workspace.

Returns
the EventType of the most-specialized EventList in the workspace

Implements Mantid::API::IEventWorkspace.

Definition at line 449 of file EventWorkspace.cpp.

References data, Mantid::API::TOF, and Mantid::API::WEIGHTED_NOTIME.

Referenced by Mantid::Algorithms::CompareWorkspaces::compareEventWorkspaces(), and Mantid::MDAlgorithms::IntegrateFlux::integrateSpectra().

◆ getEventXMax()

double Mantid::DataObjects::EventWorkspace::getEventXMax ( ) const

Get them maximum x-value for the events themselves, ignoring the histogram representation.

Returns
The maximum x-value for the all events.

This does copy some of the code from getEventXMinXMax, but that is because getting both min and max then throwing away the min is significantly slower on an unsorted event list.

Definition at line 389 of file EventWorkspace.cpp.

References data, getNumberEvents(), getSpectrum(), and Mantid::DataObjects::EventList::getTofMax().

Referenced by getTofMax().

◆ getEventXMin()

double Mantid::DataObjects::EventWorkspace::getEventXMin ( ) const

Get them minimum x-value for the events themselves, ignoring the histogram representation.

Returns
The minimum x-value for the all events.

This does copy some of the code from getEventXMinXMax, but that is because getting both min and max then throwing away the max is significantly slower on an unsorted event list.

Definition at line 364 of file EventWorkspace.cpp.

References data, getNumberEvents(), getSpectrum(), and Mantid::DataObjects::EventList::getTofMin().

Referenced by getTofMin().

◆ getEventXMinMax()

void Mantid::DataObjects::EventWorkspace::getEventXMinMax ( double &  xmin,
double &  xmax 
) const

Get them minimum and maximum x-values for the events themselves, ignoring the histogram representation.

Since this does not modify the sort order, the method will run significantly faster on a TOF_SORT event list.

Definition at line 410 of file EventWorkspace.cpp.

References data, getNumberEvents(), getSpectrum(), Mantid::DataObjects::EventList::getTofMax(), and Mantid::DataObjects::EventList::getTofMin().

Referenced by resetAllXToSingleBin().

◆ getIntegratedSpectra()

void Mantid::DataObjects::EventWorkspace::getIntegratedSpectra ( std::vector< double > &  out,
const double  minX,
const double  maxX,
const bool  entireRange 
) const
overridevirtual

Integrate all the spectra in the matrix workspace within the range given.

Default implementation, can be overridden by base classes if they know something smarter!

Parameters
out:: returns the vector where there is one entry per spectrum in the workspace. Same order as the workspace indices.
minX:: minimum X bin to use in integrating.
maxX:: maximum X bin to use in integrating.
entireRange:: set to true to use the entire range. minX and maxX are then ignored!

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 698 of file EventWorkspace.cpp.

References data, getNumberHistograms(), Mantid::DataObjects::EventList::integrate(), and PARALLEL_FOR_NO_WSP_CHECK.

◆ getMaxNumberBins()

std::size_t Mantid::DataObjects::EventWorkspace::getMaxNumberBins ( ) const
overridevirtual

Returns the maximum number of bins in a workspace (works on ragged data).

Returns
the maximum number of bins in a workspace.

Implements Mantid::API::MatrixWorkspace.

Definition at line 185 of file EventWorkspace.cpp.

References data.

◆ getMemorySize()

size_t Mantid::DataObjects::EventWorkspace::getMemorySize ( ) const
overridevirtual

Returns the amount of memory used in bytes.

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 487 of file EventWorkspace.cpp.

References data, Mantid::API::Run::getMemorySize(), Mantid::API::MatrixWorkspace::getMemorySizeForXAxes(), and Mantid::API::ExperimentInfo::run().

◆ getNumberBins()

std::size_t Mantid::DataObjects::EventWorkspace::getNumberBins ( const std::size_t &  index) const
overridevirtual

Returns the number of bins for a given histogram index.

Parameters
index:: The histogram index to check for the number of bins.
Returns
the number of bins for a given histogram index.

Implements Mantid::API::MatrixWorkspace.

Definition at line 174 of file EventWorkspace.cpp.

References data, index, and std::to_string().

◆ getNumberEvents()

size_t Mantid::DataObjects::EventWorkspace::getNumberEvents ( ) const
overridevirtual

The total number of events across all of the spectra.

Returns
The total number of events

Implements Mantid::API::IEventWorkspace.

Definition at line 440 of file EventWorkspace.cpp.

References data.

Referenced by Mantid::Algorithms::CompareWorkspaces::compareEventWorkspaces(), getEventXMax(), getEventXMin(), and getEventXMinMax().

◆ getNumberHistograms()

size_t Mantid::DataObjects::EventWorkspace::getNumberHistograms ( ) const
overridevirtual

Get the number of histograms, usually the same as the number of pixels or detectors.

Returns
the number of histograms / event lists

Implements Mantid::API::MatrixWorkspace.

Definition at line 203 of file EventWorkspace.cpp.

References data.

Referenced by Mantid::Algorithms::CompareWorkspaces::compareEventWorkspaces(), Mantid::Algorithms::WorkspaceJoiners::execEvent(), getIntegratedSpectra(), Mantid::DataHandling::getResultVector(), and Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraEvents().

◆ getPulseTimeMax()

DateAndTime Mantid::DataObjects::EventWorkspace::getPulseTimeMax ( ) const
overridevirtual

Get the maximum pulse time for events accross the entire workspace.

Returns
maximum pulse time as a DateAndTime.

Implements Mantid::API::IEventWorkspace.

Definition at line 258 of file EventWorkspace.cpp.

References data, Mantid::DataObjects::EventList::getPulseTimeMax(), and getSpectrum().

◆ getPulseTimeMin()

DateAndTime Mantid::DataObjects::EventWorkspace::getPulseTimeMin ( ) const
overridevirtual

Get the minimum pulse time for events accross the entire workspace.

Returns
minimum pulse time as a DateAndTime.

Implements Mantid::API::IEventWorkspace.

Definition at line 240 of file EventWorkspace.cpp.

References data, Mantid::DataObjects::EventList::getPulseTimeMin(), and getSpectrum().

◆ getPulseTimeMinMax()

void Mantid::DataObjects::EventWorkspace::getPulseTimeMinMax ( Mantid::Types::Core::DateAndTime &  Tmin,
Mantid::Types::Core::DateAndTime &  Tmax 
) const

Get the maximum and mimumum pulse time for events accross the entire workspace.

Parameters
Tminminimal pulse time as a DateAndTime.
Tmaxmaximal pulse time as a DateAndTime.

Definition at line 276 of file EventWorkspace.cpp.

References data, Mantid::DataObjects::EventList::getPulseTimeMinMax(), and getSpectrum().

◆ getSortType()

EventSortType Mantid::DataObjects::EventWorkspace::getSortType ( ) const

Definition at line 658 of file EventWorkspace.cpp.

References data, getSortType(), size(), and Mantid::DataObjects::UNSORTED.

Referenced by getSortType(), and sortAll().

◆ getSpectrum() [1/2]

const EventList & Mantid::DataObjects::EventWorkspace::getSpectrum ( const size_t  index) const
overridevirtual

Return const reference to EventList at the given workspace index.

Implements Mantid::API::IEventWorkspace.

Definition at line 213 of file EventWorkspace.cpp.

References data, and index.

◆ getSpectrum() [2/2]

EventList & Mantid::DataObjects::EventWorkspace::getSpectrum ( const size_t  index)
inlineoverridevirtual

◆ getSpectrumUnsafe()

EventList * Mantid::DataObjects::EventWorkspace::getSpectrumUnsafe ( const size_t  index)

Returns a pointer to the EventList for a given spectrum in a timely manner.

Very minimal checking and preprocessing is performed by this function and it should only be used in tight loops where getSpectrum is too costly.

See the implementation of the non-const getSpectrum to see what is missing.

Parameters
indexWorkspace index
Returns
Pointer to EventList

Definition at line 230 of file EventWorkspace.cpp.

References data, and index.

◆ getSpectrumWithoutInvalidation()

EventList & Mantid::DataObjects::EventWorkspace::getSpectrumWithoutInvalidation ( const size_t  index)
overrideprivatevirtual

Return const reference to EventList at the given workspace index.

Implements Mantid::API::IEventWorkspace.

Definition at line 206 of file EventWorkspace.cpp.

References getSpectrum(), index, and Mantid::API::ISpectrum::setMatrixWorkspace().

◆ getTimeAtSampleMax()

DateAndTime Mantid::DataObjects::EventWorkspace::getTimeAtSampleMax ( double  tofOffset = 0) const
overridevirtual

Get the maximum time at sample for events across the entire workspace.

Parameters
tofOffset:: Time of flight offset. defaults to zero.
Returns
maximum time at sample as a DateAndTime.

Implements Mantid::API::IEventWorkspace.

Definition at line 334 of file EventWorkspace.cpp.

References data, getSpectrum(), Mantid::DataObjects::EventList::getTimeAtSampleMax(), and Mantid::API::ExperimentInfo::spectrumInfo().

◆ getTimeAtSampleMin()

DateAndTime Mantid::DataObjects::EventWorkspace::getTimeAtSampleMin ( double  tofOffset = 0) const
overridevirtual

Get the minimum time at sample for events across the entire workspace.

Parameters
tofOffset:: Time of flight offset. defaults to zero.
Returns
minimum time at sample as a DateAndTime.

Implements Mantid::API::IEventWorkspace.

Definition at line 308 of file EventWorkspace.cpp.

References data, getSpectrum(), Mantid::DataObjects::EventList::getTimeAtSampleMin(), and Mantid::API::ExperimentInfo::spectrumInfo().

◆ getTofMax()

double Mantid::DataObjects::EventWorkspace::getTofMax ( ) const
overridevirtual

Implements Mantid::API::IEventWorkspace.

Definition at line 234 of file EventWorkspace.cpp.

References getEventXMax().

◆ getTofMin()

double Mantid::DataObjects::EventWorkspace::getTofMin ( ) const
overridevirtual

Implements Mantid::API::IEventWorkspace.

Definition at line 232 of file EventWorkspace.cpp.

References getEventXMin().

◆ id()

const std::string Mantid::DataObjects::EventWorkspace::id ( ) const
inlineoverridevirtual

Return the workspace typeID.

Reimplemented from Mantid::API::IEventWorkspace.

Definition at line 35 of file EventWorkspace.h.

◆ init() [1/2]

void Mantid::DataObjects::EventWorkspace::init ( const HistogramData::Histogram &  histogram)
overridevirtual

◆ init() [2/2]

void Mantid::DataObjects::EventWorkspace::init ( const std::size_t &  NVectors,
const std::size_t &  XLength,
const std::size_t &  YLength 
)
overridevirtual

Initialize the pixels.

Parameters
NVectors:: The number of vectors/histograms/detectors in the workspace. Does not need to be set, but needs to be > 0
XLength:: The number of X data points/bin boundaries in each vector (ignored)
YLength:: The number of data/error points in each vector (ignored)

Implements Mantid::API::MatrixWorkspace.

Definition at line 81 of file EventWorkspace.cpp.

References data, Mantid::API::MatrixWorkspace::m_axes, mru, and Mantid::API::ISpectrum::setHistogram().

◆ isHistogramData()

bool Mantid::DataObjects::EventWorkspace::isHistogramData ( ) const
overridevirtual

Returns true always - an EventWorkspace always represents histogramm-able data.

Returns
If the data is a histogram - always true for an eventWorkspace

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 475 of file EventWorkspace.cpp.

◆ isRaggedWorkspace()

bool Mantid::DataObjects::EventWorkspace::isRaggedWorkspace ( ) const
overridevirtual

Returns true if the workspace is ragged (has differently sized spectra).

Returns
true if the workspace is ragged.

Implements Mantid::API::MatrixWorkspace.

Definition at line 135 of file EventWorkspace.cpp.

References data.

◆ MRUSize()

size_t Mantid::DataObjects::EventWorkspace::MRUSize ( ) const

Return how many entries in the Y MRU list are used.

Only used in tests. It only returns the 0-th MRU list size.

Returns
:: number of entries in the MRU list.

Definition at line 481 of file EventWorkspace.cpp.

References mru.

◆ operator=()

EventWorkspace & Mantid::DataObjects::EventWorkspace::operator= ( const EventWorkspace other)
delete

◆ refX()

Kernel::cow_ptr< HistogramData::HistogramX > Mantid::DataObjects::EventWorkspace::refX ( const std::size_t  index) const
overridevirtual

Deprecated, use sharedX() instead.

Returns
a pointer to the X data vector at a given workspace index
Parameters
index:: workspace index

Reimplemented from Mantid::API::MatrixWorkspace.

Definition at line 555 of file EventWorkspace.cpp.

References getSpectrum(), index, and Mantid::DataObjects::EventList::ptrX().

◆ resetAllXToSingleBin()

void Mantid::DataObjects::EventWorkspace::resetAllXToSingleBin ( )
overridevirtual

Set all Histogram X vectors to a single bin with boundaries that fit the TOF of all events across all spectra.

Implements Mantid::API::IEventWorkspace.

Definition at line 613 of file EventWorkspace.cpp.

References getEventXMinMax(), and setAllX().

◆ setAllX()

void Mantid::DataObjects::EventWorkspace::setAllX ( const HistogramData::BinEdges &  x)
overridevirtual

Set all histogram X vectors.

Parameters
x:: The X vector of histogram bins to use.

Implements Mantid::API::IEventWorkspace.

Definition at line 597 of file EventWorkspace.cpp.

References clearMRU(), data, Mantid::API::MatrixWorkspace::invalidateCommonBinsFlag(), and Mantid::Geometry::x.

Referenced by resetAllXToSingleBin().

◆ size()

size_t Mantid::DataObjects::EventWorkspace::size ( ) const
overridevirtual

The total size of the workspace.

Returns
the number of single indexable items in the workspace

Implements Mantid::API::MatrixWorkspace.

Definition at line 148 of file EventWorkspace.cpp.

References data, and value.

Referenced by getSortType().

◆ sortAll()

void Mantid::DataObjects::EventWorkspace::sortAll ( EventSortType  sortType,
Mantid::API::Progress prog 
) const

◆ sortAllOld()

void Mantid::DataObjects::EventWorkspace::sortAllOld ( EventSortType  sortType,
Mantid::API::Progress prog 
) const

◆ switchEventType()

void Mantid::DataObjects::EventWorkspace::switchEventType ( const Mantid::API::EventType  type)

Switch all event lists to the given event type.

Parameters
type:: EventType to switch to

Definition at line 467 of file EventWorkspace.cpp.

References data.

◆ threadSafe()

bool Mantid::DataObjects::EventWorkspace::threadSafe ( ) const
overridevirtual

Returns true if the EventWorkspace is safe for multithreaded operations.

WARNING: This is only true for OpenMP threading. EventWorkspace is NOT thread safe with Poco threads or other threading mechanisms.

Reimplemented from Mantid::API::Workspace.

Definition at line 67 of file EventWorkspace.cpp.

Referenced by Mantid::Algorithms::CompareWorkspaces::compareEventWorkspaces().

Member Data Documentation

◆ data

std::vector<std::unique_ptr<EventList> > Mantid::DataObjects::EventWorkspace::data
private

◆ mru

std::unique_ptr<EventWorkspaceMRU> Mantid::DataObjects::EventWorkspace::mru
mutableprivate

Container for the MRU lists of the event lists contained.

Definition at line 167 of file EventWorkspace.h.

Referenced by clearMRU(), EventWorkspace(), init(), and MRUSize().


The documentation for this class was generated from the following files: