Mantid
Loading...
Searching...
No Matches
SetScalingPSD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
13#include "MantidDataHandling/DllConfig.h"
14
15namespace Mantid {
16
17namespace Geometry {
18class IComponent;
19}
20
21namespace Kernel {
22class V3D;
23}
24
25namespace DataHandling {
47class MANTID_DATAHANDLING_DLL SetScalingPSD final : public API::Algorithm {
48public:
52 const std::string name() const override { return "SetScalingPSD"; };
54 const std::string summary() const override {
55 return "For an instrument with Position Sensitive Detectors (PSDs) the "
56 "'engineering' positions of individual detectors may not match the "
57 "true areas where neutrons are detected. This algorithm reads data "
58 "on the calibrated location of the detectors and adjusts the "
59 "parametrized instrument geometry accordingly.";
60 }
61
63 int version() const override { return 1; };
65 const std::string category() const override { return "CorrectionFunctions\\InstrumentCorrections"; }
66
67private:
69 void init() override;
70
72 void exec() override;
73
75 std::string m_filename;
78 bool processScalingFile(const std::string &scalingFile, std::vector<Kernel::V3D> &truePos);
80 // void runMoveInstrumentComp(const int& detIndex, const Kernel::V3D& shift);
81
83 void movePos(API::MatrixWorkspace_sptr &WS, std::map<int, Kernel::V3D> &posMap, std::map<int, double> &scaleMap);
85 void getDetPositionsFromRaw(const std::string &rawfile, std::vector<int> &detID, std::vector<Kernel::V3D> &pos);
86};
87
88} // namespace DataHandling
89} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Read the scaling information from a file (e.g.
Definition: SetScalingPSD.h:47
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: SetScalingPSD.h:63
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: SetScalingPSD.h:52
std::string m_filename
The name and path of the input file.
Definition: SetScalingPSD.h:75
API::MatrixWorkspace_sptr m_workspace
Pointer to the workspace.
Definition: SetScalingPSD.h:79
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: SetScalingPSD.h:65
const std::string summary() const override
Summary of algorithms purpose.
Definition: SetScalingPSD.h:54
int m_scalingOption
An integer option controlling the scaling method.
Definition: SetScalingPSD.h:77
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.