Mantid
Loading...
Searching...
No Matches
AlignAndFocusPowderSlim.h
Go to the documentation of this file.
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
11#include "MantidDataHandling/DllConfig.h"
15
17
20class MANTID_DATAHANDLING_DLL AlignAndFocusPowderSlim : public API::Algorithm {
21public:
22 const std::string name() const override;
23 int version() const override;
24 const std::string category() const override;
25 const std::string summary() const override;
26 const std::vector<std::string> seeAlso() const override;
27
28private:
29 void init() override;
30 std::map<std::string, std::string> validateInputs() override;
31 void exec() override;
32
33 API::MatrixWorkspace_sptr createOutputWorkspace();
34 API::MatrixWorkspace_sptr editInstrumentGeometry(API::MatrixWorkspace_sptr &wksp, const double l1,
35 const std::vector<double> &polars,
36 const std::vector<specnum_t> &specids,
37 const std::vector<double> &l2s,
38 const std::vector<double> &azimuthals);
40 void initCalibrationConstants(API::MatrixWorkspace_sptr &wksp, const std::vector<double> &difc_focus);
41 void loadCalFile(const API::Workspace_sptr &inputWS, const std::string &filename,
42 const std::vector<double> &difc_focus);
43 void initScaleAtSample(const API::MatrixWorkspace_sptr &wksp);
44 std::vector<std::pair<size_t, size_t>> determinePulseIndices(const API::MatrixWorkspace_sptr &wksp,
45 const Kernel::TimeROI &filterROI);
46 static std::vector<std::pair<int, std::pair<size_t, size_t>>>
47 determinePulseIndicesTargets(const API::MatrixWorkspace_sptr &wksp, const Kernel::TimeROI &filterROI,
48 const DataObjects::TimeSplitter &timeSplitter);
49 Kernel::TimeROI getFilterROI(const API::MatrixWorkspace_sptr &wksp);
50 DataObjects::TimeSplitter timeSplitterFromSplitterWorkspace(const Types::Core::DateAndTime &);
51
52 std::map<detid_t, double> m_calibration;
57 std::map<detid_t, double> m_scale_at_sample;
58 std::set<detid_t> m_masked;
59 bool is_time_filtered{false};
61 std::vector<int64_t> loadStart;
63 std::vector<int64_t> loadSize;
64};
65
66// these properties are public to simplify testing and calling from other code
67namespace PropertyNames {
68const std::string FILENAME("Filename");
69const std::string CAL_FILE("CalFileName");
70const std::string FILTER_TIMESTART("FilterByTimeStart");
71const std::string FILTER_TIMESTOP("FilterByTimeStop");
72const std::string SPLITTER_WS("SplitterWorkspace");
73const std::string SPLITTER_RELATIVE("RelativeTime");
74const std::string CORRECTION_TO_SAMPLE("CorrectionToSample");
75const std::string PROCESS_BANK_SPLIT_TASK("ProcessBankSplitTask");
76const std::string FULL_TIME("UseFullTime");
77const std::string FILTER_BAD_PULSES("FilterBadPulses");
78const std::string FILTER_BAD_PULSES_LOWER_CUTOFF("BadPulsesLowerCutoff");
79const std::string X_MIN("XMin");
80const std::string X_MAX("XMax");
81const std::string X_DELTA("XDelta");
82const std::string BIN_UNITS("BinningUnits");
83const std::string BINMODE("BinningMode");
84const std::string OUTPUT_WKSP("OutputWorkspace");
85const std::string READ_SIZE_FROM_DISK("ReadSizeFromDisk");
86const std::string EVENTS_PER_THREAD("EventsPerThread");
87const std::string ALLOW_LOGS("LogAllowList");
88const std::string BLOCK_LOGS("LogBlockList");
89const std::string OUTPUT_SPEC_NUM("OutputSpectrumNumber");
90} // namespace PropertyNames
91
92} // namespace Mantid::DataHandling::AlignAndFocusPowderSlim
std::string name
Definition Run.cpp:60
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
std::vector< int64_t > loadStart
Index to load start at in the file.
std::map< detid_t, double > m_scale_at_sample
Multiplicative 0<value<1 to move neutron TOF at sample.
TimeROI : Object that holds information about when the time measurement was active.
Definition TimeROI.h:18
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
const std::string FILTER_TIMESTART("FilterByTimeStart")
const std::string FILTER_BAD_PULSES_LOWER_CUTOFF("BadPulsesLowerCutoff")
const std::string OUTPUT_SPEC_NUM("OutputSpectrumNumber")
const std::string PROCESS_BANK_SPLIT_TASK("ProcessBankSplitTask")
const std::string CORRECTION_TO_SAMPLE("CorrectionToSample")
const std::string FILTER_TIMESTOP("FilterByTimeStop")
const std::string SPLITTER_WS("SplitterWorkspace")
const std::string EVENTS_PER_THREAD("EventsPerThread")
const std::string FILTER_BAD_PULSES("FilterBadPulses")
const std::string READ_SIZE_FROM_DISK("ReadSizeFromDisk")