Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::WorkflowAlgorithms::AlignAndFocusPowder Class Reference

This is a parent algorithm that uses several different child algorithms to perform it's task. More...

#include <AlignAndFocusPowder.h>

Inheritance diagram for Mantid::WorkflowAlgorithms::AlignAndFocusPowder:
Mantid::API::GenericDataProcessorAlgorithm< Base >

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::Progressm_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< AlgorithmcreateChildAlgorithm (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::PropertyManagergetProcessProperties (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...
 

Detailed Description

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.

Member Function Documentation

◆ category()

const std::string Mantid::WorkflowAlgorithms::AlignAndFocusPowder::category ( ) const
inlineoverride

Algorithm's category for identification overriding a virtual method.

Definition at line 38 of file AlignAndFocusPowder.h.

◆ conjoinWorkspaces()

MatrixWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::conjoinWorkspaces ( const API::MatrixWorkspace_sptr ws1,
const API::MatrixWorkspace_sptr ws2,
size_t  offset 
)
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().

◆ convertOffsetsToCal()

void Mantid::WorkflowAlgorithms::AlignAndFocusPowder::convertOffsetsToCal ( DataObjects::OffsetsWorkspace_sptr offsetsWS)
private

◆ convertUnits()

API::MatrixWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::convertUnits ( API::MatrixWorkspace_sptr  matrixws,
const std::string &  target 
)
private

◆ diffractionFocus()

API::MatrixWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::diffractionFocus ( API::MatrixWorkspace_sptr  ws)
private

◆ doSortEvents()

void Mantid::WorkflowAlgorithms::AlignAndFocusPowder::doSortEvents ( const Mantid::API::Workspace_sptr ws)
private

Perform SortEvents on the output workspaces but only if they are EventWorkspaces.

Parameters
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().

◆ editInstrument()

API::MatrixWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::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 
)
private

◆ exec()

void Mantid::WorkflowAlgorithms::AlignAndFocusPowder::exec ( )
overrideprivate

◆ filterResonances()

API::MatrixWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::filterResonances ( API::MatrixWorkspace_sptr  matrixws)
private

◆ getVecPropertyFromPmOrSelf()

double Mantid::WorkflowAlgorithms::AlignAndFocusPowder::getVecPropertyFromPmOrSelf ( const std::string &  name,
std::vector< double > &  avec 
)
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.

Parameters
name: The algorithm property to retrieve.
avec: The vector to hold the property value.
Returns
: The default value of the requested property.

Definition at line 325 of file AlignAndFocusPowder.cpp.

References Mantid::API::GenericDataProcessorAlgorithm< Base >::getProperty(), and name().

Referenced by exec().

◆ init()

void Mantid::WorkflowAlgorithms::AlignAndFocusPowder::init ( )
overrideprivate

◆ loadCalFile()

void Mantid::WorkflowAlgorithms::AlignAndFocusPowder::loadCalFile ( const std::string &  calFilename,
const std::string &  groupFilename 
)
private

◆ name()

const std::string Mantid::WorkflowAlgorithms::AlignAndFocusPowder::name ( ) const
inlineoverride

Algorithm's name for identification overriding a virtual method.

Definition at line 31 of file AlignAndFocusPowder.h.

Referenced by getVecPropertyFromPmOrSelf(), and loadCalFile().

◆ rebin()

API::MatrixWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::rebin ( API::MatrixWorkspace_sptr  matrixws)
private

◆ rebinRagged()

API::MatrixWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::rebinRagged ( API::MatrixWorkspace_sptr  matrixws,
const bool  inDspace 
)
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().

◆ seeAlso()

const std::vector< std::string > Mantid::WorkflowAlgorithms::AlignAndFocusPowder::seeAlso ( ) const
inlineoverride

Definition at line 35 of file AlignAndFocusPowder.h.

◆ summary()

const std::string Mantid::WorkflowAlgorithms::AlignAndFocusPowder::summary ( ) const
inlineoverride

Summary of algorithms purpose.

Definition at line 41 of file AlignAndFocusPowder.h.

◆ validateInputs()

std::map< std::string, std::string > Mantid::WorkflowAlgorithms::AlignAndFocusPowder::validateInputs ( )
override

◆ version()

int Mantid::WorkflowAlgorithms::AlignAndFocusPowder::version ( ) const
inlineoverride

Algorithm's version for identification overriding a virtual method.

Definition at line 34 of file AlignAndFocusPowder.h.

Member Data Documentation

◆ DIFCref

double Mantid::WorkflowAlgorithms::AlignAndFocusPowder::DIFCref {0.0}
private

Definition at line 100 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ dspace

bool Mantid::WorkflowAlgorithms::AlignAndFocusPowder::dspace {false}
private

Definition at line 96 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ l2s

std::vector<double> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::l2s
private

Definition at line 85 of file AlignAndFocusPowder.h.

Referenced by editInstrument(), and exec().

◆ LRef

double Mantid::WorkflowAlgorithms::AlignAndFocusPowder::LRef {0.0}
private

Definition at line 99 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ m_calibrationWS

API::ITableWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_calibrationWS
private

Definition at line 80 of file AlignAndFocusPowder.h.

Referenced by convertOffsetsToCal(), exec(), and loadCalFile().

◆ m_delta_ragged

std::vector<double> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_delta_ragged
private

Definition at line 93 of file AlignAndFocusPowder.h.

Referenced by exec(), rebin(), and rebinRagged().

◆ m_dmaxs

std::vector<double> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_dmaxs
private

Definition at line 92 of file AlignAndFocusPowder.h.

Referenced by exec(), rebin(), and rebinRagged().

◆ m_dmins

std::vector<double> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_dmins
private

Definition at line 91 of file AlignAndFocusPowder.h.

Referenced by exec(), rebin(), and rebinRagged().

◆ m_groupWS

DataObjects::GroupingWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_groupWS
private

Definition at line 82 of file AlignAndFocusPowder.h.

Referenced by diffractionFocus(), exec(), and loadCalFile().

◆ m_inputEW

DataObjects::EventWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_inputEW
private

Definition at line 78 of file AlignAndFocusPowder.h.

Referenced by exec(), and validateInputs().

◆ m_inputW

API::MatrixWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_inputW
private

Definition at line 76 of file AlignAndFocusPowder.h.

Referenced by exec(), loadCalFile(), and validateInputs().

◆ m_instName

std::string Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_instName
private

Definition at line 88 of file AlignAndFocusPowder.h.

Referenced by convertOffsetsToCal(), exec(), and loadCalFile().

◆ m_l1

double Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_l1 {0.0}
private

Definition at line 83 of file AlignAndFocusPowder.h.

Referenced by editInstrument(), and exec().

◆ m_lowResEW

DataObjects::EventWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_lowResEW
private

Low resolution TOF event workspace.

Definition at line 111 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ m_lowResSpecOffset

size_t Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_lowResSpecOffset {0}
private

Offset to low resolution TOF spectra.

Definition at line 115 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ m_lowResW

API::MatrixWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_lowResW
private

Low resolution TOF matrix workspace.

Definition at line 109 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ m_maskWS

DataObjects::MaskWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_maskWS
private

Definition at line 81 of file AlignAndFocusPowder.h.

Referenced by diffractionFocus(), exec(), and loadCalFile().

◆ m_outputEW

DataObjects::EventWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_outputEW
private

Definition at line 79 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ m_outputW

API::MatrixWorkspace_sptr Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_outputW
private

Definition at line 77 of file AlignAndFocusPowder.h.

Referenced by exec(), and rebin().

◆ m_params

std::vector<double> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_params
private

Definition at line 89 of file AlignAndFocusPowder.h.

Referenced by exec(), and rebin().

◆ m_preserveEvents

bool Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_preserveEvents {false}
private

Definition at line 105 of file AlignAndFocusPowder.h.

Referenced by diffractionFocus(), and exec().

◆ m_processLowResTOF

bool Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_processLowResTOF {false}
private

Flag to process low resolution workspace.

Definition at line 113 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ m_progress

std::unique_ptr<API::Progress> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_progress = nullptr
private

Progress reporting.

Definition at line 117 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ m_resampleX

int Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_resampleX {0}
private

Definition at line 90 of file AlignAndFocusPowder.h.

Referenced by exec(), and rebin().

◆ m_resonanceLower

std::vector<double> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_resonanceLower
private

Definition at line 94 of file AlignAndFocusPowder.h.

Referenced by exec(), filterResonances(), and validateInputs().

◆ m_resonanceUpper

std::vector<double> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::m_resonanceUpper
private

Definition at line 95 of file AlignAndFocusPowder.h.

Referenced by filterResonances(), and validateInputs().

◆ maxwl

double Mantid::WorkflowAlgorithms::AlignAndFocusPowder::maxwl {0.0}
private

Definition at line 102 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ minwl

double Mantid::WorkflowAlgorithms::AlignAndFocusPowder::minwl {0.0}
private

Definition at line 101 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ phis

std::vector<double> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::phis
private

Definition at line 87 of file AlignAndFocusPowder.h.

Referenced by editInstrument(), and exec().

◆ specids

std::vector<int32_t> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::specids
private

Definition at line 84 of file AlignAndFocusPowder.h.

Referenced by editInstrument(), and exec().

◆ tmax

double Mantid::WorkflowAlgorithms::AlignAndFocusPowder::tmax {0.0}
private

Definition at line 104 of file AlignAndFocusPowder.h.

Referenced by exec(), and rebinRagged().

◆ tmin

double Mantid::WorkflowAlgorithms::AlignAndFocusPowder::tmin {0.0}
private

Definition at line 103 of file AlignAndFocusPowder.h.

Referenced by exec(), and rebinRagged().

◆ tths

std::vector<double> Mantid::WorkflowAlgorithms::AlignAndFocusPowder::tths
private

Definition at line 86 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ xmax

double Mantid::WorkflowAlgorithms::AlignAndFocusPowder::xmax {0.0}
private

Definition at line 98 of file AlignAndFocusPowder.h.

Referenced by exec().

◆ xmin

double Mantid::WorkflowAlgorithms::AlignAndFocusPowder::xmin {0.0}
private

Definition at line 97 of file AlignAndFocusPowder.h.

Referenced by exec().


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