Mantid
|
#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... | |
Definition at line 18 of file SofQCommon.h.
|
inline |
Definition at line 28 of file SofQCommon.h.
|
private |
Calculate the Q value for a direct instrument.
deltaE | The energy change |
twoTheta | The value of the scattering angle |
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().
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.
det | A pointer to a detector object |
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().
|
private |
Calculate the Q value for an indirect instrument.
deltaE | The energy change |
twoTheta | The value of the scattering angle |
det | A pointer to the corresponding Detector |
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().
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.
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().
double Mantid::Algorithms::SofQCommon::q | ( | const double | deltaE, |
const double | twoTheta, | ||
const Geometry::IDetector * | det | ||
) | const |
Calculate the Q value.
deltaE | The energy transfer in meV |
twoTheta | The scattering angle in radians |
det | A pointer to the corresponding detector, can be nullptr for direct emode. |
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().
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.
ws | a workspace |
minE | minimum energy transfer in ws |
maxE | maximum energy transfer in ws |
Definition at line 115 of file SofQCommon.cpp.
References m_emode, qBinHintsDirect(), and qBinHintsIndirect().
Referenced by Mantid::Algorithms::SofQW::setUpOutputWorkspace().
|
private |
Return a pair of (minimum Q, maximum Q) for given direct geometry workspace.
ws | a workspace |
minE | minimum energy transfer in ws |
maxE | maximum energy transfer in ws |
Definition at line 162 of file SofQCommon.cpp.
References directQ(), m_efixed, q(), Mantid::API::ExperimentInfo::spectrumInfo(), and Mantid::Kernel::twoTheta.
Referenced by qBinHints().
|
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.
ws | a workspace |
minE | minimum energy transfer in ws |
maxE | maximum energy transfer in ws |
Definition at line 204 of file SofQCommon.cpp.
References Mantid::API::ExperimentInfo::detectorInfo(), indirectQ(), std::to_string(), and Mantid::Kernel::twoTheta.
Referenced by qBinHints().
double Mantid::Algorithms::SofQCommon::m_efixed |
EFixed.
Definition at line 25 of file SofQCommon.h.
Referenced by directQ(), getEFixed(), initCachedValues(), and qBinHintsDirect().
bool Mantid::Algorithms::SofQCommon::m_efixedGiven |
EFixed has been provided.
Definition at line 23 of file SofQCommon.h.
Referenced by getEFixed(), and initCachedValues().
int Mantid::Algorithms::SofQCommon::m_emode |
E Mode.
Definition at line 21 of file SofQCommon.h.
Referenced by Mantid::Algorithms::SofQWCentre::exec(), Mantid::Algorithms::SofQWNormalisedPolygon::exec(), Mantid::Algorithms::SofQWPolygon::exec(), getEFixed(), initCachedValues(), q(), and qBinHints().