13#include "MantidDataHandling/DllConfig.h"
17namespace DataHandling {
125 const std::string
name()
const override {
return "FindDetectorsPar"; };
128 return "The algorithm returns the angular parameters and second flight "
129 "path for a workspace detectors (data, usually availble in par or "
136 const std::string
category()
const override {
return "DataHandling\\Instrument"; }
140 std::vector<double>
const &
getPolar()
const {
return polar; }
141 std::vector<double>
const &
getAzimWidth()
const {
return azimuthalWidth; }
143 std::vector<double>
const &
getFlightPath()
const {
return secondaryFlightpath; }
144 std::vector<size_t>
const &
getDetID()
const {
return detID; }
150 void init()
override;
151 void exec()
override;
155 bool m_SizesAreLinear =
false;
158 size_t m_nDetectors = 0;
175 void setOutputTable();
177 void extractAndLinearize(
const std::vector<DetParameters> &detPar);
181 size_t loadParFile(
const std::string &fileName);
186 int count_changes(
const char *
const Buf,
size_t buf_size);
190 size_t get_my_line(std::ifstream &in,
char *buf,
size_t buf_size,
const char DELIM);
193 FileTypeDescriptor get_ASCII_header(std::string
const &fileName, std::ifstream &data_stream);
195 void load_plain(std::ifstream &stream, std::vector<double> &Data,
FileTypeDescriptor const &FILE_TYPE);
243 static double nearAngle(
const double &baseAngle,
const double &anAngle);
Base class from which all concrete algorithm classes should be derived.
helper class-collection to keep together the parameters, which characterize average composite detecto...
void addDetInfo(const Geometry::IDetector &det, const Kernel::V3D &Observer)
method to cacluate the detectors parameters and add them to the detectors averages
static double nearAngle(const double &baseAngle, const double &anAngle)
method calculates an angle closest to the initial one taken on a ring e.g.
size_t m_nComponents
numbr of primary detectors, contributing into this detector
void returnAvrgDetPar(DetParameters &avrgDet)
Method processes accumulated averages and return them in preexistent avrgDet class.
void setUseSpherical(bool shouldWe=true)
Small helper class-holder used to precalculate the detectors parameters in spherical coordinate syste...
double azimWidth
linear or angular size of the bounding box encapsulating detector and alighned tangentially to the co...
double azimutAngle
azimuthal detector's angle in spherical coordinate system alighned with the beam
int64_t detID
the detector's ID
double secondaryFlightPath
scattering source – detector' distance
double polarAngle
polar detector's angle in spherical coordinate system alighned with the beam
size_t getNDetectors() const
number of real detectors, calculated by algorithm
std::vector< size_t > detID
std::vector< double > polar
std::vector< double > secondaryFlightpath
int version() const override
Algorithm's version for identification overriding a virtual method.
std::vector< double > const & getPolarWidth() const
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
std::vector< double > azimuthalWidth
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
std::vector< double > azimuthal
std::vector< size_t > const & getDetID() const
std::vector< double > const & getAzimWidth() const
const std::string summary() const override
Summary of algorithms purpose.
std::vector< double > const & getAzimuthal() const
the accessors, used to return algorithm results when called as Child Algorithm, without setting the p...
std::vector< double > const & getPolar() const
std::vector< double > polarWidth
std::vector< double > const & getFlightPath() const
FileTypeDescriptor current_ASCII_file
if ASCII file is selected as the datasource, this structure describes the type of this file.
Interface class for detector objects.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
fileTypes
file types currently supported by ASCII loader are: 1) an ASCII Tobyfit par file Syntax: >> par = get...
Helper class which provides the Collimation Length for SANS instruments.
Description of the ASCII data header, common for all ASCII PAR and PHX files.
std::streampos data_start_position