28 double getQ(
double wavelength,
double angle)
30 return 4.0 *
M_PI * std::sin(angle) / wavelength;
33 double axisAngle(
size_t i_axis, R3 k_f)
36 return R3Util::phi(k_f);
38 return M_PI_2 - R3Util::theta(k_f);
56 , m_wavelength(wavelength)
57 , m_alpha_i(-direction.alpha())
58 , m_phi_i(direction.phi())
63 : m_axes(other.m_axes)
64 , m_wavelength(other.m_wavelength)
65 , m_alpha_i(other.m_alpha_i)
66 , m_phi_i(other.m_phi_i)
108 const auto& axis_name =
axisName(i_axis, units);
109 const auto axis_size =
axisSize(i_axis);
110 return new FixedBinAxis(axis_name, axis_size, min, max);
154 return (k_i - k_f).y();
158 return (k_f - k_i).z();
166 return (k_i - k_f).y();
170 return (k_f - k_i).x();
189 const Direction& direction,
double wavelength)
191 , m_detector_pixel(regionOfInterestPixel)
198 , m_detector_pixel(other.m_detector_pixel->clone())
225 const auto& max_pos = i_axis == 0 ? k10 : k01;
226 const double shift = value -
m_axes[i_axis]->min();
227 const R3 out_dir = k00 + shift * (max_pos - k00).unit();
232 return axisAngle(i_axis, k_f);
238 return (k_i - k_f).y();
240 return (k_f - k_i).z();
245 return (k_i - k_f).y();
247 return (k_f - k_i).x();
303 const Direction& direction,
double wavelength)
330 if (std::find(available_units.begin(), available_units.end(), units) == available_units.cend())
Defines the macro ASSERT.
#define ASSERT(condition)
Defines axisUnitLabel and maps in namespace AxisNames.
Defines M_PI and some more mathematical constants.
const std::string z_axis_name
Defines interface CoordSystem2D and its subclasses.
R3 vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)
Defines class FixedBinAxis.
Defines class RectangularPixel.
Defines some unit conversion factors and other constants in namespace Units.
Interface for objects that provide axis translations to different units for IDetector objects.
OwningVector< IAxis > m_axes
size_t axisSize(size_t i_axis) const override
size_t rank() const override
virtual double calculateValue(size_t i_axis, Coords units, double value) const =0
void addAxisData(std::string name, double min, double max, size_t nbins)
std::vector< Coords > availableUnits() const override
Returns list of units that are available for all 2D detectors. Further units may be added by child cl...
CoordSystem2D(const Direction &direction, double wavelength=0)
double calculateMin(size_t i_axis, Coords units) const override
double calculateMax(size_t i_axis, Coords units) const override
IAxis * createConvertedAxis(size_t i_axis, Coords units) const override
DepthProbeCoordinates class handles the unit translations for depth probe simulations Its default uni...
DepthProbeCoordinates(const OwningVector< IAxis > &axes, const Direction &direction, double wavelength)
std::vector< Coords > availableUnits() const override
Returns list of units that are available for all 2D detectors. Further units may be added by child cl...
DepthProbeCoordinates * clone() const override
~DepthProbeCoordinates() override
double calculateValue(size_t, Coords units, double value) const override
std::vector< std::map< Coords, std::string > > createNameMaps() const override
A direction in three-dimensional space.
Axis with fixed bin size.
Abstract base class for one-dimensional axes.
Coords substituteDefaultUnits(Coords units) const
std::string axisName(size_t i_axis, Coords units=Coords::UNDEFINED) const
ICoordSystem class that handles the unit translations for rectangular detectors Its default units are...
std::vector< Coords > availableUnits() const override
Returns list of units that are available for all 2D detectors. Further units may be added by child cl...
double calculateValue(size_t i_axis, Coords units, double value) const override
ImageCoords(const OwningVector< IAxis > &axes, RectangularPixel *regionOfInterestPixel, const Direction &direction, double wavelength)
std::unique_ptr< RectangularPixel > m_detector_pixel
std::vector< std::map< Coords, std::string > > createNameMaps() const override
ImageCoords * clone() const override
ICoordSystem class that handles the unit translations for off-specular simulations with a spherical d...
OffspecCoordinates * clone() const override
OffspecCoordinates(const OwningVector< IAxis > &axes, const Direction &direction)
double calculateValue(size_t i_axis, Coords units, double value) const override
std::vector< std::map< Coords, std::string > > createNameMaps() const override
A pixel in a RectangularDetector.
ICoordSystem class that handles the unit translations for spherical detectors Its default units are r...
std::vector< Coords > availableUnits() const override
Returns list of units that are available for all 2D detectors. Further units may be added by child cl...
std::vector< std::map< Coords, std::string > > createNameMaps() const override
SphericalCoords * clone() const override
SphericalCoords(const OwningVector< IAxis > &axes, const Direction &direction, double wavelength)
double calculateValue(size_t i_axis, Coords units, double value) const override
~SphericalCoords() override
BA_DEVICE_API_ const std::map< Coords, std::string > offspecAxis0
BA_DEVICE_API_ const std::map< Coords, std::string > specAxis
BA_DEVICE_API_ const std::map< Coords, std::string > sphericalAxis1
BA_DEVICE_API_ const std::map< Coords, std::string > rectangularAxis1
BA_DEVICE_API_ const std::map< Coords, std::string > sampleDepthAxis
BA_DEVICE_API_ const std::map< Coords, std::string > sphericalAxis0
BA_DEVICE_API_ const std::map< Coords, std::string > rectangularAxis0
BA_DEVICE_API_ const std::map< Coords, std::string > offspecAxis1
double rad2deg(double angle)