Mantid
Loading...
Searching...
No Matches
Q1D2.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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
10#include "MantidAlgorithms/DllConfig.h"
11#include "MantidHistogramData/Histogram.h"
13
14namespace Mantid {
15namespace API {
16class SpectrumInfo;
17}
18namespace Algorithms {
26class MANTID_ALGORITHMS_DLL Q1D2 final : public API::Algorithm {
27public:
29 Q1D2();
31 const std::string name() const override { return "Q1D"; }
33 const std::string summary() const override {
34 return "SANS 1D reduction. Converts a workspace in wavelength into a "
35 "workspace of momentum transfer, assuming elastic scattering";
36 }
37
39 int version() const override { return (2); }
40 const std::vector<std::string> seeAlso() const override { return {"Q1DWeighted", "Qxy"}; }
42 const std::string category() const override { return "SANS"; }
43
44protected:
45 Parallel::ExecutionMode
46 getParallelExecutionMode(const std::map<std::string, Parallel::StorageMode> &storageModes) const override;
47
48private:
52
54 void init() override;
56 void exec() override;
57
58 API::MatrixWorkspace_sptr setUpOutputWorkspace(const std::vector<double> &binParams) const;
59 // these are the steps that are run on each individual spectrum
60 void calculateNormalization(const size_t wavStart, const size_t wsIndex,
61 const API::MatrixWorkspace_const_sptr &pixelAdj,
62 const API::MatrixWorkspace_const_sptr &wavePixelAdj, double const *const binNorms,
63 double const *const binNormEs, HistogramData::HistogramY::iterator norm,
64 HistogramData::HistogramY::iterator normETo2) const;
65 void pixelWeight(const API::MatrixWorkspace_const_sptr &pixelAdj, const size_t wsIndex, double &weight,
66 double &error) const;
67 void addWaveAdj(const double *c, const double *Dc, HistogramData::HistogramY::iterator bInOut,
68 HistogramData::HistogramY::iterator e2InOut) const;
69 void addWaveAdj(const double *c, const double *Dc, HistogramData::HistogramY::iterator bInOut,
70 HistogramData::HistogramY::iterator e2InOut,
71 HistogramData::HistogramY::const_iterator wavePixelAdjData,
72 HistogramData::HistogramE::const_iterator wavePixelAdjError) const;
73 void normToMask(const size_t offSet, const size_t wsIndex, const HistogramData::HistogramY::iterator theNorms,
74 const HistogramData::HistogramY::iterator errorSquared) const;
75 void convertWavetoQ(const API::SpectrumInfo &spectrumInfo, const size_t wsInd, const bool doGravity,
76 const size_t offset, HistogramData::HistogramY::iterator Qs, const double extraLength) const;
77 void getQBinPlus1(const HistogramData::HistogramX &OutQs, const double QToFind,
78 HistogramData::HistogramY::const_iterator &loc) const;
79 void normalize(const HistogramData::HistogramY &normSum, const HistogramData::HistogramE &normError2,
80 HistogramData::HistogramY &counts, HistogramData::HistogramE &errors) const;
81};
82
83} // namespace Algorithms
84} // namespace Mantid
double error
Definition: IndexPeaks.cpp:133
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Definition: SpectrumInfo.h:53
Takes account of the effects of gravity for instruments where the y-axis points upwards,...
Definition: Q1D2.h:26
int version() const override
Algorithm's version.
Definition: Q1D2.h:39
const std::string name() const override
Algorithm's name.
Definition: Q1D2.h:31
API::MatrixWorkspace_const_sptr m_dataWS
the experimental workspace with counts across the detector
Definition: Q1D2.h:50
const std::string summary() const override
Summary of algorithms purpose.
Definition: Q1D2.h:33
const std::string category() const override
Algorithm's category for identification.
Definition: Q1D2.h:42
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: Q1D2.h:40
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
MANTID_KERNEL_DLL V3D normalize(V3D v)
Normalizes a V3D.
Definition: V3D.h:341
Helper class which provides the Collimation Length for SANS instruments.