Mantid
Loading...
Searching...
No Matches
MagneticFormFactorCorrectionMD.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2024 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7
10
11namespace Mantid {
12namespace MDAlgorithms {
16
17// Register the algorithm into the AlgorithmFactory
18DECLARE_ALGORITHM(MagneticFormFactorCorrectionMD)
19
20//----------------------------------------------------------------------------------------------
21
22
23const std::string MagneticFormFactorCorrectionMD::name() const { return "MagneticFormFactorCorrectionMD"; }
24
27
29const std::string MagneticFormFactorCorrectionMD::category() const { return "MDAlgorithms"; }
30
32const std::string MagneticFormFactorCorrectionMD::summary() const {
33 return "Apply magnetic form factor correction to MD events by dividing signal with F(Q)^2";
34}
35const std::vector<std::string> MagneticFormFactorCorrectionMD::seeAlso() const { return {"MagFormFactorCorrection"}; }
36// //----------------------------------------------------------------------------------------------
37// /** Initialize the algorithm's properties.
38// */
41 std::vector<std::string> keys = Mantid::PhysicalConstants::getMagneticIonList();
42 declareProperty("IonName", "Cu2", std::make_shared<StringListValidator>(keys),
43 "The name of the ion: an element symbol with a number "
44 "indicating the valence, e.g. Fe2 for Fe2+ / Fe(II)");
45}
46
47// //----------------------------------------------------------------------------------------------
48// /** Execute the algorithm.
49// */
54
55// implement correction method
56double MagneticFormFactorCorrectionMD::correction(const double q2) const {
57 const auto ff = ion.analyticalFormFactor(q2);
58 return 1. / (ff * ff);
59}
60
61} // namespace MDAlgorithms
62} // namespace Mantid
std::string name
Definition Run.cpp:60
#define DECLARE_ALGORITHM(classname)
Definition Algorithm.h:538
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
A property class for workspaces.
ListValidator is a validator that requires the value of a property to be one of a defined list of pos...
MagneticFormFactorCorrectionMD : Correct event signal and error values for magnetic form factor.
const std::string summary() const override
Algorithm's summary for use in the GUI and help.
void init() override
Virtual method - must be overridden by concrete algorithm.
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version for identification.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
void exec() override
Virtual method - must be overridden by concrete algorithm.
void init() override
Initialize the algorithm's properties.
void exec() override
Execute the algorithm.
MANTID_KERNEL_DLL std::vector< std::string > getMagneticIonList()
Returns a list of all ions.
MANTID_KERNEL_DLL const MagneticIon & getMagneticIon(const std::string &symbol, const uint16_t charge)
Returns the magnetic ion for the given symbol and charge.
Helper class which provides the Collimation Length for SANS instruments.
STL namespace.
Describes the direction (within an algorithm) of a Property.
Definition Property.h:50
double analyticalFormFactor(const double qsqr) const
Returns the value of the form factor in the dipole approximation.