Mantid
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | List of all members
Mantid::Algorithms::SofQCommon Struct Reference

#include <SofQCommon.h>

Public Member Functions

double getEFixed (const Geometry::IDetector &det) const
 Get the efixed value for the given detector. More...
 
void initCachedValues (const API::MatrixWorkspace &workspace, API::Algorithm *const hostAlgorithm)
 The procedure analyses emode and efixed properties provided to the algorithm and identify the energy analysis mode and the way the properties are defined. More...
 
double q (const double deltaE, const double twoTheta, const Geometry::IDetector *det) const
 Calculate the Q value. More...
 
std::pair< double, double > qBinHints (const API::MatrixWorkspace &ws, const double minE, const double maxE) const
 Estimate minimum and maximum momentum transfer. More...
 
 SofQCommon ()
 

Public Attributes

double m_efixed
 EFixed. More...
 
bool m_efixedGiven
 EFixed has been provided. More...
 
int m_emode
 E Mode. More...
 

Private Member Functions

double directQ (const double deltaE, const double twoTheta) const
 Calculate the Q value for a direct instrument. More...
 
double indirectQ (const double deltaE, const double twoTheta, const Geometry::IDetector *det) const
 Calculate the Q value for an indirect instrument. More...
 
std::pair< double, double > qBinHintsDirect (const API::MatrixWorkspace &ws, const double minE, const double maxE) const
 Return a pair of (minimum Q, maximum Q) for given direct geometry workspace. More...
 
std::pair< double, double > qBinHintsIndirect (const API::MatrixWorkspace &ws, const double minE, const double maxE) const
 Return a pair of (minimum Q, maximum Q) for given indirect geometry workspace. More...
 

Detailed Description

Definition at line 18 of file SofQCommon.h.

Constructor & Destructor Documentation

◆ SofQCommon()

Mantid::Algorithms::SofQCommon::SofQCommon ( )
inline

Definition at line 28 of file SofQCommon.h.

Member Function Documentation

◆ directQ()

double Mantid::Algorithms::SofQCommon::directQ ( const double  deltaE,
const double  twoTheta 
) const
private

Calculate the Q value for a direct instrument.

Parameters
deltaEThe energy change
twoThetaThe value of the scattering angle
Returns
The value of Q

Definition at line 129 of file SofQCommon.cpp.

References Mantid::PhysicalConstants::E_mev_toNeutronWavenumberSq, m_efixed, and Mantid::Kernel::twoTheta.

Referenced by q(), and qBinHintsDirect().

◆ getEFixed()

double Mantid::Algorithms::SofQCommon::getEFixed ( const Geometry::IDetector det) const

Get the efixed value for the given detector.

Return the efixed for this detector.

In Direct mode this has to be property set up earlier and in Indirect mode it may be the property of a component if not specified globally for the instrument.

Parameters
detA pointer to a detector object
Returns
The value of efixed

Definition at line 72 of file SofQCommon.cpp.

References Mantid::Kernel::efixed, Mantid::Geometry::IComponent::getName(), Mantid::Geometry::IComponent::getNumberParameter(), m_efixed, m_efixedGiven, and m_emode.

Referenced by Mantid::Algorithms::SofQWCentre::exec(), indirectQ(), Mantid::Algorithms::SofQWNormalisedPolygon::initAngularCachesNonPSD(), Mantid::Algorithms::SofQWNormalisedPolygon::initAngularCachesTable(), and Mantid::Algorithms::SofQWPolygon::initThetaCache().

◆ indirectQ()

double Mantid::Algorithms::SofQCommon::indirectQ ( const double  deltaE,
const double  twoTheta,
const Geometry::IDetector det 
) const
private

Calculate the Q value for an indirect instrument.

Parameters
deltaEThe energy change
twoThetaThe value of the scattering angle
detA pointer to the corresponding Detector
Returns
The value of Q

Definition at line 143 of file SofQCommon.cpp.

References Mantid::PhysicalConstants::E_mev_toNeutronWavenumberSq, Mantid::Kernel::efixed, getEFixed(), and Mantid::Kernel::twoTheta.

Referenced by q(), and qBinHintsIndirect().

◆ initCachedValues()

void Mantid::Algorithms::SofQCommon::initCachedValues ( const API::MatrixWorkspace workspace,
API::Algorithm *const  hostAlgorithm 
)

