28 double alpha_min,
double alpha_max)
34 :
SphericalDetector(n_bin, phi - width / 2, phi + width / 2, n_bin, alpha - width / 2,
53 const Bin1D alpha_bin = alpha_axis.
bin(alpha_index);
54 const Bin1D phi_bin = phi_axis.
bin(phi_index);
66 throw std::runtime_error(
67 "SphericalDetector::getAxisName(size_t index) -> Error! index > 1");
89 const IAxis& yAxis = *axes[1];
Defines the macro ASSERT.
#define ASSERT(condition)
Defines structs Bin1D, Bin1DCVector.
Defines M_PI and some more mathematical constants.
Defines interface CoordSystem2D and its subclasses.
Defines class DiffuseElement.
Defines interface IDetectorResolution.
Defines class SphericalDetector.
Defines class SphericalPixel.
Defines some unit conversion factors and other constants in namespace Units.
An incident neutron or x-ray beam.
Direction direction() const
double wavelength() const
Interface for objects that provide axis translations to different units for IDetector objects.
A direction in three-dimensional space.
Abstract base class for one-dimensional axes.
virtual bool contains(double value) const
Returns true if axis contains given point.
virtual size_t findClosestIndex(double value) const =0
find bin index which is best match for given value
virtual IAxis * clone() const =0
virtual Bin1D bin(size_t index) const =0
retrieve a 1d bin for the given index
Interface to provide axis translations to different units for simulation output.
size_t axisBinIndex(size_t index, size_t selected_axis) const
Calculate axis index for given global index.
size_t totalSize() const
Returns total number of pixels. Any region of interest is not taken into account.
void setDetectorParameters(size_t n_x, double x_min, double x_max, size_t n_y, double y_min, double y_max)
Sets equidistant axes.
const IAxis & axis(size_t index) const
One axis of the complete detector. Any region of interest is not taken into account.
OwningVector< IAxis > axesClippedToRegionOfInterest() const
Returns the axes clipped to the region of interest. If no region of interest is explicitly defined,...
size_t getGlobalIndex(size_t x, size_t y) const
Calculate global index from two axis indices.
size_t rank() const
Returns number of defined axes.
Interface for a function that maps [0,1]x[0,1] to the kvectors in a pixel. Abstract base class for Sp...
ICoordSystem class that handles the unit translations for off-specular simulations with a spherical d...
ICoordSystem class that handles the unit translations for spherical detectors Its default units are r...
A detector with coordinate axes along angles phi and alpha.
std::string axisName(size_t index) const override
Returns the name for the axis with given index.
size_t indexOfSpecular(const Beam &beam) const override
Returns index of pixel that contains the specular wavevector. If no pixel contains this specular wave...
IPixel * createPixel(size_t index) const override
Creates an IPixel for the given Datafield object and index.
SphericalDetector()=default
SphericalDetector * clone() const override
ICoordSystem * offspecCoords(IAxis *beamAxis, const Direction &beamDirection) const override
CoordSystem2D * scatteringCoords(const Beam &beam) const override
A pixel in a SphericalDetector.