Mantid
Loading...
Searching...
No Matches
MayersSampleCorrectionStrategy.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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 "MantidAlgorithms/DllConfig.h"
10#include "MantidHistogramData/Histogram.h"
11#include <memory>
12#include <utility>
13#include <vector>
14
15namespace Mantid {
16namespace Kernel {
17class PseudoRandomNumberGenerator;
18}
19namespace Algorithms {
20
27class MANTID_ALGORITHMS_DLL MayersSampleCorrectionStrategy {
28public:
33 struct Parameters {
34 bool mscat;
35 double l1;
36 double l2;
37 double twoTheta;
38 double azimuth;
39 double rho;
40 double sigmaSc;
41 double sigmaAbs;
42 double cylRadius;
43 double cylHeight;
44 size_t msNEvents;
45 size_t msNRuns;
46 };
47
49 MayersSampleCorrectionStrategy(MayersSampleCorrectionStrategy::Parameters params, HistogramData::Histogram inputHist);
53
55 Mantid::HistogramData::Histogram getCorrectedHisto();
56
58 double calculateSelfAttenuation(const double muR);
61 std::pair<double, double> calculateMS(const size_t irp, const double muR, const double abs);
62
63private:
64 inline double muRmin() const { return m_muRrange.first; }
65 inline double muRmax() const { return m_muRrange.second; }
66
67 std::pair<double, double> calculateMuRange() const;
68 double muR(const double flightPath, const double tof) const;
69 double muR(const double sigt) const;
70 double sigmaTotal(const double flightPath, const double tof) const;
71 void seedRNG(const size_t seed);
72
75 // Holds histogram to process
76 const HistogramData::Histogram m_histogram;
77 const HistogramData::Points m_tofVals;
79 const size_t m_histoYSize;
81 const std::pair<double, double> m_muRrange;
83 std::unique_ptr<Kernel::PseudoRandomNumberGenerator> m_rng;
84};
85
86} // namespace Algorithms
87} // namespace Mantid
Applies the procedure found in section 4 of https://inis.iaea.org/search/search.aspx?...
const Parameters m_pars
A copy of the correction parameters.
const std::pair< double, double > m_muRrange
Limits for the range of mu*r values to cover.
std::unique_ptr< Kernel::PseudoRandomNumberGenerator > m_rng
Random number generator.
~MayersSampleCorrectionStrategy()
Destructor - defined in cpp file to use forward declaration with unique_ptr.
const size_t m_histoYSize
Holds the number of Y vals to process.
Helper class which provides the Collimation Length for SANS instruments.
Stores parameters for a single calculation for a given angle and sample details.
size_t msNRuns
Number of runs to average ms correction over.