Mantid
|
This is a parent algorithm that uses several different child algorithms to perform it's task. More...
#include <AlignAndFocusPowder.h>
Public Member Functions | |
const std::string | category () const override |
Algorithm's category for identification overriding a virtual method. More... | |
const std::string | name () const override |
Algorithm's name for identification overriding a virtual method. More... | |
const std::vector< std::string > | seeAlso () const override |
const std::string | summary () const override |
Summary of algorithms purpose. More... | |
std::map< std::string, std::string > | validateInputs () override |
int | version () const override |
Algorithm's version for identification overriding a virtual method. More... | |
Public Member Functions inherited from Mantid::API::GenericDataProcessorAlgorithm< Base > | |
GenericDataProcessorAlgorithm () | |
Constructor. More... | |
Kernel::IPropertyManager::TypedValue | getProperty (const std::string &name) const override |
Get the property held by this object. More... | |
std::string | getPropertyValue (const std::string &name) const override |
Get the property held by this object. More... | |
Private Member Functions | |
API::MatrixWorkspace_sptr | conjoinWorkspaces (const API::MatrixWorkspace_sptr &ws1, const API::MatrixWorkspace_sptr &ws2, size_t offset) |
Add workspace2 to workspace1 by adding spectrum. More... | |
void | convertOffsetsToCal (DataObjects::OffsetsWorkspace_sptr &offsetsWS) |
API::MatrixWorkspace_sptr | convertUnits (API::MatrixWorkspace_sptr matrixws, const std::string &target) |
Convert units. More... | |
API::MatrixWorkspace_sptr | diffractionFocus (API::MatrixWorkspace_sptr ws) |
Call diffraction focus to a matrix workspace. More... | |
void | doSortEvents (const Mantid::API::Workspace_sptr &ws) |
Perform SortEvents on the output workspaces but only if they are EventWorkspaces. More... | |
API::MatrixWorkspace_sptr | editInstrument (API::MatrixWorkspace_sptr ws, const std::vector< double > &polars, const std::vector< specnum_t > &specids, const std::vector< double > &l2s, const std::vector< double > &phis) |
Call edit instrument geometry. More... | |
void | exec () override |
Executes the algorithm. More... | |
API::MatrixWorkspace_sptr | filterResonances (API::MatrixWorkspace_sptr matrixws) |
Filter out absorption resonances. More... | |
double | getVecPropertyFromPmOrSelf (const std::string &name, std::vector< double > &avec) |
Function to get a vector property either from a PropertyManager or the algorithm properties. More... | |
void | init () override |
Initialisation method. More... | |
void | loadCalFile (const std::string &calFilename, const std::string &groupFilename) |
Loads the .cal file if necessary. More... | |
API::MatrixWorkspace_sptr | rebin (API::MatrixWorkspace_sptr matrixws) |
Rebin. More... | |
API::MatrixWorkspace_sptr | rebinRagged (API::MatrixWorkspace_sptr matrixws, const bool inDspace) |
RebinRagged this should only be done on the final focussed workspace. More... | |
Private Attributes | |
double | DIFCref {0.0} |
bool | dspace {false} |
std::vector< double > | l2s |
double | LRef {0.0} |
API::ITableWorkspace_sptr | m_calibrationWS |
std::vector< double > | m_delta_ragged |
std::vector< double > | m_dmaxs |
std::vector< double > | m_dmins |
DataObjects::GroupingWorkspace_sptr | m_groupWS |
DataObjects::EventWorkspace_sptr | m_inputEW |
API::MatrixWorkspace_sptr | m_inputW |
std::string | m_instName |
double | m_l1 {0.0} |
DataObjects::EventWorkspace_sptr | m_lowResEW |
Low resolution TOF event workspace. More... | |
size_t | m_lowResSpecOffset {0} |
Offset to low resolution TOF spectra. More... | |
API::MatrixWorkspace_sptr | m_lowResW |
Low resolution TOF matrix workspace. More... | |
DataObjects::MaskWorkspace_sptr | m_maskWS |
DataObjects::EventWorkspace_sptr | m_outputEW |
API::MatrixWorkspace_sptr | m_outputW |
std::vector< double > | m_params |
bool | m_preserveEvents {false} |
bool | m_processLowResTOF {false} |
Flag to process low resolution workspace. More... | |
std::unique_ptr< API::Progress > | m_progress = nullptr |
Progress reporting. More... | |
int | m_resampleX {0} |
std::vector< double > | m_resonanceLower |
std::vector< double > | m_resonanceUpper |
double | maxwl {0.0} |
double | minwl {0.0} |
std::vector< double > | phis |
std::vector< int32_t > | specids |
double | tmax {0.0} |
double | tmin {0.0} |
std::vector< double > | tths |
double | xmax {0.0} |
double | xmin {0.0} |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::API::GenericDataProcessorAlgorithm< Base > | |
Workspace_sptr | assemble (const std::string &partialWSName, const std::string &outputWSName) |
Assemble the partial workspaces from all MPI processes. More... | |
Workspace_sptr | assemble (Workspace_sptr partialWS) |
Assemble the partial workspaces from all MPI processes. More... | |
void | copyProperty (const API::Algorithm_sptr &alg, const std::string &name) |
Copy a property from an existing algorithm. More... | |
std::shared_ptr< Algorithm > | createChildAlgorithm (const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1) override |
Create a Child Algorithm. More... | |
virtual ITableWorkspace_sptr | determineChunk (const std::string &filename) |
MatrixWorkspace_sptr | divide (const MatrixWorkspace_sptr lhs, const double &rhsValue) |
Divide a matrix workspace by a single value. More... | |
MatrixWorkspace_sptr | divide (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs) |
Divide a matrix workspace by another matrix workspace. More... | |
void | forwardProperties () |
int | getNThreads () |
Return the number of MPI processes running. More... | |
std::shared_ptr< Kernel::PropertyManager > | getProcessProperties (const std::string &propertyManager=std::string()) const |
Get the property manager object of a given name from the property manager data service, or create a new one. More... | |
bool | isMainThread () |
Return true if we are running on the main thread. More... | |
Workspace_sptr | load (const std::string &inputData, const bool loadQuiet=false) |
Determine what kind of input data we have and load it. More... | |
virtual MatrixWorkspace_sptr | loadChunk (const size_t rowIndex) |
void | mapPropertyName (const std::string &nameInProp, const std::string &nameInPropManager) |
Declare mapping of property name to name in the PropertyManager. More... | |
MatrixWorkspace_sptr | minus (const MatrixWorkspace_sptr lhs, const double &rhsValue) |
Subract a single value from a matrix workspace. More... | |
MatrixWorkspace_sptr | minus (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs) |
Subract a matrix workspace by another matrix workspace. More... | |
MatrixWorkspace_sptr | multiply (const MatrixWorkspace_sptr lhs, const double &rhsValue) |
Multiply a matrix workspace by a single value. More... | |
MatrixWorkspace_sptr | multiply (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs) |
Multiply a matrix workspace by another matrix workspace. More... | |
MatrixWorkspace_sptr | plus (const MatrixWorkspace_sptr lhs, const double &rhsValue) |
Add a single value to a matrix workspace. More... | |
MatrixWorkspace_sptr | plus (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs) |
Add a matrix workspace to another matrix workspace. More... | |
void | saveNexus (const std::string &outputWSName, const std::string &outputFile) |
Save a workspace as a nexus file, with check for which thread we are executing in. More... | |
void | setAccumAlg (const std::string &alg) |
void | setLoadAlg (const std::string &alg) |
void | setLoadAlgFileProp (const std::string &filePropName) |
void | setPropManagerPropName (const std::string &propName) |
std::vector< std::string > | splitInput (const std::string &input) |
Protected Attributes inherited from Mantid::API::GenericDataProcessorAlgorithm< Base > | |
bool | m_useMPI |
MPI option. If false, we will use one job event if MPI is available. More... | |
This is a parent algorithm that uses several different child algorithms to perform it's task.
Takes a workspace as input and the filename of a grouping file of a suitable format.
Definition at line 28 of file AlignAndFocusPowder.h.
|
inlineoverride |
Algorithm's category for identification overriding a virtual method.
Definition at line 38 of file AlignAndFocusPowder.h.
|
private |
Add workspace2 to workspace1 by adding spectrum.
Definition at line 1046 of file AlignAndFocusPowder.cpp.
References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), Mantid::API::g_log, and Mantid::Kernel::Logger::information().
Referenced by exec().
|
private |
Definition at line 1101 of file AlignAndFocusPowder.cpp.
References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), Mantid::Kernel::SingletonHolder< T >::Instance(), m_calibrationWS, and m_instName.
Referenced by loadCalFile().
|
private |
Convert units.
Definition at line 900 of file AlignAndFocusPowder.cpp.
References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), Mantid::API::g_log, and Mantid::Kernel::Logger::information().
Referenced by exec(), and filterResonances().
|
private |
Call diffraction focus to a matrix workspace.
Definition at line 870 of file AlignAndFocusPowder.cpp.
References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), Mantid::API::g_log, Mantid::Kernel::Logger::information(), m_groupWS, m_maskWS, and m_preserveEvents.
Referenced by exec().
|
private |
Perform SortEvents on the output workspaces but only if they are EventWorkspaces.
ws | :: any Workspace. Does nothing if not EventWorkspace. |
Definition at line 1220 of file AlignAndFocusPowder.cpp.
References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm().
Referenced by exec().
|
private |
Call edit instrument geometry.
Definition at line 840 of file AlignAndFocusPowder.cpp.
References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), Mantid::API::g_log, Mantid::Kernel::Logger::information(), l2s, m_l1, phis, and specids.
Referenced by exec().
|
overrideprivate |
Executes the algorithm.
Exception::FileError | If the grouping file cannot be opened or read successfully |
runtime_error | If unable to run one of the Child Algorithms successfully |
Definition at line 341 of file AlignAndFocusPowder.cpp.
References conjoinWorkspaces(), convertUnits(), Mantid::DataObjects::create(), Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), DIFCref, diffractionFocus(), doSortEvents(), dspace, editInstrument(), Mantid::EMPTY_DBL(), filterResonances(), Mantid::API::g_log, Mantid::API::GenericDataProcessorAlgorithm< Base >::getProperty(), Mantid::API::GenericDataProcessorAlgorithm< Base >::getPropertyValue(), getVecPropertyFromPmOrSelf(), Mantid::Kernel::Logger::information(), Mantid::Kernel::SingletonHolder< T >::Instance(), l2s, loadCalFile(), LRef, m_calibrationWS, m_delta_ragged, m_dmaxs, m_dmins, m_groupWS, m_inputEW, m_inputW, m_instName, m_l1, m_lowResEW, m_lowResSpecOffset, m_lowResW, m_maskWS, m_outputEW, m_outputW, m_params, m_preserveEvents, m_processLowResTOF, m_progress, m_resampleX, m_resonanceLower, maxwl, minwl, phis, rebin(), rebinRagged(), specids, Mantid::WorkflowAlgorithms::splitVectors(), tmax, tmin, tths, Mantid::Kernel::Logger::warning(), xmax, and xmin.
|
private |
Filter out absorption resonances.
Definition at line 916 of file AlignAndFocusPowder.cpp.
References convertUnits(), Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), Mantid::API::g_log, Mantid::API::GenericDataProcessorAlgorithm< Base >::getPropertyValue(), Mantid::Kernel::Logger::information(), m_resonanceLower, and m_resonanceUpper.
Referenced by exec().
|
private |
Function to get a vector property either from a PropertyManager or the algorithm properties.
If both PM and algorithm properties are specified, the algorithm one wins. The return value is the first element in the vector if it is not empty.
name | : The algorithm property to retrieve. |
avec | : The vector to hold the property value. |
Definition at line 325 of file AlignAndFocusPowder.cpp.
References Mantid::API::GenericDataProcessorAlgorithm< Base >::getProperty(), and name().
Referenced by exec().
|
overrideprivate |
Initialisation method.
Declares properties to be used in algorithm.
Definition at line 92 of file AlignAndFocusPowder.cpp.
References Mantid::EMPTY_DBL(), Mantid::Kernel::Direction::InOut, Mantid::Kernel::Direction::Input, Mantid::Kernel::IS_DEFAULT, Mantid::API::PropertyMode::Optional, Mantid::API::FileProperty::OptionalLoad, and Mantid::Kernel::Direction::Output.
|
private |
Loads the .cal file if necessary.
Definition at line 1118 of file AlignAndFocusPowder.cpp.
References convertOffsetsToCal(), Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), Mantid::API::g_log, Mantid::API::GenericDataProcessorAlgorithm< Base >::getProperty(), Mantid::Kernel::Logger::information(), Mantid::Kernel::SingletonHolder< T >::Instance(), m_calibrationWS, m_groupWS, m_inputW, m_instName, m_maskWS, and name().
Referenced by exec().
|
inlineoverride |
Algorithm's name for identification overriding a virtual method.
Definition at line 31 of file AlignAndFocusPowder.h.
Referenced by getVecPropertyFromPmOrSelf(), and loadCalFile().
|
private |
Rebin.
Definition at line 948 of file AlignAndFocusPowder.cpp.
References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), Mantid::API::g_log, Mantid::Kernel::Logger::information(), m_delta_ragged, m_dmaxs, m_dmins, m_outputW, m_params, m_resampleX, and Mantid::Kernel::Logger::warning().
Referenced by exec().
|
private |
RebinRagged this should only be done on the final focussed workspace.
Definition at line 996 of file AlignAndFocusPowder.cpp.
References Mantid::API::GenericDataProcessorAlgorithm< Base >::createChildAlgorithm(), Mantid::API::g_log, Mantid::Kernel::Logger::information(), m_delta_ragged, m_dmaxs, m_dmins, tmax, and tmin.
Referenced by exec().
|
inlineoverride |
Definition at line 35 of file AlignAndFocusPowder.h.
|
inlineoverride |
Summary of algorithms purpose.
Definition at line 41 of file AlignAndFocusPowder.h.
|
override |
Definition at line 237 of file AlignAndFocusPowder.cpp.
References Mantid::API::GenericDataProcessorAlgorithm< Base >::getProperty(), Mantid::API::GenericDataProcessorAlgorithm< Base >::getPropertyValue(), m_inputEW, m_inputW, m_resonanceLower, and m_resonanceUpper.
|
inlineoverride |
Algorithm's version for identification overriding a virtual method.
Definition at line 34 of file AlignAndFocusPowder.h.
|
private |
Definition at line 100 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Definition at line 96 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Definition at line 85 of file AlignAndFocusPowder.h.
Referenced by editInstrument(), and exec().
|
private |
Definition at line 99 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Definition at line 80 of file AlignAndFocusPowder.h.
Referenced by convertOffsetsToCal(), exec(), and loadCalFile().
|
private |
Definition at line 93 of file AlignAndFocusPowder.h.
Referenced by exec(), rebin(), and rebinRagged().
|
private |
Definition at line 92 of file AlignAndFocusPowder.h.
Referenced by exec(), rebin(), and rebinRagged().
|
private |
Definition at line 91 of file AlignAndFocusPowder.h.
Referenced by exec(), rebin(), and rebinRagged().
|
private |
Definition at line 82 of file AlignAndFocusPowder.h.
Referenced by diffractionFocus(), exec(), and loadCalFile().
|
private |
Definition at line 78 of file AlignAndFocusPowder.h.
Referenced by exec(), and validateInputs().
|
private |
Definition at line 76 of file AlignAndFocusPowder.h.
Referenced by exec(), loadCalFile(), and validateInputs().
|
private |
Definition at line 88 of file AlignAndFocusPowder.h.
Referenced by convertOffsetsToCal(), exec(), and loadCalFile().
|
private |
Definition at line 83 of file AlignAndFocusPowder.h.
Referenced by editInstrument(), and exec().
|
private |
Low resolution TOF event workspace.
Definition at line 111 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Offset to low resolution TOF spectra.
Definition at line 115 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Low resolution TOF matrix workspace.
Definition at line 109 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Definition at line 81 of file AlignAndFocusPowder.h.
Referenced by diffractionFocus(), exec(), and loadCalFile().
|
private |
Definition at line 79 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Definition at line 77 of file AlignAndFocusPowder.h.
|
private |
Definition at line 89 of file AlignAndFocusPowder.h.
|
private |
Definition at line 105 of file AlignAndFocusPowder.h.
Referenced by diffractionFocus(), and exec().
|
private |
Flag to process low resolution workspace.
Definition at line 113 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
|
private |
Definition at line 90 of file AlignAndFocusPowder.h.
|
private |
Definition at line 94 of file AlignAndFocusPowder.h.
Referenced by exec(), filterResonances(), and validateInputs().
|
private |
Definition at line 95 of file AlignAndFocusPowder.h.
Referenced by filterResonances(), and validateInputs().
|
private |
Definition at line 102 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Definition at line 101 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Definition at line 87 of file AlignAndFocusPowder.h.
Referenced by editInstrument(), and exec().
|
private |
Definition at line 84 of file AlignAndFocusPowder.h.
Referenced by editInstrument(), and exec().
|
private |
Definition at line 104 of file AlignAndFocusPowder.h.
Referenced by exec(), and rebinRagged().
|
private |
Definition at line 103 of file AlignAndFocusPowder.h.
Referenced by exec(), and rebinRagged().
|
private |
Definition at line 86 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Definition at line 98 of file AlignAndFocusPowder.h.
Referenced by exec().
|
private |
Definition at line 97 of file AlignAndFocusPowder.h.
Referenced by exec().