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
44private:
48
50 void init() override;
52 void exec() override;
53
54 API::MatrixWorkspace_sptr setUpOutputWorkspace(const std::vector<double> &binParams) const;
55 // these are the steps that are run on each individual spectrum
56 void calculateNormalization(const size_t wavStart, const size_t wsIndex,
57 const API::MatrixWorkspace_const_sptr &pixelAdj,
58 const API::MatrixWorkspace_const_sptr &wavePixelAdj, double const *const binNorms,
59 double const *const binNormEs, HistogramData::HistogramY::iterator norm,
60 HistogramData::HistogramY::iterator normETo2) const;
61 void pixelWeight(const API::MatrixWorkspace_const_sptr &pixelAdj, const size_t wsIndex, double &weight,
62 double &error) const;
63 void addWaveAdj(const double *c, const double *Dc, HistogramData::HistogramY::iterator bInOut,
64 HistogramData::HistogramY::iterator e2InOut) const;
65 void addWaveAdj(const double *c, const double *Dc, HistogramData::HistogramY::iterator bInOut,
66 HistogramData::HistogramY::iterator e2InOut,
67 HistogramData::HistogramY::const_iterator wavePixelAdjData,
68 HistogramData::HistogramE::const_iterator wavePixelAdjError) const;
69 void normToMask(const size_t offSet, const size_t wsIndex, const HistogramData::HistogramY::iterator theNorms,
70 const HistogramData::HistogramY::iterator errorSquared) const;
71 void convertWavetoQ(const API::SpectrumInfo &spectrumInfo, const size_t wsInd, const bool doGravity,
72 const size_t offset, HistogramData::HistogramY::iterator Qs, const double extraLength) const;
73 void getQBinPlus1(const HistogramData::HistogramX &OutQs, const double QToFind,
74 HistogramData::HistogramY::const_iterator &loc) const;
75 void normalize(const HistogramData::HistogramY &normSum, const HistogramData::HistogramE &normError2,
76 HistogramData::HistogramY &counts, HistogramData::HistogramE &errors) const;
77};
78
79} // namespace Algorithms
80} // namespace Mantid
double error
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
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:46
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:352
Helper class which provides the Collimation Length for SANS instruments.