13#include "MantidDataHandling/DllConfig.h"
17namespace DataHandling {
126 const std::string
name()
const override {
return "FindDetectorsPar"; };
129 return "The algorithm returns the angular parameters and second flight "
130 "path for a workspace detectors (data, usually availble in par or "
137 const std::string
category()
const override {
return "DataHandling\\Instrument"; }
141 std::vector<double>
const &
getPolar()
const {
return polar; }
142 std::vector<double>
const &
getAzimWidth()
const {
return azimuthalWidth; }
144 std::vector<double>
const &
getFlightPath()
const {
return secondaryFlightpath; }
145 std::vector<size_t>
const &
getDetID()
const {
return detID; }
151 void init()
override;
152 void exec()
override;
156 bool m_SizesAreLinear =
false;
159 size_t m_nDetectors = 0;
176 void setOutputTable();
178 void extractAndLinearize(
const std::vector<DetParameters> &detPar);
182 size_t loadParFile(
const std::string &fileName);
187 int count_changes(
const char *
const Buf,
size_t buf_size);
191 size_t get_my_line(std::ifstream &in,
char *buf,
size_t buf_size,
const char DELIM);
194 FileTypeDescriptor get_ASCII_header(std::string
const &fileName, std::ifstream &data_stream);
196 void load_plain(std::ifstream &stream, std::vector<double> &Data,
FileTypeDescriptor const &FILE_TYPE);
244 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
virtual ~FindDetectorsPar()=default
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