The procedure analyses emode and efixed properties provided to the algorithm and identify the energy analysis mode and the way the properties are defined.

Parameters
workspace:: input workspace which may or may not have incident energy property (Ei) attached to it as the run log
hostAlgorithm:: the pointer to SofQ algorithm hosting the base class. This algorithm expects to have EMode and EFixed properties attached to it.

Definition at line 25 of file SofQCommon.cpp.

References Mantid::API::Algorithm::getProperty(), m_efixed, m_efixedGiven, m_emode, and workspace.

Referenced by Mantid::Algorithms::SofQWCentre::exec(), Mantid::Algorithms::SofQWNormalisedPolygon::exec(), and Mantid::Algorithms::SofQWPolygon::initCachedValues().

◆ q()

double Mantid::Algorithms::SofQCommon::q ( const double  deltaE,
const double  twoTheta,
const Geometry::IDetector det 
) const

Calculate the Q value.

Parameters
deltaEThe energy transfer in meV
twoThetaThe scattering angle in radians
detA pointer to the corresponding detector, can be nullptr for direct emode.
Returns
The momentum transfer in A-1

Definition at line 101 of file SofQCommon.cpp.

References directQ(), indirectQ(), m_emode, and Mantid::Kernel::twoTheta.

Referenced by Mantid::Algorithms::SofQWNormalisedPolygon::exec(), Mantid::Algorithms::SofQWPolygon::exec(), and qBinHintsDirect().

◆ qBinHints()

std::pair< double, double > Mantid::Algorithms::SofQCommon::qBinHints ( const API::MatrixWorkspace ws,
const double  minE,
const double  maxE 
) const

Estimate minimum and maximum momentum transfer.

Return a pair of (minimum Q, maximum Q) for given workspace.

Parameters
wsa workspace
minEminimum energy transfer in ws
maxEmaximum energy transfer in ws
Returns
a pair containing global minimun and maximum Q

Definition at line 115 of file SofQCommon.cpp.

References m_emode, qBinHintsDirect(), and qBinHintsIndirect().

Referenced by Mantid::Algorithms::SofQW::setUpOutputWorkspace().

◆ qBinHintsDirect()

std::pair< double, double > Mantid::Algorithms::SofQCommon::qBinHintsDirect ( const API::MatrixWorkspace ws,
const double  minE,
const double  maxE 
) const
private

Return a pair of (minimum Q, maximum Q) for given direct geometry workspace.

Parameters
wsa workspace
minEminimum energy transfer in ws
maxEmaximum energy transfer in ws
Returns
a pair containing global minimun and maximum Q

Definition at line 162 of file SofQCommon.cpp.

References directQ(), m_efixed, q(), Mantid::API::ExperimentInfo::spectrumInfo(), and Mantid::Kernel::twoTheta.

Referenced by qBinHints().

◆ qBinHintsIndirect()

std::pair< double, double > Mantid::Algorithms::SofQCommon::qBinHintsIndirect ( const API::MatrixWorkspace ws,
const double  minE,
const double  maxE 
) const
private

Return a pair of (minimum Q, maximum Q) for given indirect geometry workspace.

Estimates the Q range from all detectors. If workspace contains grouped detectors/not all detectors are linked to a spectrum, the returned interval may be larger than actually needed.

Parameters
wsa workspace
minEminimum energy transfer in ws
maxEmaximum energy transfer in ws
Returns
a pair containing global minimun and maximum Q

Definition at line 204 of file SofQCommon.cpp.

References Mantid::API::ExperimentInfo::detectorInfo(), indirectQ(), std::to_string(), and Mantid::Kernel::twoTheta.

Referenced by qBinHints().

Member Data Documentation

◆ m_efixed

double Mantid::Algorithms::SofQCommon::m_efixed

EFixed.

Definition at line 25 of file SofQCommon.h.

Referenced by directQ(), getEFixed(), initCachedValues(), and qBinHintsDirect().

◆ m_efixedGiven

bool Mantid::Algorithms::SofQCommon::m_efixedGiven

EFixed has been provided.

Definition at line 23 of file SofQCommon.h.

Referenced by getEFixed(), and initCachedValues().

◆ m_emode

int Mantid::Algorithms::SofQCommon::m_emode

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