|
| 1 | +// Mantid Repository : https://github.com/mantidproject/mantid |
| 2 | +// |
| 3 | +// Copyright © 2024 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 | +#include "MantidAPI/Algorithm.h" |
| 10 | +#include "MantidAPI/MatrixWorkspace_fwd.h" |
| 11 | +#include "MantidDataHandling/DllConfig.h" |
| 12 | +#include "MantidGeometry/IDTypes.h" |
| 13 | + |
| 14 | +namespace NeXus { |
| 15 | +class File; |
| 16 | +} |
| 17 | + |
| 18 | +namespace Mantid { |
| 19 | +namespace DataHandling { |
| 20 | + |
| 21 | +/** AlignAndFocusPowderSlim : TODO: DESCRIPTION |
| 22 | + */ |
| 23 | +class MANTID_DATAHANDLING_DLL AlignAndFocusPowderSlim : public API::Algorithm { |
| 24 | +public: |
| 25 | + const std::string name() const override; |
| 26 | + int version() const override; |
| 27 | + const std::string category() const override; |
| 28 | + const std::string summary() const override; |
| 29 | + const std::vector<std::string> seeAlso() const override; |
| 30 | + |
| 31 | + class MANTID_DATAHANDLING_DLL BankCalibration { |
| 32 | + public: |
| 33 | + BankCalibration(const detid_t idmin, const detid_t idmax, const std::map<detid_t, double> &calibration_map); |
| 34 | + const double &value(const detid_t detid) const; |
| 35 | + const detid_t &idmin() const; |
| 36 | + detid_t idmax() const; |
| 37 | + |
| 38 | + private: |
| 39 | + std::vector<double> m_calibration; |
| 40 | + detid_t m_detid_offset; |
| 41 | + }; |
| 42 | + |
| 43 | +private: |
| 44 | + void init() override; |
| 45 | + std::map<std::string, std::string> validateInputs() override; |
| 46 | + void exec() override; |
| 47 | + |
| 48 | + API::MatrixWorkspace_sptr createOutputWorkspace(const size_t numHist, const bool linearBins, const double x_delta); |
| 49 | + API::MatrixWorkspace_sptr editInstrumentGeometry(API::MatrixWorkspace_sptr &wksp, const double l1, |
| 50 | + const std::vector<double> &polars, |
| 51 | + const std::vector<specnum_t> &specids, |
| 52 | + const std::vector<double> &l2s, |
| 53 | + const std::vector<double> &azimuthals); |
| 54 | + void initCalibrationConstants(API::MatrixWorkspace_sptr &wksp, const std::vector<double> &difc_focus); |
| 55 | + void loadCalFile(const API::Workspace_sptr &inputWS, const std::string &filename, |
| 56 | + const std::vector<double> &difc_focus); |
| 57 | + |
| 58 | + std::map<detid_t, double> m_calibration; // detid: 1/difc |
| 59 | + std::set<detid_t> m_masked; |
| 60 | + bool is_time_filtered{false}; |
| 61 | + size_t pulse_start_index{0}; |
| 62 | + size_t pulse_stop_index{std::numeric_limits<size_t>::max()}; |
| 63 | + /// Index to load start at in the file |
| 64 | + std::vector<int64_t> loadStart; |
| 65 | + /// How much to load in the file |
| 66 | + std::vector<int64_t> loadSize; |
| 67 | +}; |
| 68 | + |
| 69 | +} // namespace DataHandling |
| 70 | +} // namespace Mantid |
0 commit comments