Mantid
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Algorithms::MayersSampleCorrectionStrategy Class Reference

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::PseudoRandomNumberGeneratorm_rng
 Random number generator. More...
 
const HistogramData::Points m_tofVals
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MayersSampleCorrectionStrategy()

Mantid::Algorithms::MayersSampleCorrectionStrategy::MayersSampleCorrectionStrategy ( MayersSampleCorrectionStrategy::Parameters  params,
HistogramData::Histogram  inputHist 
)

Constructor.

Parameters
paramsDefines the required parameters for the correction
inputHistA histogram containing the TOF values corresponding to the values to be corrected.

Definition at line 80 of file MayersSampleCorrectionStrategy.cpp.

References m_histogram.

◆ ~MayersSampleCorrectionStrategy()

Mantid::Algorithms::MayersSampleCorrectionStrategy::~MayersSampleCorrectionStrategy ( )
default

Destructor - defined in cpp file to use forward declaration with unique_ptr.

Destructor.

Member Function Documentation

◆ calculateMS()

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.

Parameters
irpIndex of current mur point (assumed zero based)
muRSingle \(\mu*r\) slice value
absAbsorption and self-attenuation factor ( \(A_s\) in Mayers paper)
Returns
A pair of (factor,weight)

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().

◆ calculateMuRange()

std::pair< double, double > Mantid::Algorithms::MayersSampleCorrectionStrategy::calculateMuRange ( ) const
private

Calculate the mu*r range required to cover the given tof range.

It requires that the internal parameters have been set.

Returns
A pair of (min,max) values for muR for the given time of flight

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().

◆ calculateSelfAttenuation()

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.

Parameters
muRSingle mu*r slice value
Returns
The self-attenuation factor for this sample

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().

◆ 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

Returns
A histogram containing corrected values

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().

◆ muR() [1/2]

double Mantid::Algorithms::MayersSampleCorrectionStrategy::muR ( const double  flightPath,
const double  tof 
) const
private

Calculate the value of mu*r for the given flightPath and time of flight.

Parameters
flightPathTotal distance travelled in metres
tofThe time of flight in microseconds
Returns
The mu*r value

Definition at line 289 of file MayersSampleCorrectionStrategy.cpp.

References muR(), and sigmaTotal().

Referenced by calculateMS(), calculateMuRange(), calculateSelfAttenuation(), getCorrectedHisto(), and muR().

◆ muR() [2/2]

double Mantid::Algorithms::MayersSampleCorrectionStrategy::muR ( const double  sigt) const
private

Calculate the value of mu*r for the given total scattering cross section.

Parameters
sigtThe total scattering cross section (barns)
Returns
The mu*r value

Definition at line 298 of file MayersSampleCorrectionStrategy.cpp.

References Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::cylRadius, m_pars, and Mantid::Algorithms::MayersSampleCorrectionStrategy::Parameters::rho.

◆ muRmax()

double Mantid::Algorithms::MayersSampleCorrectionStrategy::muRmax ( ) const
inlineprivate

Definition at line 65 of file MayersSampleCorrectionStrategy.h.

Referenced by getCorrectedHisto().

◆ muRmin()

double Mantid::Algorithms::MayersSampleCorrectionStrategy::muRmin ( ) const
inlineprivate

Definition at line 64 of file MayersSampleCorrectionStrategy.h.

Referenced by getCorrectedHisto().

◆ seedRNG()

void Mantid::Algorithms::MayersSampleCorrectionStrategy::seedRNG ( const size_t  seed)
private

(Re-)seed the random number generator

Parameters
seedSeed value for the random number generator

Definition at line 321 of file MayersSampleCorrectionStrategy.cpp.

References m_rng.

Referenced by calculateMS().

◆ sigmaTotal()

double Mantid::Algorithms::MayersSampleCorrectionStrategy::sigmaTotal ( const double  flightPath,
const double  tof 
) const
private

Calculate the value of the total scattering cross section for the given flightPath and time of flight.

Parameters
flightPathTotal distance travelled in metres
tofThe time of flight in microseconds
Returns
The total scattering cross section in barns

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().

Member Data Documentation

◆ m_histogram

const HistogramData::Histogram Mantid::Algorithms::MayersSampleCorrectionStrategy::m_histogram
private

◆ m_histoYSize

const size_t Mantid::Algorithms::MayersSampleCorrectionStrategy::m_histoYSize
private

Holds the number of Y vals to process.

Definition at line 79 of file MayersSampleCorrectionStrategy.h.

Referenced by calculateMuRange(), and getCorrectedHisto().

◆ m_muRrange

const std::pair<double, double> Mantid::Algorithms::MayersSampleCorrectionStrategy::m_muRrange
private

Limits for the range of mu*r values to cover.

Definition at line 81 of file MayersSampleCorrectionStrategy.h.

◆ m_pars

const Parameters Mantid::Algorithms::MayersSampleCorrectionStrategy::m_pars
private

A copy of the correction parameters.

Definition at line 74 of file MayersSampleCorrectionStrategy.h.

Referenced by calculateMS(), calculateMuRange(), calculateSelfAttenuation(), getCorrectedHisto(), muR(), and sigmaTotal().

◆ m_rng

std::unique_ptr<Kernel::PseudoRandomNumberGenerator> Mantid::Algorithms::MayersSampleCorrectionStrategy::m_rng
private

Random number generator.

Definition at line 83 of file MayersSampleCorrectionStrategy.h.

Referenced by calculateMS(), and seedRNG().

◆ m_tofVals

const HistogramData::Points Mantid::Algorithms::MayersSampleCorrectionStrategy::m_tofVals
private

Definition at line 77 of file MayersSampleCorrectionStrategy.h.

Referenced by calculateMuRange(), and getCorrectedHisto().


The documentation for this class was generated from the following files: