15 #ifndef BORNAGAIN_DEVICE_DETECTOR_IDETECTOR_H
16 #define BORNAGAIN_DEVICE_DETECTOR_IDETECTOR_H
72 void setAnalyzer(R3 direction,
double efficiency,
double total_transmission);
133 size_t axisBinIndex(
size_t index,
size_t selected_axis)
const;
213 virtual std::string
axisName(
size_t index)
const = 0;
Defines and implements the standard mix-in ICloneable.
Defines and implements templated class OwningVector.
Defines class DetectionProperties.
Defines class SimulationAreaIterator.
An incident neutron or x-ray beam.
Interface for objects that provide axis translations to different units for IDetector objects.
Stores radiation power per bin.
Holds precalculated information for faster DiffuseElement generation.
Collection of detector masks.
Data stucture containing both input and output of a single detector cell.
A direction in three-dimensional space.
Abstract base class for one-dimensional axes.
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Interface to provide axis translations to different units for simulation output.
Interface for detector resolution algorithms.
Abstract detector interface.
virtual std::pair< double, double > boundsOfExplicitRegionOfInterest(size_t iAxis) const
Lower and upper bound of one axis of an explicitly set ROI. Return 0/0 if no ROI has been explicitly ...
size_t sizeOfRegionOfInterest() const
The size of the "Region of Interest". Same as totalSize() if no region of interest has been explicitl...
void iterateOverRegionOfInterest(std::function< void(const_iterator)> func) const
Iterate over all points within "region of interest", no matter whether they are masked or not....
OwningVector< IAxis > m_axes
virtual size_t indexOfSpecular(const Beam &beam) const =0
Returns index of pixel that contains the specular wavevector. If no pixel contains this specular wave...
void addDetAxis(const IAxis &axis)
virtual Coords defaultCoords() const =0
Return default axes units.
virtual size_t sizeOfExplicitRegionOfInterest() const
Return 0 if no ROI has been explicitly set. Size means number of data points.
virtual std::string axisName(size_t index) const =0
Returns the name for the axis with given index.
size_t numberOfElements() const
Returns number of simulation elements.
SimulationAreaIterator beginRegionOfInterestPoints() const
Create begin-iterator to iterate over all points which lay within the "Region of Interest"....
void setRegionOfInterest(double xlow, double ylow, double xup, double yup)
Sets rectangular region of interest with lower left and upper right corners defined.
const PolFilter & analyzer() const
Returns detection properties.
const SimulationAreaIterator & const_iterator
std::pair< double, double > regionOfInterestBounds(size_t iAxis) const
The lower and upper bound of the region of interest. If no region of interest is explicitly defined,...
void maskAll()
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
void iterateOverNonMaskedPoints(std::function< void(const_iterator)> func) const
Iterate over all non-masked points within "region of interest". If no region of interest is explicitl...
std::vector< const INode * > nodeChildren() const override
Returns all children.
SimulationAreaIterator beginNonMaskedPoints() const
Create begin-iterator to iterate over all points which are not masked and lay within the "Region of I...
size_t axisBinIndex(size_t index, size_t selected_axis) const
Calculate axis index for given global index.
size_t regionOfInterestIndexToDetectorIndex(size_t regionOfInterestIndex) const
Convert an index of the region of interest to an index of the detector. If no region of interest is s...
virtual CoordSystem2D * scatteringCoords(const Beam &beam) const =0
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.
std::unique_ptr< Datafield > createDetectorMap() const
Returns empty detector map in given axes units. This map is a data array limited to the size of the "...
std::unique_ptr< IDetectorResolution > m_detector_resolution
size_t detectorIndexToRegionOfInterestIndex(size_t detectorIndex) const
const IAxis & axis(size_t index) const
One axis of the complete detector. Any region of interest is not taken into account.
void addMask(const IShape2D &shape, bool mask_value=true)
Adds mask of given shape to the stack of detector masks. The mask value 'true' means that the channel...
bool hasExplicitRegionOfInterest() const
True if a region of interest is explicitly set.
void setResolutionFunction(const IResolutionFunction2D &resFunc)
std::vector< size_t > active_indices() const
Returns vector of unmasked detector indices.
OwningVector< IAxis > axesClippedToRegionOfInterest() const
Returns the axes clipped to the region of interest. If no region of interest is explicitly defined,...
virtual void setDetectorNormal(const Direction &)
Inits detector with the beam settings.
void setAnalyzer(R3 direction, double efficiency, double total_transmission)
Sets the polarization analyzer characteristics of the detector.
SimulationAreaIterator endNonMaskedPoints() const
Create end-iterator to iterate over all points which are not masked and lay within the "Region of Int...
std::unique_ptr< DetectorContext > createContext() const
size_t getGlobalIndex(size_t x, size_t y) const
Calculate global index from two axis indices.
void setDetectorResolution(const IDetectorResolution &p_detector_resolution)
Sets the detector resolution.
virtual IPixel * createPixel(size_t index) const =0
Creates an IPixel for the given Datafield object and index.
std::vector< RoiOfAxis > m_explicitROI
an explicitly defined region of interest. Empty if no ROI has been defined. Vector index corresponds ...
IDetector * clone() const override=0
const IDetectorResolution * detectorResolution() const
Returns a pointer to detector resolution object.
SimulationAreaIterator endRegionOfInterestPoints() const
Create end-iterator to iterate over all points which lay within the "Region of Interest"....
void resetRegionOfInterest()
Resets region of interest making whole detector plane available for the simulation.
size_t rank() const
Returns number of defined axes.
const DetectorMask * detectorMask() const
Datafield * createDetectorIntensity(const std::vector< std::unique_ptr< DiffuseElement >> &elements) const
Returns new intensity map with resolution applied, and cropped to ROI if applicable.
void applyDetectorResolution(Datafield *p_intensity_map) const
Applies the detector resolution to the given intensity maps.
virtual ICoordSystem * offspecCoords(IAxis *beamAxis, const Direction &beamDirection) const =0
std::shared_ptr< DetectorMask > m_detector_mask
Base class for tree-like structures containing parameterized objects.
Interface for a function that maps [0,1]x[0,1] to the kvectors in a pixel. Abstract base class for Sp...
Interface providing two-dimensional resolution function.
Basic class for all shapes in 2D.
Detector properties (efficiency, transmission).
An iterator for SimulationArea.
Keeps RegionOfInterest (ROI) data of one axis.
size_t roiSize
number of bins on axis of ROI
size_t upperIndex
index corresponding to 'upper'
RoiOfAxis(const IAxis &axis, double lower, double upper)
size_t detectorSize
number of bins on axis of detector
size_t lowerIndex
index corresponding to 'lower'