35 std::make_shared<InstrumentValidator>()),
36 "The input workspace");
38 "The filename to use for the saved data");
47 const std::string filename =
getProperty(
"Filename");
52 std::ofstream outPHX_file(filename.c_str());
55 g_log.
error(
"Failed to open (PHX) file:" + filename);
61 spCalcDetPar->initialize();
62 spCalcDetPar->setPropertyValue(
"InputWorkspace", inputWorkspace->getName());
63 spCalcDetPar->setPropertyValue(
"ReturnLinearRanges",
"0");
75 spCalcDetPar->execute();
79 throw(std::bad_cast());
81 const std::vector<double> &azimuthal = pCalcDetPar->
getAzimuthal();
82 const std::vector<double> &polar = pCalcDetPar->getPolar();
83 const std::vector<double> &azimuthal_width = pCalcDetPar->getAzimWidth();
84 const std::vector<double> &polar_width = pCalcDetPar->getPolarWidth();
85 const std::vector<double> &secondary_flightpath = pCalcDetPar->getFlightPath();
86 const std::vector<size_t> &det_ID = pCalcDetPar->getDetID();
88 size_t nDetectors = pCalcDetPar->getNDetectors();
91 outPHX_file <<
" " << nDetectors <<
'\n';
93 for (
size_t i = 0; i < nDetectors; ++i) {
95 volatile double NanID = azimuthal[i];
96 if (NanID != azimuthal[i])
100 outPHX_file << std::fixed << std::setprecision(3);
101 outPHX_file <<
" " << secondary_flightpath[i] <<
"\t 0 \t\t" << polar[i] <<
" \t" << azimuthal[i] <<
" \t"
102 << polar_width[i] <<
" \t" << azimuthal_width[i] <<
" \t\t" << det_ID[i] <<
'\n';
#define DECLARE_ALGORITHM(classname)
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.
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.
@ Save
to specify a file to write to, the file may or may not exist
A property class for workspaces.
std::vector< double > const & getAzimuthal() const
the accessors, used to return algorithm results when called as Child Algorithm, without setting the p...
void exec() override
Execution code.
void init() override
Initialisation code.
std::string det_par_ws_name
The name of the table workpsace with detectors positions used in tests.
Records the filename and the description of failure.
void error(const std::string &msg)
Logs at error level.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< const IComponent > IComponent_const_sptr
Typdef of a shared pointer to a const IComponent.
@ Input
An input workspace.