Mantid
|
The class PeaksWorkspace stores information about a set of SCD peaks. More...
#include <PeaksWorkspace.h>
Public Types | |
using | ColumnAndDirection = std::pair< std::string, bool > |
Public Member Functions | |
void | addPeak (const Geometry::IPeak &peak) override |
Add a peak to the list. More... | |
void | addPeak (const Kernel::V3D &position, const Kernel::SpecialCoordinateSystem &frame) override |
Add a peak to the list. More... | |
void | addPeak (Peak &&peak) |
Move a peak object into this peaks workspace. More... | |
void | appendFile (std::string filename, Geometry::Instrument_sptr inst) |
std::unique_ptr< PeaksWorkspace > | clone () const |
Returns a clone of the workspace. More... | |
std::unique_ptr< PeaksWorkspace > | cloneEmpty () const |
Returns a default-initialized clone of the workspace. More... | |
size_t | columnCount () const override |
Number of columns in the workspace. More... | |
API::ITableWorkspace_sptr | createDetectorTable () const override |
Creates a new TableWorkspace giving the IDs of the detectors that contribute to the peaks within the workspace. More... | |
IPeak_uptr | createPeak () const override |
Create a Peak using default values. More... | |
IPeak_uptr | createPeak (const Kernel::V3D &Position, const Kernel::SpecialCoordinateSystem &frame) const override |
Creates an instance of a Peak BUT DOES NOT ADD IT TO THE WORKSPACE. More... | |
IPeak_uptr | createPeak (const Kernel::V3D &QLabFrame, boost::optional< double > detectorDistance=boost::none) const override |
Creates an instance of a Peak BUT DOES NOT ADD IT TO THE WORKSPACE. More... | |
IPeak_uptr | createPeakHKL (const Kernel::V3D &HKL) const override |
Create a Peak from a HKL value provided by the client. More... | |
IPeak_uptr | createPeakQSample (const Kernel::V3D &position) const override |
Creates an instance of a Peak BUT DOES NOT ADD IT TO THE WORKSPACE. More... | |
bool | customSort () const override |
std::shared_ptr< const Mantid::API::Column > | getColumn (const std::string &name) const override |
Gets the shared pointer to a column by name. More... | |
std::shared_ptr< Mantid::API::Column > | getColumn (const std::string &name) override |
Gets the shared pointer to a column by name. More... | |
API::Column_const_sptr | getColumn (size_t index) const override |
Gets the shared pointer to a column by index - return none-modifyable column. More... | |
std::shared_ptr< Mantid::API::Column > | getColumn (size_t index) override |
Gets the shared pointer to a column by index. More... | |
virtual size_t | getColumnIndex (const std::string &name) const |
std::vector< std::string > | getColumnNames () const override |
Returns a vector of all column names. More... | |
std::string | getConvention () const override |
API::LogManager_const_sptr | getLogs () const override |
Get constant access to shared pointer containing workspace porperties; Copies logs into new LogManager variable Meaningfull only for some multithereaded methods when a thread wants to have its own copy of logs. More... | |
size_t | getMemorySize () const override |
Return the memory used in bytes. More... | |
int | getNumberPeaks () const override |
const Peak & | getPeak (int peakNum) const override |
Return a const reference to the Peak. More... | |
Peak & | getPeak (int peakNum) override |
Return a reference to the Peak. More... | |
std::vector< Peak > & | getPeaks () |
Return a reference to the Peaks vector. More... | |
const std::vector< Peak > & | getPeaks () const |
Return a const reference to the Peaks vector. More... | |
Kernel::SpecialCoordinateSystem | getSpecialCoordinateSystem () const override |
Get the special coordinate system. More... | |
bool | hasIntegratedPeaks () const override |
Getter for the integration status. More... | |
const std::string | id () const override |
Return the workspace typeID. More... | |
API::LogManager_sptr | logs () override |
Get access to shared pointer containing workspace porperties. More... | |
PeaksWorkspace & | operator= (const PeaksWorkspace &other)=delete |
std::vector< std::pair< std::string, std::string > > | peakInfo (const Kernel::V3D &qFrame, bool labCoords) const override |
Returns selected information for a "peak" at QLabFrame. More... | |
int | peakInfoNumber (const Kernel::V3D &qFrame, bool labCoords) const override |
Returns selected information for a "peak" at QLabFrame. More... | |
PeaksWorkspace () | |
Constructor. More... | |
void | removePeak (int peakNum) override |
Removes the indicated peak. More... | |
void | removePeaks (std::vector< int > badPeaks) override |
Removes multiple peaks. More... | |
size_t | rowCount () const override |
Number of rows in the workspace. More... | |
void | saveNexus (::NeXus::File *file) const override |
void | setCoordinateSystem (const Kernel::SpecialCoordinateSystem coordinateSystem) override |
Set the special coordinate system. More... | |
void | sort (std::vector< ColumnAndDirection > &criteria) override |
Sort the peaks by one or more criteria. More... | |
bool | threadSafe () const override |
This is always threadsafe. More... | |
Public Member Functions inherited from Mantid::API::IPeaksWorkspace | |
virtual void | addPeak (const Kernel::V3D &position, const Kernel::SpecialCoordinateSystem &frame)=0 |
Add a peak to the list. More... | |
virtual void | addPeak (const Mantid::Geometry::IPeak &ipeak)=0 |
Add a peak to the list. More... | |
IPeaksWorkspace_uptr | clone () const |
Returns a clone of the workspace. More... | |
virtual API::ITableWorkspace_sptr | createDetectorTable () const =0 |
Creates a new TableWorkspace giving the IDs of the detectors that contribute to the peak. More... | |
virtual std::unique_ptr< Geometry::IPeak > | createPeak () const =0 |
Create an instance of a peak using default constructor. More... | |
virtual std::unique_ptr< Mantid::Geometry::IPeak > | createPeak (const Mantid::Kernel::V3D &position, const Mantid::Kernel::SpecialCoordinateSystem &frame) const =0 |
Create an instance of a Peak. More... | |
virtual std::unique_ptr< Geometry::IPeak > | createPeak (const Mantid::Kernel::V3D &QLabFrame, boost::optional< double > detectorDistance=boost::none) const =0 |
Create an instance of a Peak. More... | |
virtual std::unique_ptr< Geometry::IPeak > | createPeakHKL (const Mantid::Kernel::V3D &HKL) const =0 |
Create an instance of a peak using a V3D. More... | |
virtual std::unique_ptr< Mantid::Geometry::IPeak > | createPeakQSample (const Mantid::Kernel::V3D &position) const =0 |
Create an instance of a Peak. More... | |
virtual std::string | getConvention () const =0 |
virtual int | getNumberPeaks () const =0 |
virtual const Mantid::Geometry::IPeak & | getPeak (int peakNum) const =0 |
Return a reference to the Peak (const version) More... | |
virtual Mantid::Geometry::IPeak & | getPeak (int peakNum)=0 |
Return a reference to the Peak. More... | |
Mantid::Geometry::IPeak * | getPeakPtr (const int peakNum) |
Return a pointer to the Peak. More... | |
virtual Kernel::SpecialCoordinateSystem | getSpecialCoordinateSystem () const =0 |
Get the special coordinate system. More... | |
virtual bool | hasIntegratedPeaks () const =0 |
Determine if the workspace has been integrated using a peaks integration algorithm. More... | |
IPeaksWorkspace () | |
Ctor. More... | |
IPeaksWorkspace & | operator= (const IPeaksWorkspace &other)=delete |
virtual std::vector< std::pair< std::string, std::string > > | peakInfo (const Kernel::V3D &QFrame, bool labCoords) const =0 |
virtual int | peakInfoNumber (const Kernel::V3D &qLabFrame, bool labCoords) const =0 |
virtual void | removePeak (int peakNum)=0 |
Removes the indicated peak. More... | |
virtual void | removePeaks (std::vector< int > badPeaks)=0 |
virtual void | saveNexus (::NeXus::File *file) const =0 |
virtual void | setCoordinateSystem (const Kernel::SpecialCoordinateSystem coordinateSystem)=0 |
Set the special coordinate system. More... | |
Public Member Functions inherited from Mantid::API::ITableWorkspace | |
virtual Column_sptr | addColumn (const std::string &type, const std::string &name)=0 |
Creates a new column. More... | |
virtual bool | addColumns (const std::string &type, const std::string &name, size_t n) |
Creates n new columns of the same type. More... | |
TableRowHelper | appendRow () |
Appends a row. More... | |
Boolean & | Bool (size_t row, size_t col) |
Get the reference to the element in row row and column col if its type is bool . More... | |
template<class T > | |
T & | cell (size_t row, size_t col) |
Get the reference to the element in row row and column col . More... | |
ITableWorkspace_uptr | clone () const |
Returns a clone of the workspace. More... | |
ITableWorkspace_uptr | cloneColumns (const std::vector< std::string > &colNames) const |
Returns a clone of the workspace. More... | |
ITableWorkspace_uptr | cloneEmpty () const |
Returns a default-initialized clone of the workspace. More... | |
virtual size_t | columnCount () const =0 |
Number of columns in the workspace. More... | |
virtual bool | customSort () const |
Does this type of TableWorkspace need a custom sorting call (e.g. More... | |
double & | Double (size_t row, size_t col) |
Get the reference to the element in row row and column col if its type is double . More... | |
virtual void | find (API::Boolean value, size_t &row, size_t col)=0 |
find method to get the index of API::Boolean value cell in a table workspace More... | |
virtual void | find (const Mantid::Kernel::V3D &value, size_t &row, size_t col)=0 |
find method to get the index of Mantid::Kernel::V3D cell value in a table workspace More... | |
virtual void | find (const std::string &value, size_t &row, size_t col)=0 |
find method to get the index of cellstd::string value in a table workspace More... | |
virtual void | find (double value, size_t &row, size_t col)=0 |
find method to get the index of double cell value in a table workspace More... | |
virtual void | find (float value, size_t &row, size_t col)=0 |
find method to get the index of float cell value in a table workspace More... | |
virtual void | find (size_t value, size_t &row, size_t col)=0 |
find method to get the index of integer cell value in a table workspace More... | |
virtual Column_const_sptr | getColumn (const std::string &name) const =0 |
Gets the shared pointer to a column by name. More... | |
virtual Column_sptr | getColumn (const std::string &name)=0 |
Gets the shared pointer to a column by name. More... | |
virtual Column_const_sptr | getColumn (size_t index) const =0 |
Gets the shared pointer to a column by index - return none-modifyable column. More... | |
virtual Column_sptr | getColumn (size_t index)=0 |
Gets the shared pointer to a column by index. More... | |
virtual std::vector< std::string > | getColumnNames () const =0 |
Returns a vector of all column names. More... | |
TableRowHelper | getFirstRow () |
Creates a TableRow object for the first row (row == 0). More... | |
virtual API::LogManager_const_sptr | getLogs () const =0 |
Get constant access to shared pointer containing workspace properties. More... | |
template<class T > | |
T & | getRef (const std::string &name, size_t index) |
Get a reference to a data element. More... | |
TableRowHelper | getRow (size_t row) |
Creates a TableRow object for row row. More... | |
TableColumnHelper | getVector (const std::string &name) |
Access the column with name name trough a ColumnVector object. More... | |
TableConstColumnHelper | getVector (const std::string &name) const |
Access the column with name name trough a ColumnVector object. More... | |
const std::string | id () const override |
Return the workspace typeID. More... | |
virtual size_t | insertRow (size_t index)=0 |
Inserts a row before row pointed to by index and fills it with default vales. More... | |
int & | Int (size_t row, size_t col) |
Get the reference to the element in row row and column col if its type is int . More... | |
ITableWorkspace () | |
Constructor. More... | |
virtual API::LogManager_sptr | logs ()=0 |
Get access to shared pointer containing workspace properties. More... | |
void | modified () |
If the workspace is the AnalysisDataService sends AfterReplaceNotification. More... | |
ITableWorkspace & | operator= (const ITableWorkspace &)=delete |
virtual void | removeColumn (const std::string &name)=0 |
Removes a column. More... | |
virtual void | removeRow (size_t index)=0 |
Delets a row if it exists. More... | |
virtual size_t | rowCount () const =0 |
Number of rows in the workspace. More... | |
virtual void | setRowCount (size_t count)=0 |
Resizes the workspace. More... | |
virtual void | sort (std::vector< std::pair< std::string, bool > > &criteria) |
Overridable method to custom-sort the workspace. More... | |
std::string & | String (size_t row, size_t col) |
Get the reference to the element in row row and column col if its type is std::string . More... | |
const std::string | toString () const override |
Serializes the object to a string. 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 WorkspaceHistory & | getHistory () 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... | |
WorkspaceHistory & | history () |
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 |
Workspace & | operator= (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::ExperimentInfo | |
virtual ExperimentInfo * | cloneExperimentInfo () const |
Clone us. More... | |
const Geometry::ComponentInfo & | componentInfo () const |
const Geometry::ParameterMap & | constInstrumentParameters () const |
Const version. More... | |
void | copyExperimentInfoFrom (const ExperimentInfo *other) |
Copy everything from the given experiment object. More... | |
const Geometry::DetectorInfo & | detectorInfo () 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 > ¶meterNames) 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::Property * | getLog (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::ParameterMap & | instrumentParameters () |
Returns a modifiable set of instrument parameters. More... | |
const Geometry::ParameterMap & | instrumentParameters () 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 ¶meterStr) |
Loads an experiment description from the open NeXus file. More... | |
void | loadExperimentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string ¶meterStr, 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 ¶meterStr) |
Load the instrument from an open NeXus file. More... | |
void | loadInstrumentParametersNexus (::NeXus::File *file, std::string ¶meterStr) |
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::ComponentInfo & | mutableComponentInfo () |
Geometry::DetectorInfo & | mutableDetectorInfo () |
Return a non-const reference to the DetectorInfo object. More... | |
Run & | mutableRun () |
Writable version of the run object. More... | |
Sample & | mutableSample () |
Writable version of the sample object. More... | |
SpectrumInfo & | mutableSpectrumInfo () |
Return a non-const reference to the SpectrumInfo object. More... | |
ExperimentInfo & | operator= (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 ¶meterStr) |
Populate the parameter map given a string. More... | |
const Run & | run () const |
Run details object access. More... | |
const Sample & | sample () 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< Run > | sharedRun () |
Return the cow ptr of the run. More... | |
const SpectrumInfo & | spectrumInfo () 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 | |
PeaksWorkspace (const PeaksWorkspace &other) | |
Protected copy constructor. May be used by childs for cloning. More... | |
Protected Member Functions inherited from Mantid::API::IPeaksWorkspace | |
IPeaksWorkspace (const IPeaksWorkspace &)=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::ITableWorkspace | |
void | insertInColumn (Column *c, size_t index) |
Insert a new element into a column. More... | |
ITableWorkspace (const ITableWorkspace &)=default | |
Protected copy constructor. May be used by childs for cloning. More... | |
void | removeFromColumn (Column *c, size_t index) |
Remove an element from a column. More... | |
void | resizeColumn (Column *c, size_t size) |
Resize a column. 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::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 | |
API::Column_sptr | addColumn (const std::string &, const std::string &) override |
Creates a new column. More... | |
bool | addColumns (const std::string &, const std::string &, size_t) override |
Creates n new columns of the same type. More... | |
void | addPeakColumn (const std::string &name) |
Adds a new PeakColumn of the given type. More... | |
PeaksWorkspace * | doClone () const override |
Virtual clone method. Not implemented to force implementation in children. More... | |
ITableWorkspace * | doCloneColumns (const std::vector< std::string > &colNames) const override |
PeaksWorkspace * | doCloneEmpty () const override |
Virtual cloneEmpty method. More... | |
void | find (API::Boolean, size_t &, size_t) override |
find method to get the index of API::Boolean value cell in a table workspace More... | |
void | find (const Mantid::Kernel::V3D &, size_t &, size_t) override |
find method to get the index of Mantid::Kernel::V3D cell value in a table workspace More... | |
void | find (const std::string &, size_t &, size_t) override |
find method to get the index of cellstd::string value in a table workspace More... | |
void | find (double, size_t &, size_t) override |
find method to get the index of double cell value in a table workspace More... | |
void | find (float, size_t &, size_t) override |
find method to get the index of float cell value in a table workspace More... | |
void | find (size_t, size_t &, size_t) override |
find method to get the index of integer cell value in a table workspace More... | |
void | initColumns () |
Initialize the table structure. More... | |
size_t | insertRow (size_t) override |
Inserts a row before row pointed to by index and fills it with default vales. More... | |
void | removeColumn (const std::string &) override |
Removes a column. More... | |
void | removeRow (size_t) override |
Delets a row if it exists. More... | |
void | setRowCount (size_t) override |
Resizes the workspace. More... | |
Private Attributes | |
std::vector< std::string > | m_columnNames |
Column names. More... | |
std::vector< std::shared_ptr< Mantid::DataObjects::PeakColumn< Peak > > > | m_columns |
Column shared pointers. More... | |
Kernel::SpecialCoordinateSystem | m_coordSystem |
Coordinates. More... | |
std::vector< Peak > | m_peaks |
Vector of Peak contained within. More... | |
Additional Inherited Members | |
Public Attributes inherited from Mantid::API::IPeaksWorkspace | |
std::string | m_convention |
Protected Attributes inherited from Mantid::API::ExperimentInfo | |
std::shared_ptr< Geometry::ParameterMap > | m_parmap |
Parameters modifying the base instrument. More... | |
Geometry::Instrument_const_sptr | sptr_instrument |
The base (unparametrized) instrument. More... | |
The class PeaksWorkspace stores information about a set of SCD peaks.
Definition at line 37 of file PeaksWorkspace.h.
using Mantid::DataObjects::PeaksWorkspace::ColumnAndDirection = std::pair<std::string, bool> |
Definition at line 39 of file PeaksWorkspace.h.
Mantid::DataObjects::PeaksWorkspace::PeaksWorkspace | ( | ) |
Constructor.
Create a table with all the required columns.
Definition at line 39 of file PeaksWorkspace.cpp.
|
protected |
Protected copy constructor. May be used by childs for cloning.
Copy constructor.
other | :: other PeaksWorkspace to copy from |
Definition at line 51 of file PeaksWorkspace.cpp.
References initColumns(), and Mantid::API::ExperimentInfo::setNumberOfDetectorGroups().
|
inlineoverrideprivatevirtual |
Creates a new column.
type | :: The datatype of the column |
name | :: The name to assign to the column |
Implements Mantid::API::ITableWorkspace.
Definition at line 174 of file PeaksWorkspace.h.
|
inlineoverrideprivatevirtual |
Creates n new columns of the same type.
type | :: The datatype of the column |
name | :: The name to assign to the column |
n | :: The number of columns to create |
Reimplemented from Mantid::API::ITableWorkspace.
Definition at line 178 of file PeaksWorkspace.h.
|
overridevirtual |
Add a peak to the list.
ipeak | :: Peak object to add (copy) into this. |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 159 of file PeaksWorkspace.cpp.
References m_peaks.
Referenced by addPeak().
|
overridevirtual |
Add a peak to the list.
position | :: position on the peak in the specified coordinate frame |
frame | :: the coordinate frame that the position is specified in |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 172 of file PeaksWorkspace.cpp.
References addPeak(), createPeak(), and position.
void Mantid::DataObjects::PeaksWorkspace::addPeak | ( | Peak && | peak | ) |
Move a peak object into this peaks workspace.
Add a peak to the list.
peak | :: Peak object to add (move) into this. |
Definition at line 181 of file PeaksWorkspace.cpp.
References m_peaks.
|
private |
Adds a new PeakColumn of the given type.
Add a PeakColumn.
name | :: The name of the column |
Definition at line 620 of file PeaksWorkspace.cpp.
References m_columnNames, m_columns, and m_peaks.
Referenced by initColumns().
void Mantid::DataObjects::PeaksWorkspace::appendFile | ( | std::string | filename, |
Geometry::Instrument_sptr | inst | ||
) |
|
inline |
Returns a clone of the workspace.
Definition at line 61 of file PeaksWorkspace.h.
|
inline |
Returns a default-initialized clone of the workspace.
Definition at line 64 of file PeaksWorkspace.h.
|
inlineoverridevirtual |
Number of columns in the workspace.
Implements Mantid::API::ITableWorkspace.
Definition at line 119 of file PeaksWorkspace.h.
|
overridevirtual |
Creates a new TableWorkspace giving the IDs of the detectors that contribute to the peaks within the workspace.
Creates a new TableWorkspace with detailing the contributing Detector IDs.
The table will have 2 columns: Index & DetectorID, where Index maps into the current index within the PeaksWorkspace of the peak
Implements Mantid::API::IPeaksWorkspace.
Definition at line 567 of file PeaksWorkspace.cpp.
References Mantid::DataObjects::Peak::getContributingDetIDs(), Mantid::Kernel::SingletonHolder< T >::Instance(), m_peaks, nrows, and rowCount().
|
overridevirtual |
Create a Peak using default values.
Implements Mantid::API::IPeaksWorkspace.
Definition at line 485 of file PeaksWorkspace.cpp.
Referenced by addPeak(), createPeak(), and peakInfo().
|
overridevirtual |
Creates an instance of a Peak BUT DOES NOT ADD IT TO THE WORKSPACE.
position | :: position of the center of the peak, in reciprocal space |
frame | :: the coordinate system that the position is specified in detector. You do NOT need to explicitly provide this distance. |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 233 of file PeaksWorkspace.cpp.
References createPeak(), createPeakHKL(), createPeakQSample(), Mantid::Kernel::HKL, position, and Mantid::Kernel::QLab.
|
overridevirtual |
Creates an instance of a Peak BUT DOES NOT ADD IT TO THE WORKSPACE.
QLabFrame | :: Q of the center of the peak, in reciprocal space |
detectorDistance | :: optional distance between the sample and the detector. You do NOT need to explicitly provide this distance. |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 214 of file PeaksWorkspace.cpp.
References Mantid::API::ExperimentInfo::getInstrument(), Mantid::API::ExperimentInfo::getRunNumber(), and Mantid::API::ExperimentInfo::run().
|
overridevirtual |
Create a Peak from a HKL value provided by the client.
HKL | : reciprocal lattice vector coefficients |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 455 of file PeaksWorkspace.cpp.
References Mantid::API::Run::getGoniometer(), Mantid::API::ExperimentInfo::getInstrument(), Mantid::API::Sample::getOrientedLattice(), Mantid::API::ExperimentInfo::getRunNumber(), Mantid::API::ExperimentInfo::run(), and Mantid::API::ExperimentInfo::sample().
Referenced by createPeak().
|
overridevirtual |
Creates an instance of a Peak BUT DOES NOT ADD IT TO THE WORKSPACE.
position | :: QSample position of the center of the peak, in reciprocal space detector. You do NOT need to explicitly provide this distance. |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 251 of file PeaksWorkspace.cpp.
References Mantid::Geometry::Goniometer::calcFromQSampleAndWavelength(), Mantid::Kernel::DeltaEMode::Elastic, Mantid::API::g_log, Mantid::Geometry::Goniometer::getEulerAngles(), Mantid::API::Run::getGoniometer(), Mantid::API::ExperimentInfo::getInstrument(), getLogs(), Mantid::Geometry::Goniometer::getR(), Mantid::API::ExperimentInfo::getRunNumber(), Mantid::Kernel::Logger::information(), position, Mantid::API::ExperimentInfo::run(), and Mantid::Kernel::UnitConversion::run().
Referenced by createPeak().
|
inlineoverridevirtual |
Reimplemented from Mantid::API::ITableWorkspace.
Definition at line 70 of file PeaksWorkspace.h.
|
inlineoverrideprivatevirtual |
Virtual clone method. Not implemented to force implementation in children.
Implements Mantid::API::IPeaksWorkspace.
Definition at line 161 of file PeaksWorkspace.h.
|
overrideprivatevirtual |
Implements Mantid::API::ITableWorkspace.
Definition at line 927 of file PeaksWorkspace.cpp.
|
inlineoverrideprivatevirtual |
Virtual cloneEmpty method.
Not implemented to force implementation in children.
Implements Mantid::API::ITableWorkspace.
Definition at line 162 of file PeaksWorkspace.h.
|
inlineoverrideprivatevirtual |
find method to get the index of API::Boolean value cell in a table workspace
Implements Mantid::API::ITableWorkspace.
Definition at line 213 of file PeaksWorkspace.h.
|
inlineoverrideprivatevirtual |
find method to get the index of Mantid::Kernel::V3D cell value in a table workspace
Implements Mantid::API::ITableWorkspace.
Definition at line 223 of file PeaksWorkspace.h.
|
inlineoverrideprivatevirtual |
find method to get the index of cellstd::string value in a table workspace
Implements Mantid::API::ITableWorkspace.
Definition at line 218 of file PeaksWorkspace.h.
|
inlineoverrideprivatevirtual |
find method to get the index of double cell value in a table workspace
Implements Mantid::API::ITableWorkspace.
Definition at line 204 of file PeaksWorkspace.h.
|
inlineoverrideprivatevirtual |
find method to get the index of float cell value in a table workspace
Implements Mantid::API::ITableWorkspace.
Definition at line 208 of file PeaksWorkspace.h.
|
inlineoverrideprivatevirtual |
find method to get the index of integer cell value in a table workspace
Implements Mantid::API::ITableWorkspace.
Definition at line 200 of file PeaksWorkspace.h.
|
inlineoverridevirtual |
Gets the shared pointer to a column by name.
Implements Mantid::API::ITableWorkspace.
Definition at line 130 of file PeaksWorkspace.h.
|
inlineoverridevirtual |
Gets the shared pointer to a column by name.
Implements Mantid::API::ITableWorkspace.
Definition at line 125 of file PeaksWorkspace.h.
|
overridevirtual |
Gets the shared pointer to a column by index - return none-modifyable column.
Gets the shared pointer to a column by index.
Implements Mantid::API::ITableWorkspace.
Definition at line 646 of file PeaksWorkspace.cpp.
|
overridevirtual |
Gets the shared pointer to a column by index.
Implements Mantid::API::ITableWorkspace.
Definition at line 638 of file PeaksWorkspace.cpp.
|
virtual |
Definition at line 629 of file PeaksWorkspace.cpp.
References m_columns.
|
inlineoverridevirtual |
Returns a vector of all column names.
Implements Mantid::API::ITableWorkspace.
Definition at line 148 of file PeaksWorkspace.h.
|
overridevirtual |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 126 of file PeaksWorkspace.cpp.
References Mantid::API::IPeaksWorkspace::m_convention.
Referenced by saveNexus().
|
overridevirtual |
Get constant access to shared pointer containing workspace porperties; Copies logs into new LogManager variable Meaningfull only for some multithereaded methods when a thread wants to have its own copy of logs.
Implements Mantid::API::ITableWorkspace.
Definition at line 923 of file PeaksWorkspace.cpp.
References Mantid::API::ExperimentInfo::run().
Referenced by createPeakQSample().
|
overridevirtual |
Return the memory used in bytes.
Implements Mantid::API::Workspace.
Definition at line 557 of file PeaksWorkspace.cpp.
References getNumberPeaks().
|
overridevirtual |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 121 of file PeaksWorkspace.cpp.
References m_peaks.
Referenced by getMemorySize(), peakInfo(), peakInfoNumber(), and Mantid::Crystal::CentroidPeaks::removeEdgePeaks().
|
overridevirtual |
Return a const reference to the Peak.
peakNum | :: index of the peak to get. |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 200 of file PeaksWorkspace.cpp.
References m_peaks.
|
overridevirtual |
Return a reference to the Peak.
peakNum | :: index of the peak to get. |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 188 of file PeaksWorkspace.cpp.
References m_peaks.
Referenced by peakInfo(), peakInfoNumber(), and Mantid::Crystal::CentroidPeaks::removeEdgePeaks().
std::vector< Peak > & Mantid::DataObjects::PeaksWorkspace::getPeaks | ( | ) |
Return a reference to the Peaks vector.
Definition at line 537 of file PeaksWorkspace.cpp.
References m_peaks.
const std::vector< Peak > & Mantid::DataObjects::PeaksWorkspace::getPeaks | ( | ) | const |
Return a const reference to the Peaks vector.
Definition at line 540 of file PeaksWorkspace.cpp.
References m_peaks.
|
overridevirtual |
Get the special coordinate system.
Implements Mantid::API::IPeaksWorkspace.
Definition at line 911 of file PeaksWorkspace.cpp.
References m_coordSystem.
|
overridevirtual |
Getter for the integration status.
Implements Mantid::API::IPeaksWorkspace.
Definition at line 545 of file PeaksWorkspace.cpp.
References Mantid::API::ExperimentInfo::run(), and value.
|
inlineoverridevirtual |
Return the workspace typeID.
Reimplemented from Mantid::API::ITableWorkspace.
Definition at line 42 of file PeaksWorkspace.h.
|
private |
Initialize the table structure.
Initialize all columns.
Definition at line 591 of file PeaksWorkspace.cpp.
References addPeakColumn().
Referenced by PeaksWorkspace().
|
inlineoverrideprivatevirtual |
Inserts a row before row pointed to by index and fills it with default vales.
Implements Mantid::API::ITableWorkspace.
Definition at line 191 of file PeaksWorkspace.h.
|
overridevirtual |
Get access to shared pointer containing workspace porperties.
This function is there to provide common interface of iTableWorkspace Despite it is non-constant method, one should be very carefull using it to change the log values when cloning of a table workspace can occur as the changes may depend on the order of PeakWorkspace cloning & changes applyed through this pointer. See PeakWorkspaceTest (test_getSetLogAccess) – for example of this behaviour. Use mutableRun interface to change log values rather then this method.
Implements Mantid::API::ITableWorkspace.
Definition at line 918 of file PeaksWorkspace.cpp.
References Mantid::API::ExperimentInfo::mutableRun().
|
delete |
|
overridevirtual |
Returns selected information for a "peak" at QLabFrame.
qFrame | An arbitrary position in Q-space. This does not have to be the position of a peak. |
labCoords | Set true if the position is in the lab coordinate system, false if it is in the sample coordinate system. |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 298 of file PeaksWorkspace.cpp.
References createPeak(), Mantid::Kernel::V3D::distance(), Mantid::Geometry::Goniometer::getEulerAngles(), Mantid::DataObjects::BasePeak::getGoniometerMatrix(), getNumberPeaks(), Mantid::API::Sample::getOrientedLattice(), getPeak(), Mantid::DataObjects::Peak::getQLabFrame(), Mantid::DataObjects::Peak::getQSampleFrame(), Mantid::DataObjects::BasePeak::getRunNumber(), Mantid::Geometry::OrientedLattice::getUB(), Mantid::Kernel::Matrix< T >::Invert(), Mantid::Kernel::V3D::norm(), Mantid::API::ExperimentInfo::run(), Mantid::API::ExperimentInfo::sample(), and std::to_string().
|
overridevirtual |
Returns selected information for a "peak" at QLabFrame.
qFrame | An arbitrary position in Q-space. This does not have to be the position of a peak. |
labCoords | Set true if the position is in the lab coordinate system, false if it is in the sample coordinate system. |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 502 of file PeaksWorkspace.cpp.
References Mantid::Kernel::V3D::distance(), getNumberPeaks(), getPeak(), Mantid::DataObjects::Peak::getQLabFrame(), Mantid::DataObjects::Peak::getQSampleFrame(), and Mantid::Kernel::V3D::norm().
|
inlineoverrideprivatevirtual |
Removes a column.
Implements Mantid::API::ITableWorkspace.
Definition at line 182 of file PeaksWorkspace.h.
|
overridevirtual |
Removes the indicated peak.
peakNum | the peak to remove. peakNum starts at 0 |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 132 of file PeaksWorkspace.cpp.
References m_peaks.
|
overridevirtual |
Removes multiple peaks.
badPeaks | peaks to be removed |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 142 of file PeaksWorkspace.cpp.
References m_peaks.
Referenced by Mantid::Crystal::CentroidPeaks::removeEdgePeaks().
|
inlineoverrideprivatevirtual |
Delets a row if it exists.
Implements Mantid::API::ITableWorkspace.
Definition at line 195 of file PeaksWorkspace.h.
|
inlineoverridevirtual |
Number of rows in the workspace.
Implements Mantid::API::ITableWorkspace.
Definition at line 122 of file PeaksWorkspace.h.
Referenced by createDetectorTable().
|
overridevirtual |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 652 of file PeaksWorkspace.cpp.
References Mantid::DataObjects::BasePeak::getAbsorptionWeightedPathLength(), Mantid::DataObjects::BasePeak::getBinCount(), getConvention(), Mantid::DataObjects::Peak::getDetectorID(), Mantid::DataObjects::Peak::getDSpacing(), Mantid::DataObjects::Peak::getFinalEnergy(), Mantid::DataObjects::BasePeak::getGoniometerMatrix(), Mantid::DataObjects::BasePeak::getH(), Mantid::DataObjects::Peak::getInitialEnergy(), Mantid::DataObjects::BasePeak::getIntensity(), Mantid::DataObjects::BasePeak::getK(), Mantid::DataObjects::BasePeak::getL(), Mantid::DataObjects::BasePeak::getPeakNumber(), Mantid::DataObjects::BasePeak::getPeakShape(), Mantid::DataObjects::BasePeak::getRunNumber(), Mantid::DataObjects::Peak::getScattering(), Mantid::DataObjects::BasePeak::getSigmaIntensity(), Mantid::DataObjects::Peak::getTOF(), Mantid::DataObjects::Peak::getWavelength(), m_coordSystem, m_peaks, Mantid::API::TOF, and Mantid::Geometry::PeakShape::toJSON().
|
overridevirtual |
Set the special coordinate system.
Set the special Q3D coordinate system.
coordinateSystem | : Option to set. |
Implements Mantid::API::IPeaksWorkspace.
Definition at line 904 of file PeaksWorkspace.cpp.
References m_coordSystem.
|
inlineoverrideprivatevirtual |
Resizes the workspace.
Implements Mantid::API::ITableWorkspace.
Definition at line 187 of file PeaksWorkspace.h.
|
override |
Sort the peaks by one or more criteria.
criteria | : a vector with a list of pairs: column name, bool; where bool = true for ascending, false for descending sort. The peaks are sorted by the first criterion first, then the 2nd if equal, etc. |
Definition at line 113 of file PeaksWorkspace.cpp.
References m_peaks.
|
inlineoverridevirtual |
This is always threadsafe.
Reimplemented from Mantid::API::Workspace.
Definition at line 150 of file PeaksWorkspace.h.
|
private |
|
private |
Column shared pointers.
Definition at line 234 of file PeaksWorkspace.h.
Referenced by addPeakColumn(), getColumn(), and getColumnIndex().
|
private |
Coordinates.
Definition at line 240 of file PeaksWorkspace.h.
Referenced by getSpecialCoordinateSystem(), saveNexus(), and setCoordinateSystem().
|
private |
Vector of Peak contained within.
Definition at line 231 of file PeaksWorkspace.h.
Referenced by addPeak(), addPeakColumn(), createDetectorTable(), getNumberPeaks(), getPeak(), getPeaks(), removePeak(), removePeaks(), saveNexus(), and sort().