46 "An input workspace.");
49 "Name of the output MDEventWorkspace. If the workspace "
50 "already exists, then the events will be added to it.");
52 "Append events to the output workspace. The workspace is replaced if "
57 "Clearing the events from the input workspace during "
58 "conversion (to save memory) is not supported by algorithm "
64 "Use the histogram representation (event for event workspaces).\n"
65 "One MDEvent will be created for each histogram bin (even empty ones).\n"
66 "Warning! This can use significantly more memory!");
72 "What will be the dimensions of the output workspace?\n"
73 " Q (lab frame): Wave-vector change of the lattice in the lab frame.\n"
74 " Q (sample frame): Wave-vector change of the lattice in the frame of "
75 "the sample (taking out goniometer rotation).\n"
76 " HKL: Use the sample's UB matrix to convert to crystal's HKL indices.");
79 "Correct the weights of events by multiplying by the Lorentz "
80 "formula: sin(theta)^2 / lambda^4");
86 "Optional. If specified, then all the boxes will be split to this "
87 "minimum recursion depth. 1 = one level of splitting, etc.\n"
88 "Be careful using this since it can quickly create a huge number of "
89 "boxes = (SplitInto ^ (MinRercursionDepth * NumDimensions)).\n"
90 "But setting this property equal to MaxRecursionDepth property is "
91 "necessary if one wants to generate multiple file based workspaces in "
92 "order to merge them later\n");
106 std::string &TargFrameName,
107 std::string &ScalingName) {
126 throw std::invalid_argument(
"BaseConvertToDiffractionMDWorkspace::Unknown target frame: " + TargFrame);
135 Convert->initialize();
137 Convert->setRethrows(
true);
138 Convert->initialize();
141 Convert->setProperty(
"OutputWorkspace", this->
getPropertyValue(
"OutputWorkspace"));
142 Convert->setProperty(
"OverwriteExisting", !this->
getProperty(
"Append"));
144 if (!MDTransfFactory::Instance().exists(
"Q3D")) {
145 throw std::runtime_error(
" ConvertToMD Q3D plugin used to transform into "
146 "DiffractionWorkspaced has not been registered "
147 "with the MDTransformation factory");
149 Convert->setPropertyValue(
"QDimensions",
"Q3D");
157 Convert->setProperty(
"QConversionScales", Scaling);
159 Convert->setProperty(
"OtherDimensions",
"");
160 Convert->setProperty(
"PreprocDetectorsWS",
"-");
162 bool lorCorr = this->
getProperty(
"LorentzCorrection");
163 Convert->setProperty(
"LorentzCorrection", lorCorr);
165 bool ignoreZeros = !this->
getProperty(
"OneEventPerBin");
166 Convert->setProperty(
"IgnoreZeroSignals", ignoreZeros);
168 std::vector<double> extents = this->
getProperty(
"Extents");
169 std::vector<double> minVal, maxVal;
171 Convert->setProperty(
"MinValues", minVal);
172 Convert->setProperty(
"MaxValues", maxVal);
176 Convert->setProperty(
"SplitThreshold", this->
getPropertyValue(
"SplitThreshold"));
177 Convert->setProperty(
"MaxRecursionDepth", this->
getPropertyValue(
"MaxRecursionDepth"));
181 Convert->setProperty(
"MinRecursionDepth", depth);
183 Convert->executeAsChildAlg();
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
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.
void initBoxControllerProps(const std::string &SplitInto="5", int SplitThreshold=1000, int MaxRecursionDepth=5)
Initialise the properties.
std::string getBoxSettingsGroupName()
A property class for workspaces.
Interface to PropertyManager.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void setPropertySettings(const std::string &name, std::unique_ptr< IPropertySettings > settings)
void setPropertyGroup(const std::string &name, const std::string &group)
Set the group for a given property.
The concrete, templated class for properties.
void exec() override
Execute the algorithm.
void init() override
Initialize the algorithm's properties.
void convertFramePropertyNames(const std::string &TargFrame, std::string &TargFrameName, std::string &ScalingName)
method to convert the value of the target frame specified for the ConvertToDiffractionMDWorksapce int...
virtual void convertExtents(const std::vector< double > &Extents, std::vector< double > &minVal, std::vector< double > &maxVal)=0
std::vector< std::string > frameOptions
Small class to diable propery on interface.
bool checkCriterion(const IPropertyManager *) const override
Checks that the specified property matches the criteria given.
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< Algorithm > Algorithm_sptr
Typedef for a shared pointer to an Algorithm.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
TargetFrame
enum describes availible target coordinate systems for Q3D mode
static const std::vector< std::string > availableTypes()
Returns the string list of available modes.
@ Input
An input workspace.
@ Output
An output workspace.