17#include "boost/lexical_cast.hpp"
33 auto wsValidator = std::make_shared<CompositeValidator>();
36 "An input workspace.");
38 "SampleLog variable name that contains the temperature, or a number");
40 "An output workspace.");
41 std::vector<std::string> unitOptions{
"Energy",
"Frequency"};
42 declareProperty(
"OutputUnits",
"Energy", std::make_shared<StringListValidator>(unitOptions),
43 "Susceptibility as a function of energy (meV) or frequency (GHz)");
53 if (outputWS != inputWS) {
54 outputWS = create<MatrixWorkspace>(*inputWS);
60 if (inputWS->run().hasProperty(Tstring)) {
62 Temp = log->getStatistics().mean;
64 throw std::invalid_argument(Tstring +
" is not a double-valued log.");
67 Temp = boost::lexical_cast<double>(Tstring);
70 Tstring +=
" is not a valid log, nor is it a number";
71 throw std::invalid_argument(Tstring);
80 expcor->setProperty<
double>(
"C1", M_PI);
81 expcor->setProperty<
double>(
"C", oneOverT);
82 expcor->setPropertyValue(
"Operation",
"Multiply");
83 expcor->executeAsChildAlg();
85 outputWS = expcor->getProperty(
"OutputWorkspace");
89 if (unit ==
"Frequency") {
93 convert->setProperty<std::string>(
"Target",
"DeltaE_inFrequency");
94 convert->executeAsChildAlg();
#define DECLARE_ALGORITHM(classname)
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
virtual std::shared_ptr< Algorithm > createChildAlgorithm(const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1)
Create a Child Algorithm.
A property class for workspaces.
A validator which checks that the unit of the workspace referred to by a WorkspaceProperty is the exp...
ApplyDetailedBalance : The algorithm calculates the imaginary part of the dynamic susceptibility chi'...
void exec() override
Run the algorithm.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
The concrete, templated class for properties.
A specialised Property class for holding a series of time-value pairs.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
static constexpr double meVtoKelvin
1 meV in Kelvin.
@ Input
An input workspace.
@ Output
An output workspace.