32 declareProperty(std::make_unique<FileProperty>(
"Filename",
"",
FileProperty::Load,
".xml"),
33 "The filename (including its full or relative path) of an "
34 "instrument definition file");
35 declareProperty(
"NumAzimuth", 100,
"Steps in azimuthal angles");
36 declareProperty(
"NumZenith", 50,
"Steps in zenith angles");
38 "An output workspace.");
47 alg->executeAsChildAlg();
54 for (
size_t i = 0; i < ws->getNumberHistograms(); i++)
55 ws->mutableY(i)[0] = 0.0;
59 Progress prog(
this, 0.3, 1.0, NumAzimuth);
61 for (
int iaz = 0; iaz < NumAzimuth; iaz++) {
63 double az = double(iaz) * M_PI * 2.0 / double(NumAzimuth);
64 for (
int iz = 0; iz < NumZenith; iz++) {
65 const double zen = double(iz) * M_PI / double(NumZenith);
66 const double x = cos(az);
67 const double z = sin(az);
68 const double y = cos(zen);
76 size_t wi = detTowi[det->getID()];
78 ws->mutableY(wi)[0] = double(
int(az * 57.3) * 1000 +
int(iz));
#define DECLARE_ALGORITHM(classname)
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.
@ Load
allowed here which will be passed to the algorithm
Helper class for reporting progress from algorithms.
A property class for workspaces.
Algorithm to test ray tracer by spraying evenly spaced rays around.
void exec() override
Run the algorithm.
This class is responsible for tracking rays and accumulating a list of objects that are intersected a...
IDetector_const_sptr getDetectorResult() const
Gets the results of the trace, then returns the first detector (that is NOT a monitor) found in the r...
void traceFromSample(const Kernel::V3D &dir) const
Trace a given track from the sample position in the given direction.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void information(const std::string &msg)
Logs at information level.
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
double normalize()
Make a normalized vector (return norm value)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
std::shared_ptr< const Mantid::Geometry::IDetector > IDetector_const_sptr
Shared pointer to IDetector (const version)
std::unordered_map< detid_t, size_t > detid2index_map
Map with key = detector ID, value = workspace index.
@ Output
An output workspace.