Mantid
|
Implements the algorithm for calculating the correction factor for self-attenuation and single wavelength using a Monte Carlo. More...
#include <MCAbsorptionStrategy.h>
Public Member Functions | |
virtual void | calculate (Kernel::PseudoRandomNumberGenerator &rng, const Kernel::V3D &finalPos, const std::vector< double > &lambdas, const double lambdaFixed, std::vector< double > &attenuationFactors, std::vector< double > &attFactorErrors, MCInteractionStatistics &stats) override |
Compute the correction for a final position of the neutron and wavelengths before and after scattering. More... | |
MCAbsorptionStrategy (IMCInteractionVolume &interactionVolume, const IBeamProfile &beamProfile, Kernel::DeltaEMode::Type EMode, const size_t nevents, const size_t maxScatterPtAttempts, const bool regenerateTracksForEachLambda) | |
Constructor. More... | |
Public Member Functions inherited from Mantid::Algorithms::IMCAbsorptionStrategy | |
virtual void | calculate (Kernel::PseudoRandomNumberGenerator &rng, const Kernel::V3D &finalPos, const std::vector< double > &lambdas, const double lambdaFixed, std::vector< double > &attenuationFactors, std::vector< double > &attFactorErrors, MCInteractionStatistics &stats)=0 |
virtual | ~IMCAbsorptionStrategy ()=default |
Private Member Functions | |
IMCInteractionVolume & | setActiveRegion (IMCInteractionVolume &interactionVolume, const IBeamProfile &beamProfile) |
Set the active region on the interaction volume as smaller of the sample bounding box and the beam cross section. More... | |
Private Attributes | |
const IBeamProfile & | m_beamProfile |
const Kernel::DeltaEMode::Type | m_EMode |
const size_t | m_maxScatterAttempts |
const size_t | m_nevents |
const bool | m_regenerateTracksForEachLambda |
const IMCInteractionVolume & | m_scatterVol |
Implements the algorithm for calculating the correction factor for self-attenuation and single wavelength using a Monte Carlo.
A single instance has a fixed nominal source position, nominal sample position & sample + containers shapes.
The error on all points is defined to be \(\frac{SD}{\sqrt{N}}\), where SD is the standard deviation of the attenuation factors across the simulated tracks and N is the number of events generated.
Definition at line 41 of file MCAbsorptionStrategy.h.
Mantid::Algorithms::MCAbsorptionStrategy::MCAbsorptionStrategy | ( | IMCInteractionVolume & | interactionVolume, |
const IBeamProfile & | beamProfile, | ||
Kernel::DeltaEMode::Type | EMode, | ||
const size_t | nevents, | ||
const size_t | maxScatterPtAttempts, | ||
const bool | regenerateTracksForEachLambda | ||
) |
Constructor.
interactionVolume | A reference to the MCInteractionVolume dependency |
beamProfile | A reference to the object the beam profile |
EMode | The energy mode of the instrument |
nevents | The number of Monte Carlo events used in the simulation |
maxScatterPtAttempts | The maximum number of tries to generate a random point within the object |
regenerateTracksForEachLambda | Whether to resimulate tracks for each wavelength point or not |
Definition at line 31 of file MCAbsorptionStrategy.cpp.
|
overridevirtual |
Compute the correction for a final position of the neutron and wavelengths before and after scattering.
rng | A reference to a PseudoRandomNumberGenerator |
finalPos | Defines the final position of the neutron, assumed to be where it is detected |
lambdas | Set of wavelength values from the input workspace |
lambdaFixed | Efixed value for a detector ID converted to wavelength, in \(\\A^-1\) |
attenuationFactors | A vector containing the calculated correction factors |
attFactorErrors | A vector containing the calculated correction factor errors |
stats | A statistics class to hold the statistics on the generated tracks such as the scattering angle and count of scatter points generated in each sample or environment part |
Implements Mantid::Algorithms::IMCAbsorptionStrategy.
Definition at line 69 of file MCAbsorptionStrategy.cpp.
References Mantid::Algorithms::IMCInteractionVolume::calculateBeforeAfterTrack(), Mantid::Kernel::delta, Mantid::Kernel::DeltaEMode::Direct, Mantid::Algorithms::IBeamProfile::generatePoint(), Mantid::Algorithms::IMCInteractionVolume::getFullBoundingBox(), Mantid::Kernel::DeltaEMode::Indirect, m_beamProfile, m_EMode, m_maxScatterAttempts, m_nevents, m_regenerateTracksForEachLambda, m_scatterVol, and std::to_string().
Referenced by Mantid::Algorithms::AddAbsorptionWeightedPathLengths::exec().
|
private |
Set the active region on the interaction volume as smaller of the sample bounding box and the beam cross section.
Trying to keep the beam details outside the interaction volume class
interactionVolume | The interaction volume object |
beamProfile | The beam profile |
Definition at line 46 of file MCAbsorptionStrategy.cpp.
References Mantid::Algorithms::IBeamProfile::defineActiveRegion(), Mantid::Algorithms::IMCInteractionVolume::getFullBoundingBox(), and Mantid::Algorithms::IMCInteractionVolume::setActiveRegion().
|
private |
Definition at line 52 of file MCAbsorptionStrategy.h.
Referenced by calculate().
|
private |
Definition at line 56 of file MCAbsorptionStrategy.h.
Referenced by calculate().
|
private |
Definition at line 55 of file MCAbsorptionStrategy.h.
Referenced by calculate().
|
private |
Definition at line 54 of file MCAbsorptionStrategy.h.
Referenced by calculate().
|
private |
Definition at line 57 of file MCAbsorptionStrategy.h.
Referenced by calculate().
|
private |
Definition at line 53 of file MCAbsorptionStrategy.h.
Referenced by calculate().