Mantid
Loading...
Searching...
No Matches
EventWorkspaceCollection.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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
11#include "MantidDataHandling/DllConfig.h"
14#include <boost/function.hpp>
15#include <memory>
16#include <vector>
17
18namespace Mantid {
19namespace Indexing {
20class IndexInfo;
21}
22namespace DataHandling {
23
30class MANTID_DATAHANDLING_DLL EventWorkspaceCollection {
31
32private:
34 std::vector<DataObjects::EventWorkspace_sptr> m_WsVec;
36 DataObjects::EventWorkspace_sptr createEmptyEventWorkspace() const;
37
38public:
42 virtual ~EventWorkspaceCollection() = default;
43
44 void setNPeriods(size_t nPeriods, std::unique_ptr<const Kernel::TimeSeriesProperty<int>> &periodLog);
45 void reserveEventListAt(size_t wi, size_t size);
46 size_t nPeriods() const;
47 DataObjects::EventWorkspace_sptr getSingleHeldWorkspace();
48 API::Workspace_sptr combinedWorkspace();
49 const DataObjects::EventList &getSpectrum(const size_t workspace_index, const size_t periodNumber) const;
50 DataObjects::EventList &getSpectrum(const size_t workspace_index, const size_t periodNumber);
51 void setGeometryFlag(const int flag);
52 void setThickness(const float flag);
53 void setHeight(const float flag);
54 void setWidth(const float flag);
55 void setSpectrumNumbersFromUniqueSpectra(const std::set<int> &uniqueSpectra);
56 void setSpectrumNumberForAllPeriods(const size_t spectrumNumber, const specnum_t specid);
57 void setDetectorIdsForAllPeriods(const size_t spectrumNumber, const detid_t id);
58
59 Geometry::Instrument_const_sptr getInstrument() const;
60 const API::Run &run() const;
61 API::Run &mutableRun();
62 API::Sample &mutableSample();
63 DataObjects::EventList &getSpectrum(const size_t index);
64 const DataObjects::EventList &getSpectrum(const size_t index) const;
65 Mantid::API::Axis *getAxis(const size_t &i) const;
66 size_t getNumberHistograms() const;
67
68 std::vector<size_t> getSpectrumToWorkspaceIndexVector(Mantid::specnum_t &offset) const;
69
70 std::vector<size_t> getDetectorIDToWorkspaceIndexVector(Mantid::specnum_t &offset, bool dothrow) const;
71 Types::Core::DateAndTime getFirstPulseTime() const;
72 void setAllX(const HistogramData::BinEdges &x);
73 size_t getNumberEvents() const;
74 void setIndexInfo(const Indexing::IndexInfo &indexInfo);
75 void setInstrument(const Geometry::Instrument_const_sptr &inst);
76 void setMonitorWorkspace(const std::shared_ptr<API::MatrixWorkspace> &monitorWS);
77 void updateSpectraUsing(const API::SpectrumDetectorMapping &map);
78 void setTitle(const std::string &title);
79 void applyFilterInPlace(const boost::function<void(API::MatrixWorkspace_sptr)> &func);
80 void applyFilter(const boost::function<DataObjects::EventWorkspace_sptr(DataObjects::EventWorkspace_sptr)> &func);
81 virtual bool threadSafe() const;
82};
83
84using EventWorkspaceCollection_sptr = std::shared_ptr<EventWorkspaceCollection>;
85using EventWorkspaceCollection_uptr = std::unique_ptr<EventWorkspaceCollection>;
86
87} // namespace DataHandling
88} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Class to represent the axis of a workspace.
Definition: Axis.h:30
This class stores information regarding an experimental run as a series of log entries.
Definition: Run.h:38
This class stores information about the sample used in particular run.
Definition: Sample.h:33
A minimal class to hold the mapping between the spectrum number and its related detector ID numbers f...
EventWorkspaceCollection : Collection of EventWorspaces to give backward-forward compatibility around...
EventWorkspaceCollection(const EventWorkspaceCollection &other)=delete
std::vector< DataObjects::EventWorkspace_sptr > m_WsVec
Vector of EventWorkspaces.
EventWorkspaceCollection & operator=(const EventWorkspaceCollection &other)=delete
A class for holding :
Definition: EventList.h:56
A specialised Property class for holding a series of time-value pairs.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< EventWorkspaceCollection > EventWorkspaceCollection_sptr
std::unique_ptr< EventWorkspaceCollection > EventWorkspaceCollection_uptr
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
std::enable_if< std::is_pointer< Arg >::value, bool >::type threadSafe(Arg workspace)
Thread-safety check Checks the workspace to ensure it is suitable for multithreaded access.
Definition: MultiThreaded.h:22
Helper class which provides the Collimation Length for SANS instruments.
int32_t specnum_t
Typedef for a spectrum Number.
Definition: IDTypes.h:16