Mantid
Loading...
Searching...
No Matches
GravitySANSHelper.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 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 "MantidKernel/V3D.h"
10
11namespace Mantid {
12namespace API {
13class SpectrumInfo;
14}
15namespace Algorithms {
23public:
25 GravitySANSHelper(const API::SpectrumInfo &spectrumInfo, const size_t index, const double extraLength = 0.0);
26 double calcSinTheta(const double wavAngstroms) const;
27 double calcComponents(const double wavAngstroms, double &xFrac, double &yFrac) const;
28
29 double gravitationalDrop(const double wav) const { return m_dropPerAngstrom2 * wav * wav; }
30
31private:
38
47 mutable double m_cachedDrop;
48
49 const Kernel::V3D &getDetLoc(const double wav) const;
50 double gravitationalDrop(const double L2, const double waveLength, const double extraLength) const;
51 double calcSinTheta() const;
52};
53} // namespace Algorithms
54} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Definition: SpectrumInfo.h:53
A helper class for calculating neutron's gravitional drop.
double m_dropPerAngstrom2
the drop is proportional to the wavelength squared, storing this drop increases calculation speed a l...
double m_cachedDrop
the drop that was last caclulated, this allows m_cachedDetLoc to be recalculated each time without it...
Kernel::V3D m_cachedLineOfSight
the location that the neutron would have been detected at if it continued in a straight line,...
double gravitationalDrop(const double wav) const
double calcSinTheta() const
getDetLoc must have been called before this is used to calculate the sin of the angle
const Kernel::V3D & getDetLoc(const double wav) const
Finds the location of the detector the neutron would have entered if it followed a straight line path...
Kernel::V3D m_samplePos
coordinates of the sample
double m_beamLineNorm
twice the distance from the source to the sample
double calcComponents(const double wavAngstroms, double &xFrac, double &yFrac) const
Calculate the sins and cosins of angles as required to calculate Q is 2 dimensions.
Kernel::V3D m_beamLine
the displacement from the source to the sample
Class for 3D vectors.
Definition: V3D.h:34
Helper class which provides the Collimation Length for SANS instruments.