Mantid
|
Applies the procedure found in section 4 of https://inis.iaea.org/search/search.aspx?orig_q=RN:20000574 for an array of tof, signal & error values. More...
#include <MayersSampleCorrectionStrategy.h>
Classes | |
struct | Parameters |
Stores parameters for a single calculation for a given angle and sample details. More... | |
Public Member Functions | |
std::pair< double, double > | calculateMS (const size_t irp, const double muR, const double abs) |
Calculate the multiple scattering factor for a single mu*r value & absorption value. More... | |
double | calculateSelfAttenuation (const double muR) |
Calculate the self-attenuation factor for a single mu*r value. More... | |
Mantid::HistogramData::Histogram | getCorrectedHisto () |
Return the correction factors. More... | |
MayersSampleCorrectionStrategy (MayersSampleCorrectionStrategy::Parameters params, HistogramData::Histogram inputHist) | |
Constructor. More... | |
~MayersSampleCorrectionStrategy () | |
Destructor - defined in cpp file to use forward declaration with unique_ptr. More... | |
Private Member Functions | |
std::pair< double, double > | calculateMuRange () const |
Calculate the mu*r range required to cover the given tof range. More... | |
double | muR (const double flightPath, const double tof) const |
Calculate the value of mu*r for the given flightPath and time of flight. More... | |
double | muR (const double sigt) const |
Calculate the value of mu*r for the given total scattering cross section. More... | |
double | muRmax () const |
double | muRmin () const |
void | seedRNG (const size_t seed) |
(Re-)seed the random number generator More... | |
double | sigmaTotal (const double flightPath, const double tof) const |
Calculate the value of the total scattering cross section for the given flightPath and time of flight. More... | |
Private Attributes | |
const HistogramData::Histogram | m_histogram |
const size_t | m_histoYSize |
Holds the number of Y vals to process. More... | |
const std::pair< double, double > | m_muRrange |
Limits for the range of mu*r values to cover. More... | |
const Parameters | m_pars |
A copy of the correction parameters. More... | |
std::unique_ptr< Kernel::PseudoRandomNumberGenerator > | m_rng |
Random number generator. More... | |
const HistogramData::Points | m_tofVals |
Applies the procedure found in section 4 of https://inis.iaea.org/search/search.aspx?orig_q=RN:20000574 for an array of tof, signal & error values.
Definition at line 27 of file MayersSampleCorrectionStrategy.h.
Mantid::Algorithms::MayersSampleCorrectionStrategy::MayersSampleCorrectionStrategy | ( | MayersSampleCorrectionStrategy::Parameters | params, |
HistogramData::Histogram | inputHist | ||
) |
Constructor.
params | Defines the required parameters for the correction |
inputHist | A histogram containing the TOF values corresponding to the values to be corrected. |
Definition at line 80 of file MayersSampleCorrectionStrategy.cpp.
References m_histogram.
|
default |
Destructor - defined in cpp file to use forward declaration with unique_ptr.
Destructor.
std::pair< double, double > Mantid::Algorithms::MayersSampleCorrectionStrategy::calculateMS | ( | const size_t | irp, |
const double | muR, | ||
const double | abs | ||
) |
Calculate the multiple scattering factor for a single mu*r value & absorption value.
Calculate the multiple scattering correction factor and weight for the given mur value.
irp | Index of current mur point (assumed zero based) |
muR | Single \(\mu*r\) slice value |
abs | Absorption and self-attenuation factor ( \(A_s\) in Mayers paper) |
Definition at line 223 of file MayersSampleCorrectionStrategy.cpp.
References Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::azimuth, Mantid::Kernel::StatOptions::CorrectedStdDev, Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::cylHeight, Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::cylRadius, Mantid::Kernel::delta, Mantid::Kernel::getStatistics(), m_pars, m_rng, Mantid::Kernel::StatOptions::Mean, Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::msNEvents, Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::msNRuns, muR(), seedRNG(), and Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::twoTheta.
Referenced by getCorrectedHisto().
|
private |
Calculate the mu*r range required to cover the given tof range.
It requires that the internal parameters have been set.
Definition at line 277 of file MayersSampleCorrectionStrategy.cpp.
References Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::l1, Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::l2, m_histoYSize, m_pars, m_tofVals, and muR().
double Mantid::Algorithms::MayersSampleCorrectionStrategy::calculateSelfAttenuation | ( | const double | muR | ) |
Calculate the self-attenuation factor for a single mu*r value.
Calculate the self-attenutation factor for the given mur value.
muR | Single mu*r slice value |
Definition at line 181 of file MayersSampleCorrectionStrategy.cpp.
References Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::azimuth, m_pars, muR(), and Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::twoTheta.
Referenced by getCorrectedHisto().
Mantid::HistogramData::Histogram Mantid::Algorithms::MayersSampleCorrectionStrategy::getCorrectedHisto | ( | ) |
Return the correction factors.
Correct the data for absorption and multiple scattering effects.
Allows both histogram or point data. For histogram the TOF is taken to be the mid point of a bin
Definition at line 103 of file MayersSampleCorrectionStrategy.cpp.
References calculateMS(), calculateSelfAttenuation(), Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::l1, Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::l2, m_histogram, m_histoYSize, m_pars, m_tofVals, Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::mscat, muR(), muRmax(), muRmin(), Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::sigmaSc, and sigmaTotal().
Referenced by Mantid::Algorithms::MayersSampleCorrection::exec().
|
private |
Calculate the value of mu*r for the given flightPath and time of flight.
flightPath | Total distance travelled in metres |
tof | The time of flight in microseconds |
Definition at line 289 of file MayersSampleCorrectionStrategy.cpp.
References muR(), and sigmaTotal().
Referenced by calculateMS(), calculateMuRange(), calculateSelfAttenuation(), getCorrectedHisto(), and muR().
|
private |
Calculate the value of mu*r for the given total scattering cross section.
sigt | The total scattering cross section (barns) |
Definition at line 298 of file MayersSampleCorrectionStrategy.cpp.
References Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::cylRadius, m_pars, and Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::rho.
|
inlineprivate |
Definition at line 65 of file MayersSampleCorrectionStrategy.h.
Referenced by getCorrectedHisto().
|
inlineprivate |
Definition at line 64 of file MayersSampleCorrectionStrategy.h.
Referenced by getCorrectedHisto().
|
private |
(Re-)seed the random number generator
seed | Seed value for the random number generator |
Definition at line 321 of file MayersSampleCorrectionStrategy.cpp.
References m_rng.
Referenced by calculateMS().
|
private |
Calculate the value of the total scattering cross section for the given flightPath and time of flight.
flightPath | Total distance travelled in metres |
tof | The time of flight in microseconds |
Definition at line 311 of file MayersSampleCorrectionStrategy.cpp.
References m_pars, Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::sigmaAbs, and Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::sigmaSc.
Referenced by getCorrectedHisto(), and muR().
|
private |
Definition at line 76 of file MayersSampleCorrectionStrategy.h.
Referenced by getCorrectedHisto(), and MayersSampleCorrectionStrategy().
|
private |
Holds the number of Y vals to process.
Definition at line 79 of file MayersSampleCorrectionStrategy.h.
Referenced by calculateMuRange(), and getCorrectedHisto().
|
private |
Limits for the range of mu*r values to cover.
Definition at line 81 of file MayersSampleCorrectionStrategy.h.
|
private |
A copy of the correction parameters.
Definition at line 74 of file MayersSampleCorrectionStrategy.h.
Referenced by calculateMS(), calculateMuRange(), calculateSelfAttenuation(), getCorrectedHisto(), muR(), and sigmaTotal().
|
private |
Random number generator.
Definition at line 83 of file MayersSampleCorrectionStrategy.h.
Referenced by calculateMS(), and seedRNG().
|
private |
Definition at line 77 of file MayersSampleCorrectionStrategy.h.
Referenced by calculateMuRange(), and getCorrectedHisto().