|
Mantid
|
#include <SofQCommon.h>
Public Member Functions | |
| double | getEFixed (const Geometry::ComponentInfo &componentInfo, const size_t componentIndex) const |
| Get the efixed value for the given component index. | |
| double | getEFixed (const Geometry::IDetector &det) const |
| Get the efixed value for the given detector. | |
| 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. | |
| double | q (const double deltaE, const double twoTheta, const double efixed) const |
| Calculate the Q value using the given efixed (ignored in direct mode) | |
| double | q (const double deltaE, const double twoTheta, const Geometry::IDetector *det) const |
| Calculate the Q value. | |
| std::pair< double, double > | qBinHints (const API::MatrixWorkspace &ws, const double minE, const double maxE) const |
| Estimate minimum and maximum momentum transfer. | |
| SofQCommon () | |
Public Attributes | |
| double | m_efixed |
| EFixed. | |
| bool | m_efixedGiven |
| EFixed has been provided. | |
| int | m_emode |
| E Mode. | |
Private Member Functions | |
| double | directQ (const double deltaE, const double twoTheta) const |
| Calculate the Q value for a direct instrument. | |
| double | indirectQ (const double deltaE, const double twoTheta, const Geometry::IDetector *det) const |
| Calculate the Q value for an indirect instrument. | |
| 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. | |
| 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. | |
Static Private Member Functions | |
| static double | indirectQFromEFixed (const double deltaE, const double twoTheta, const double efixed) |
| Calculate the Q value for an indirect instrument. | |
Definition at line 21 of file SofQCommon.h.
|
inline |
Definition at line 31 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 165 of file SofQCommon.cpp.
References Mantid::PhysicalConstants::E_mev_toNeutronWavenumberSq, m_efixed, and Mantid::Kernel::twoTheta.
Referenced by q(), q(), and qBinHintsDirect().
| double Mantid::Algorithms::SofQCommon::getEFixed | ( | const Geometry::ComponentInfo & | componentInfo, |
| const size_t | componentIndex | ||
| ) | const |
Get the efixed value for the given component index.
Return the efixed for the component at the given index.
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.
| componentInfo | The ComponentInfo holding the component |
| componentIndex | The index of the component (detector) within componentInfo |
Definition at line 102 of file SofQCommon.cpp.
References Mantid::Geometry::ComponentInfo::getNumberParameter(), m_efixed, m_efixedGiven, m_emode, and Mantid::Geometry::ComponentInfo::name().
| 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 73 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 indirectQ(), and qBinHintsIndirect().
|
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 179 of file SofQCommon.cpp.
References getEFixed(), indirectQFromEFixed(), and Mantid::Kernel::twoTheta.
Referenced by q().
|
staticprivate |
Calculate the Q value for an indirect instrument.
| deltaE | The energy change |
| twoTheta | The value of the scattering angle |
| efixed | The final energy |
Definition at line 193 of file SofQCommon.cpp.
References Mantid::PhysicalConstants::E_mev_toNeutronWavenumberSq, Mantid::Kernel::efixed, and Mantid::Kernel::twoTheta.
Referenced by indirectQ(), 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 26 of file SofQCommon.cpp.
References Mantid::API::Algorithm::getProperty(), m_efixed, m_efixedGiven, m_emode, and workspace.
Referenced by Mantid::Algorithms::SofQWNormalisedPolygon::exec().
| double Mantid::Algorithms::SofQCommon::q | ( | const double | deltaE, |
| const double | twoTheta, | ||
| const double | efixed | ||
| ) | const |
Calculate the Q value using the given efixed (ignored in direct mode)
Calculate the Q value.
| deltaE | The energy transfer in meV |
| twoTheta | The scattering angle in radians |
| efixed | The final energy in meV for indirect emode, e.g. from getEFixed(). Ignored for direct emode, where the cached incident energy is used. |
Definition at line 137 of file SofQCommon.cpp.
References directQ(), Mantid::Kernel::efixed, indirectQFromEFixed(), m_emode, and Mantid::Kernel::twoTheta.
| 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 122 of file SofQCommon.cpp.
References directQ(), indirectQ(), m_emode, and Mantid::Kernel::twoTheta.
Referenced by Mantid::Algorithms::SofQWNormalisedPolygon::exec().
| 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 151 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 208 of file SofQCommon.cpp.
References directQ(), m_efixed, Mantid::API::ExperimentInfo::spectrumInfo(), Mantid::API::SpectrumInfo::twoTheta(), 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 250 of file SofQCommon.cpp.
References Mantid::API::ExperimentInfo::componentInfo(), Mantid::API::ExperimentInfo::detectorInfo(), Mantid::Kernel::efixed, getEFixed(), indirectQFromEFixed(), std::to_string(), and Mantid::Kernel::twoTheta.
Referenced by qBinHints().
| double Mantid::Algorithms::SofQCommon::m_efixed |
EFixed.
Definition at line 28 of file SofQCommon.h.
Referenced by directQ(), getEFixed(), getEFixed(), initCachedValues(), and qBinHintsDirect().
| bool Mantid::Algorithms::SofQCommon::m_efixedGiven |
EFixed has been provided.
Definition at line 26 of file SofQCommon.h.
Referenced by getEFixed(), getEFixed(), and initCachedValues().
| int Mantid::Algorithms::SofQCommon::m_emode |
E Mode.
Definition at line 24 of file SofQCommon.h.
Referenced by getEFixed(), getEFixed(), initCachedValues(), q(), q(), and qBinHints().